summaryrefslogtreecommitdiff
path: root/tools/gbagfx/gfx.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gbagfx/gfx.c')
-rw-r--r--tools/gbagfx/gfx.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/gbagfx/gfx.c b/tools/gbagfx/gfx.c
index 71459c607..c09c4238e 100644
--- a/tools/gbagfx/gfx.c
+++ b/tools/gbagfx/gfx.c
@@ -253,13 +253,10 @@ void WriteImage(char *path, int numTiles, int bitDepth, struct Image *image, boo
int maxNumTiles = tilesWidth * tilesHeight;
- if (numTiles == 0) {
+ if (numTiles == 0)
numTiles = maxNumTiles;
- } else {
- if (numTiles > maxNumTiles) {
- FATAL_ERROR("The specified number of tiles (%d) is greater than the maximum possible value (%d).\n", numTiles, maxNumTiles);
- }
- }
+ else if (numTiles > maxNumTiles)
+ FATAL_ERROR("The specified number of tiles (%d) is greater than the maximum possible value (%d).\n", numTiles, maxNumTiles);
int bufferSize = numTiles * tileSize;
unsigned char *buffer = malloc(bufferSize);