2016-03-19 00:07:31 +00:00
|
|
|
#ifndef __URDE_CGRAPHICSPALETTE_HPP__
|
|
|
|
#define __URDE_CGRAPHICSPALETTE_HPP__
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
|
|
|
|
enum class EPaletteFormat
|
|
|
|
{
|
|
|
|
IA8 = 0x0,
|
|
|
|
RGB565 = 0x1,
|
|
|
|
RGB5A3 = 0x2,
|
|
|
|
};
|
|
|
|
|
|
|
|
class CGraphicsPalette
|
|
|
|
{
|
2016-03-22 08:15:00 +00:00
|
|
|
friend class CTextRenderBuffer;
|
2016-03-19 00:07:31 +00:00
|
|
|
EPaletteFormat x0_fmt;
|
2016-07-21 20:02:53 +00:00
|
|
|
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:
|
|
|
|
CGraphicsPalette(EPaletteFormat fmt, int count)
|
2016-07-21 20:02:53 +00:00
|
|
|
: 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-19 00:07:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CGRAPHICSPALETTE_HPP__
|