mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user