mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
A few miscellaneous edits
This commit is contained in:
@@ -11,5 +11,5 @@ if ! git diff-index --quiet HEAD --; then
|
|||||||
git diff-index --name-only HEAD --
|
git diff-index --name-only HEAD --
|
||||||
echo
|
echo
|
||||||
git diff HEAD --
|
git diff HEAD --
|
||||||
return 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -67,14 +67,13 @@ static option const longopts[] = {
|
|||||||
{"define", required_argument, nullptr, 'D'},
|
{"define", required_argument, nullptr, 'D'},
|
||||||
{"export-all", no_argument, nullptr, 'E'},
|
{"export-all", no_argument, nullptr, 'E'},
|
||||||
{"gfx-chars", required_argument, nullptr, 'g'},
|
{"gfx-chars", required_argument, nullptr, 'g'},
|
||||||
|
{"help", no_argument, nullptr, 'h'},
|
||||||
{"include", required_argument, nullptr, 'I'},
|
{"include", required_argument, nullptr, 'I'},
|
||||||
{"dependfile", required_argument, nullptr, 'M'},
|
{"dependfile", required_argument, nullptr, 'M'},
|
||||||
{"MG", no_argument, &depType, 'G'},
|
{"MG", no_argument, &depType, 'G'},
|
||||||
{"help", no_argument, nullptr, 'h'},
|
|
||||||
{"MP", no_argument, &depType, 'P'},
|
{"MP", no_argument, &depType, 'P'},
|
||||||
{"MT", required_argument, &depType, 'T'},
|
|
||||||
{"warning", required_argument, nullptr, 'W'},
|
|
||||||
{"MQ", required_argument, &depType, 'Q'},
|
{"MQ", required_argument, &depType, 'Q'},
|
||||||
|
{"MT", required_argument, &depType, 'T'},
|
||||||
{"output", required_argument, nullptr, 'o'},
|
{"output", required_argument, nullptr, 'o'},
|
||||||
{"preinclude", required_argument, nullptr, 'P'},
|
{"preinclude", required_argument, nullptr, 'P'},
|
||||||
{"pad-value", required_argument, nullptr, 'p'},
|
{"pad-value", required_argument, nullptr, 'p'},
|
||||||
|
|||||||
@@ -1296,10 +1296,11 @@ continue_visiting_tiles:;
|
|||||||
uint32_t const nbTilesH = png.getHeight() / 8, nbTilesW = png.getWidth() / 8;
|
uint32_t const nbTilesH = png.getHeight() / 8, nbTilesW = png.getWidth() / 8;
|
||||||
|
|
||||||
// Check the tile count
|
// Check the tile count
|
||||||
if (nbTilesW * nbTilesH > options.maxNbTiles[0] + options.maxNbTiles[1]) {
|
if (uint32_t nbTiles = nbTilesW * nbTilesH;
|
||||||
|
nbTiles > options.maxNbTiles[0] + options.maxNbTiles[1]) {
|
||||||
fatal(
|
fatal(
|
||||||
"Image contains %" PRIu32 " tiles, exceeding the limit of %" PRIu16 " + %" PRIu16,
|
"Image contains %" PRIu32 " tiles, exceeding the limit of %" PRIu16 " + %" PRIu16,
|
||||||
nbTilesW * nbTilesH,
|
nbTiles,
|
||||||
options.maxNbTiles[0],
|
options.maxNbTiles[0],
|
||||||
options.maxNbTiles[1]
|
options.maxNbTiles[1]
|
||||||
);
|
);
|
||||||
@@ -1328,10 +1329,11 @@ continue_visiting_tiles:;
|
|||||||
options.verbosePrint(Options::VERB_LOG_ACT, "Deduplicating tiles...\n");
|
options.verbosePrint(Options::VERB_LOG_ACT, "Deduplicating tiles...\n");
|
||||||
UniqueTiles tiles = dedupTiles(png, attrmap, palettes, mappings);
|
UniqueTiles tiles = dedupTiles(png, attrmap, palettes, mappings);
|
||||||
|
|
||||||
if (tiles.size() > options.maxNbTiles[0] + options.maxNbTiles[1]) {
|
if (size_t nbTiles = tiles.size();
|
||||||
|
nbTiles > options.maxNbTiles[0] + options.maxNbTiles[1]) {
|
||||||
fatal(
|
fatal(
|
||||||
"Image contains %zu tiles, exceeding the limit of %" PRIu16 " + %" PRIu16,
|
"Image contains %zu tiles, exceeding the limit of %" PRIu16 " + %" PRIu16,
|
||||||
tiles.size(),
|
nbTiles,
|
||||||
options.maxNbTiles[0],
|
options.maxNbTiles[0],
|
||||||
options.maxNbTiles[1]
|
options.maxNbTiles[1]
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user