diff --git a/include/gfx/main.hpp b/include/gfx/main.hpp index f7e4955d..ce589832 100644 --- a/include/gfx/main.hpp +++ b/include/gfx/main.hpp @@ -54,7 +54,7 @@ struct Options { uint32_t bottom() const { return top + height * TILE_HEIGHT; } } inputSlice{0, 0, 0, 0}; // -L (margins in clockwise order, like CSS) uint8_t basePalID = 0; // -l - std::array maxNbTiles{UINT16_MAX, 0}; // -N + std::array maxNbTiles{UINT32_MAX, 0}; // -N uint16_t nbPalettes = 8; // -n std::string output{}; // -o std::string palettes{}; // -p, -P diff --git a/src/gfx/main.cpp b/src/gfx/main.cpp index 580c4f1a..4f5570ce 100644 --- a/src/gfx/main.cpp +++ b/src/gfx/main.cpp @@ -578,7 +578,7 @@ static void verboseOutputConfig() { // -N/--nb-tiles fprintf( stderr, - "\tMaximum %" PRIu16 " tiles in bank 0, and %" PRIu16 " in bank 1\n", + "\tMaximum %" PRIu32 " tiles in bank 0, and %" PRIu32 " in bank 1\n", options.maxNbTiles[0], options.maxNbTiles[1] ); diff --git a/src/gfx/process.cpp b/src/gfx/process.cpp index e7049b59..bda7de85 100644 --- a/src/gfx/process.cpp +++ b/src/gfx/process.cpp @@ -1168,7 +1168,7 @@ continue_visiting_tiles:; auto checkTileCountLimit = [](size_t nbTiles) { if (nbTiles > options.maxNbTiles[0] + options.maxNbTiles[1]) { fatal( - "Image contains %zu tiles, exceeding the limit of %" PRIu16 " + %" PRIu16, + "Image contains %zu tiles, exceeding the limit of %" PRIu32 " + %" PRIu32, nbTiles, options.maxNbTiles[0], options.maxNbTiles[1] diff --git a/src/gfx/reverse.cpp b/src/gfx/reverse.cpp index 77f24cb8..f89c753c 100644 --- a/src/gfx/reverse.cpp +++ b/src/gfx/reverse.cpp @@ -157,7 +157,7 @@ void reverse() { } if (mapSize > options.maxNbTiles[0] + options.maxNbTiles[1]) { warnx( - "Total number of tiles (%zu) is more than the limit of %" PRIu16 " + %" PRIu16, + "Total number of tiles (%zu) is more than the limit of %" PRIu32 " + %" PRIu32, mapSize, options.maxNbTiles[0], options.maxNbTiles[1] @@ -373,7 +373,7 @@ void reverse() { for (size_t bank = 0; bank < NB_BANKS; ++bank) { if (nbTilesMappedInBank[bank] > options.maxNbTiles[bank]) { error( - "Bank %zu contains %" PRIu16 " tiles, but the specified limit is %" PRIu16, + "Bank %zu contains %" PRIu16 " tiles, but the specified limit is %" PRIu32, bank, nbTilesMappedInBank[bank], options.maxNbTiles[bank] @@ -381,9 +381,9 @@ void reverse() { } } - if (uint16_t const maxTotalNbTiles = + if (uint32_t const maxTotalNbTiles = nbTilesMappedInBank[1] > 0 - ? std::max( + ? std::max( nbTilesMappedInBank[0], options.maxNbTiles[0] + nbTilesMappedInBank[1] ) : nbTilesMappedInBank[0]; @@ -422,7 +422,7 @@ void reverse() { tileOfs >= options.maxNbTiles[bank]) { error( "Tilemap references tile #%" PRIu8 - " at (%zu, %zu), but the limit for bank %u is %" PRIu16, + " at (%zu, %zu), but the limit for bank %u is %" PRIu32, tileID, tx, ty,