16 gfx::PixelFormat pix_fmt;
17 gfx::MappingType map_type;
18 gfx::CharacterFormat char_fmt;
35 NCGR() : data(nullptr) {}
39 if(this->data !=
nullptr) {
45 inline constexpr void ComputeDimensions(u32 &out_width, u32 &out_height) {
46 switch(this->char_data.map_type) {
47 case gfx::MappingType::Mode1D32K: {
49 out_height = this->char_data.data_size * ((this->char_data.pix_fmt == gfx::PixelFormat::Palette16) ? 2 : 1) / 32;
52 case gfx::MappingType::Mode1D64K: {
54 out_height = this->char_data.data_size * ((this->char_data.pix_fmt == gfx::PixelFormat::Palette16) ? 2 : 1) / 64;
57 case gfx::MappingType::Mode1D128K: {
59 out_height = this->char_data.data_size * ((this->char_data.pix_fmt == gfx::PixelFormat::Palette16) ? 2 : 1) / 128;
62 case gfx::MappingType::Mode1D256K: {
64 out_height = this->char_data.data_size * ((this->char_data.pix_fmt == gfx::PixelFormat::Palette16) ? 2 : 1) / 256;
68 out_width = this->char_data.tile_width * gfx::TileSize;
69 out_height = this->char_data.tile_height * gfx::TileSize;
75 Result ValidateImpl(
const std::string &path, std::shared_ptr<fs::FileHandle> file_handle,
const fs::FileCompression comp)
override;
76 Result ReadImpl(
const std::string &path, std::shared_ptr<fs::FileHandle> file_handle,
const fs::FileCompression comp)
override;
77 Result WriteImpl(
const std::string &path, std::shared_ptr<fs::FileHandle> file_handle,
const fs::FileCompression comp)
override;