Fix rectangular rgbgfx --reverse --columns (#1392)

When width != height, the math was off, causing some tiles to be
repeated or skipped.
This commit is contained in:
Chris Pickel
2024-04-21 01:20:16 +09:00
committed by GitHub
parent b8387427a6
commit 7aecc00919

View File

@@ -333,7 +333,7 @@ void reverse() {
for (size_t ty = 0; ty < height; ++ty) {
for (size_t tx = 0; tx < width; ++tx) {
size_t index = options.columnMajor ? ty + tx * width : ty * width + tx;
size_t index = options.columnMajor ? ty + tx * height : ty * width + tx;
// By default, a tile is unflipped, in bank 0, and uses palette #0
uint8_t attribute = attrmap.has_value() ? (*attrmap)[index] : 0x00;
bool bank = attribute & 0x08;