mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 23:47:43 +00:00
Various rendering fixes
This commit is contained in:
@@ -686,6 +686,15 @@ void CTexture::BuildDXT1(const void* data, size_t length) {
|
||||
} BooTrace);
|
||||
}
|
||||
|
||||
void CTexture::BuildDXT3(const void* data, size_t length) {
|
||||
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
|
||||
m_booTex =
|
||||
ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::DXT3, boo::TextureClampMode::Repeat, data, length)
|
||||
.get();
|
||||
return true;
|
||||
} BooTrace);
|
||||
}
|
||||
|
||||
CTexture::CTexture(ETexelFormat fmt, s16 w, s16 h, s32 mips) : x0_fmt(fmt), x4_w(w), x6_h(h), x8_mips(mips) {
|
||||
/*
|
||||
x64_ = sMangleMipmaps;
|
||||
@@ -746,6 +755,9 @@ CTexture::CTexture(std::unique_ptr<u8[]>&& in, u32 length, bool otex) {
|
||||
case ETexelFormat::CMPRPC:
|
||||
BuildDXT1(owned.get() + 12, length - 12);
|
||||
break;
|
||||
case ETexelFormat::CMPRPCA:
|
||||
BuildDXT3(owned.get() + 12, length - 12);
|
||||
break;
|
||||
default:
|
||||
Log.report(logvisor::Fatal, "invalid texture type %d for boo", int(x0_fmt));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user