Raise the effective limit of rgbgfx --nb-tiles (#2235)

This commit is contained in:
Rangi authored and GitHub committed 2026-10-30 23:42:00 +01:00
1 parent 27a0a6bc2a
commit 6054102f9e
4 files changed
+8 -8

No files matched your search

+1 -1
View File
@@ -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<uint16_t, 2> maxNbTiles{UINT16_MAX, 0}; // -N
std::array<uint32_t, 2> maxNbTiles{UINT32_MAX, 0}; // -N
uint16_t nbPalettes = 8; // -n
std::string output{}; // -o
std::string palettes{}; // -p, -P
+1 -1
View File
@@ -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]
);
+1 -1
View File
@@ -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]
+5 -5
View File
@@ -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<uint16_t>(
? std::max<uint32_t>(
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,