Skip to content

Commit

Permalink
Fix rectangular rgbgfx --reverse --columns (#1392)
Browse files Browse the repository at this point in the history
When width != height, the math was off, causing some tiles to be
repeated or skipped.
  • Loading branch information
sfiera authored Apr 20, 2024
1 parent b838742 commit 7aecc00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gfx/reverse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7aecc00

Please sign in to comment.