metaforce/Runtime/Graphics/CGraphicsPalette.hpp

41 lines
757 B
C++
Raw Normal View History

2018-10-06 20:42:33 -07:00
#pragma once
2016-03-18 17:07:31 -07:00
#include <memory>
#include "RetroTypes.hpp"
namespace urde
{
enum class EPaletteFormat
{
IA8 = 0x0,
RGB565 = 0x1,
RGB5A3 = 0x2,
};
class CGraphicsPalette
{
2016-03-22 01:15:00 -07:00
friend class CTextRenderBuffer;
2016-03-18 17:07:31 -07:00
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:
CGraphicsPalette(EPaletteFormat fmt, int count)
: x0_fmt(fmt), x8_entryCount(count), xc_entries(new u16[count]) {}
CGraphicsPalette(CInputStream& in)
: x0_fmt(EPaletteFormat(in.readUint32Big()))
{
u16 w = in.readUint16Big();
u16 h = in.readUint16Big();
x8_entryCount = w * h;
/* GX Tlut init here */
}
2016-03-18 17:07:31 -07:00
};
}