2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 23:47:42 +00:00

Octree generation fixes

This commit is contained in:
Jack Andersen
2017-12-01 19:50:05 -10:00
parent 7cd3e8f502
commit 357b001cac
14 changed files with 518 additions and 216 deletions

View File

@@ -786,6 +786,16 @@ void CTexture::BuildC8Font(const void* data, EFontType ftype)
});
}
void CTexture::BuildDXT1(const void* data, size_t length)
{
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) -> bool
{
m_booTex = ctx.newStaticTexture(x4_w, x6_h, x8_mips, boo::TextureFormat::DXT1,
boo::TextureClampMode::Repeat, data, length).get();
return true;
});
}
CTexture::CTexture(ETexelFormat fmt, s16 w, s16 h, s32 mips)
: x0_fmt(fmt)
, x4_w(w)
@@ -850,6 +860,9 @@ CTexture::CTexture(std::unique_ptr<u8[]>&& in, u32 length, bool otex)
BuildC8(owned.get() + 12, length - 12);
otex = true;
break;
case ETexelFormat::CMPRPC:
BuildDXT1(owned.get() + 12, length - 12);
break;
default:
Log.report(logvisor::Fatal, "invalid texture type %d for boo", int(x0_fmt));
}