metaforce/Runtime/Graphics/CGraphicsPalette.hpp

35 lines
714 B
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2016-03-19 00:07:31 +00:00
#include <memory>
#include "RetroTypes.hpp"
2018-12-08 05:30:43 +00:00
namespace urde {
2016-03-19 00:07:31 +00:00
2018-12-08 05:30:43 +00:00
enum class EPaletteFormat {
IA8 = 0x0,
RGB565 = 0x1,
RGB5A3 = 0x2,
2016-03-19 00:07:31 +00:00
};
2018-12-08 05:30:43 +00: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-19 00:07:31 +00:00
public:
2018-12-08 05:30:43 +00:00
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;
2018-12-08 05:30:43 +00:00
/* GX Tlut init here */
}
2016-03-19 00:07:31 +00:00
};
2018-12-08 05:30:43 +00:00
} // namespace urde