shithub: rgbds

Download patch

ref: 87092208bc364cde15391a73df614e5889f8e63c
parent: 0d32775a1f13bc446d910c0ab9e41005f54d5122
author: ISSOtm <eldredhabert0@gmail.com>
date: Sat Jul 2 06:53:16 EDT 2022

Stop passing `options.columnMajor` explicitly everywhere

--- a/src/gfx/process.cpp
+++ b/src/gfx/process.cpp
@@ -458,8 +458,9 @@
 		}
 	};
 public:
-	TilesVisitor visitAsTiles(bool columnMajor) const {
-		return {*this, columnMajor, options.inputSlice.width ? options.inputSlice.width * 8 : width,
+	TilesVisitor visitAsTiles() const {
+		return {*this, options.columnMajor,
+		        options.inputSlice.width ? options.inputSlice.width * 8 : width,
 		        options.inputSlice.height ? options.inputSlice.height * 8 : height};
 	}
 };
@@ -758,7 +759,7 @@
 	}
 	remainingTiles -= options.trim;
 
-	for (auto [tile, attr] : zip(png.visitAsTiles(options.columnMajor), attrmap)) {
+	for (auto [tile, attr] : zip(png.visitAsTiles(), attrmap)) {
 		// If the tile is fully transparent, default to palette 0
 		Palette const &palette = palettes[attr.getPalID(mappings)];
 		for (uint32_t y = 0; y < 8; ++y) {
@@ -870,7 +871,7 @@
 	// by caching the full tile data anyway, so we might as well.)
 	UniqueTiles tiles;
 
-	for (auto [tile, attr] : zip(png.visitAsTiles(options.columnMajor), attrmap)) {
+	for (auto [tile, attr] : zip(png.visitAsTiles(), attrmap)) {
 		auto [tileID, matchType] = tiles.addTile(tile, palettes[mappings[attr.protoPaletteID]]);
 
 		attr.xFlip = matchType == TileData::HFLIP || matchType == TileData::VHFLIP;
@@ -959,7 +960,7 @@
 	std::vector<ProtoPalette> protoPalettes;
 	DefaultInitVec<AttrmapEntry> attrmap{};
 
-	for (auto tile : png.visitAsTiles(options.columnMajor)) {
+	for (auto tile : png.visitAsTiles()) {
 		ProtoPalette tileColors;
 		AttrmapEntry &attrs = attrmap.emplace_back();