mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-14 23:26:07 +00:00
Add DolphinCPalette, logic matched, unfortunately has instruction swaps around TLUT ops
Former-commit-id: 9684ace9af
This commit is contained in:
39
include/Kyoto/Graphics/CGraphicsPalette.hpp
Normal file
39
include/Kyoto/Graphics/CGraphicsPalette.hpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef _CGRAPHICSPALETTE
|
||||
#define _CGRAPHICSPALETTE
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "dolphin/gx.h"
|
||||
|
||||
#include <rstl/single_ptr.hpp>
|
||||
|
||||
enum EPaletteFormat {
|
||||
kPF_IA8 = GX_TL_IA8,
|
||||
kPF_RGB565 = GX_TL_RGB565,
|
||||
kPF_RGB5A3 = GX_TL_RGB5A3,
|
||||
};
|
||||
|
||||
class CInputStream;
|
||||
|
||||
class CGraphicsPalette {
|
||||
public:
|
||||
CGraphicsPalette(EPaletteFormat format, int numEntries);
|
||||
CGraphicsPalette(CInputStream& in);
|
||||
~CGraphicsPalette();
|
||||
|
||||
ushort* GetPaletteData() { return xc_entries.get(); }
|
||||
const ushort* GetPaletteData() const { return xc_entries.get(); }
|
||||
void Load() const;
|
||||
void UnLock();
|
||||
|
||||
private:
|
||||
static uint sCurrentFrameCount;
|
||||
EPaletteFormat x0_fmt;
|
||||
mutable uint x4_frameLoaded;
|
||||
uint x8_entryCount;
|
||||
rstl::single_ptr<ushort> xc_entries;
|
||||
GXTlutObj x10_tlutObj;
|
||||
bool x1c_locked;
|
||||
};
|
||||
|
||||
#endif // _CGRAPHICSPALETTE
|
||||
Reference in New Issue
Block a user