diff options
author | YamaArashi <shadow962@live.com> | 2015-11-24 01:41:14 -0800 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2015-11-24 01:41:14 -0800 |
commit | 69d1b312f654abd550d350b5b1db29a5f6aba348 (patch) | |
tree | c339a3c1cb4a91e20f8a6abd1f5d9321d55312cf /tools/gbagfx/gfx.c | |
parent | 066d199fe32040a0110746dba145ece66bd50c20 (diff) |
title screen background tiles and palettes
Diffstat (limited to 'tools/gbagfx/gfx.c')
-rw-r--r-- | tools/gbagfx/gfx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/gbagfx/gfx.c b/tools/gbagfx/gfx.c index c09c4238e..c0f7f492c 100644 --- a/tools/gbagfx/gfx.c +++ b/tools/gbagfx/gfx.c @@ -292,10 +292,10 @@ void ReadGbaPalette(char *path, struct Palette *palette) int fileSize; unsigned char *data = ReadWholeFile(path, &fileSize); - palette->numColors = fileSize / 2; + if (fileSize % 2 != 0) + FATAL_ERROR("The file size (%d) is not a multiple of 2.\n", fileSize); - if (palette->numColors != 16 && palette->numColors != 256) - FATAL_ERROR("\"%s\" contains %d colors, but the number of colors must be 16 or 256.\n", path, palette->numColors); + palette->numColors = fileSize / 2; for (int i = 0; i < palette->numColors; i++) { uint16_t paletteEntry = (data[i * 2 + 1] << 8) | data[i * 2]; |