2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-03-19 00:07:31 +00:00
|
|
|
|
2022-03-04 07:47:21 +00:00
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
|
2016-03-19 00:07:31 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2022-02-27 02:18:58 +00:00
|
|
|
class CInputStream;
|
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 {
|
2022-02-27 02:18:58 +00:00
|
|
|
static u32 sCurrentFrameCount;
|
2018-12-08 05:30:43 +00:00
|
|
|
friend class CTextRenderBuffer;
|
|
|
|
EPaletteFormat x0_fmt;
|
2022-02-27 02:18:58 +00:00
|
|
|
u32 x4_frameLoaded{};
|
|
|
|
u32 x8_entryCount;
|
|
|
|
std::unique_ptr<u8[]> xc_entries;
|
|
|
|
/* GXTlutObj x10_; */
|
|
|
|
bool x1c_locked = false;
|
2018-12-08 05:30:43 +00:00
|
|
|
|
2016-03-19 00:07:31 +00:00
|
|
|
public:
|
2022-02-27 02:18:58 +00:00
|
|
|
explicit CGraphicsPalette(EPaletteFormat fmt, int count);
|
|
|
|
explicit CGraphicsPalette(CInputStream& in);
|
2022-03-03 07:51:11 +00:00
|
|
|
|
|
|
|
void Load();
|
2022-03-04 07:47:21 +00:00
|
|
|
|
|
|
|
[[nodiscard]] const u8* GetEntries() const { return xc_entries.get(); }
|
|
|
|
|
2022-03-03 07:51:11 +00:00
|
|
|
static void SetCurrentFrameCount(u32 frameCount) { sCurrentFrameCount = frameCount; }
|
2016-03-19 00:07:31 +00:00
|
|
|
};
|
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|