2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2016-03-18 17:07:31 -07:00
|
|
|
|
|
|
|
#include <memory>
|
2019-09-27 19:53:03 -07:00
|
|
|
#include "Runtime/RetroTypes.hpp"
|
2016-03-18 17:07:31 -07:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
namespace metaforce {
|
2016-03-18 17:07:31 -07:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
enum class EPaletteFormat {
|
|
|
|
IA8 = 0x0,
|
|
|
|
RGB565 = 0x1,
|
|
|
|
RGB5A3 = 0x2,
|
2016-03-18 17:07:31 -07:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CGraphicsPalette {
|
|
|
|
friend class CTextRenderBuffer;
|
|
|
|
EPaletteFormat x0_fmt;
|
|
|
|
u32 x4_;
|
|
|
|
int x8_entryCount;
|
|
|
|
std::unique_ptr<u16[]> xc_entries;
|
|
|
|
/* x10_ GXTlutObj here */
|
|
|
|
bool x1c_ = false;
|
|
|
|
|
2016-03-18 17:07:31 -07:00
|
|
|
public:
|
2020-03-30 20:52:22 -07:00
|
|
|
explicit CGraphicsPalette(EPaletteFormat fmt, int count)
|
|
|
|
: x0_fmt(fmt), x8_entryCount(count), xc_entries(new u16[count]) {}
|
2022-02-17 23:37:54 -08:00
|
|
|
explicit CGraphicsPalette(CInputStream& in) : x0_fmt(EPaletteFormat(in.ReadLong())) {
|
|
|
|
u16 w = in.ReadShort();
|
|
|
|
u16 h = in.ReadShort();
|
2018-12-07 21:30:43 -08:00
|
|
|
x8_entryCount = w * h;
|
2016-07-21 13:02:53 -07:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
/* GX Tlut init here */
|
|
|
|
}
|
2016-03-18 17:07:31 -07:00
|
|
|
};
|
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|