Update SnesTo8bppSheet args and impl

This commit is contained in:
scawful
2024-04-13 13:18:00 -04:00
parent 1e58c81bdf
commit 1dcca478cd
2 changed files with 7 additions and 2 deletions

View File

@@ -135,7 +135,7 @@ std::vector<uint8_t> Convert4bppTo3bpp(const std::vector<uint8_t>& tiles) {
return ConvertBpp(tiles, 4, 3); return ConvertBpp(tiles, 4, 3);
} }
Bytes SnesTo8bppSheet(Bytes sheet, int bpp) { Bytes SnesTo8bppSheet(const Bytes& sheet, int bpp) {
int xx = 0; // positions where we are at on the sheet int xx = 0; // positions where we are at on the sheet
int yy = 0; int yy = 0;
int pos = 0; int pos = 0;
@@ -148,6 +148,11 @@ Bytes SnesTo8bppSheet(Bytes sheet, int bpp) {
buffer_size = 0x2000; buffer_size = 0x2000;
} else if (bpp == 3) { } else if (bpp == 3) {
bpp = 24; bpp = 24;
} else if (bpp == 4) {
bpp = 32;
buffer_size = 0x4000;
} else if (bpp == 8) {
bpp = 64;
} }
Bytes sheet_buffer_out(buffer_size); Bytes sheet_buffer_out(buffer_size);

View File

@@ -14,7 +14,7 @@ namespace gfx {
constexpr uint8_t kGraphicsBitmap[8] = {0x80, 0x40, 0x20, 0x10, constexpr uint8_t kGraphicsBitmap[8] = {0x80, 0x40, 0x20, 0x10,
0x08, 0x04, 0x02, 0x01}; 0x08, 0x04, 0x02, 0x01};
Bytes SnesTo8bppSheet(Bytes sheet, int bpp); Bytes SnesTo8bppSheet(const Bytes& sheet, int bpp);
Bytes Bpp8SnesToIndexed(Bytes data, uint64_t bpp = 0); Bytes Bpp8SnesToIndexed(Bytes data, uint64_t bpp = 0);
struct tile8 { struct tile8 {