mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Check before attempting to generate empty image
This causes a libpng warning then error, but print a better error message Fixes #1016
This commit is contained in:
@@ -122,6 +122,9 @@ void reverse() {
|
||||
options.verbosePrint(Options::VERB_INTERM, "Read %zu tilemap entries.\n", nbTileInstances);
|
||||
}
|
||||
|
||||
if (nbTileInstances == 0) {
|
||||
fatal("Cannot generate empty image");
|
||||
}
|
||||
if (nbTileInstances > options.maxNbTiles[0] + options.maxNbTiles[1]) {
|
||||
warning("Read %zu tiles, more than the limit of %zu + %zu", nbTileInstances,
|
||||
options.maxNbTiles[0], options.maxNbTiles[1]);
|
||||
|
||||
Reference in New Issue
Block a user