2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-16 18:57:03 +00:00

Initial CFont implementation, proper CTexture/CGraphicsPalette structures

This commit is contained in:
2022-02-26 18:18:58 -08:00
parent 40a1f3c4a0
commit b02ec12049
14 changed files with 312 additions and 110 deletions

View File

@@ -0,0 +1,22 @@
#include "Runtime/Graphics/CGraphicsPalette.hpp"
#include "Runtime/Streams/CInputStream.hpp"
namespace metaforce {
u32 CGraphicsPalette::sCurrentFrameCount = 0;
CGraphicsPalette::CGraphicsPalette(EPaletteFormat fmt, int count)
: x0_fmt(fmt), x8_entryCount(count), xc_entries(new u8[count * 2]) {
//GXInitTlutObj(&x10_tlutObj, xc_entries.get(), x8_entryCount);
}
CGraphicsPalette::CGraphicsPalette(CInputStream& in) : x0_fmt(EPaletteFormat(in.ReadLong())) {
u16 w = in.ReadShort();
u16 h = in.ReadShort();
x8_entryCount = w * h;
xc_entries.reset(new u8[x8_entryCount * 2]);
in.Get(xc_entries.get(), x8_entryCount * 2);
//GXInitTlutObj(&x10_tlutObj, xc_entries.get(), x8_entryCount);
//DCFlushRange(xc_entries.get(), x8_entryCount * 2);
}
} // namespace metaforce