diff options
author | red031000 <rubenru09@aol.com> | 2021-03-04 20:17:58 +0000 |
---|---|---|
committer | red031000 <rubenru09@aol.com> | 2021-03-04 20:17:58 +0000 |
commit | d290ce10aaa6c9a8d3ba5198ad786d43e0c9b1e5 (patch) | |
tree | 73322c66efb9c2a040ecbc9ce27c08316bd83a64 /tools/nitrogfx/json.c | |
parent | 450d5ac3f8c631e01d6a56f5507835cfd4272867 (diff) |
only perform modulo if the tile is not -1
Diffstat (limited to 'tools/nitrogfx/json.c')
-rw-r--r-- | tools/nitrogfx/json.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/nitrogfx/json.c b/tools/nitrogfx/json.c index 7907b515..53f83ceb 100644 --- a/tools/nitrogfx/json.c +++ b/tools/nitrogfx/json.c @@ -194,13 +194,13 @@ struct JsonToScreenOptions *ParseNSCRJson(char *path) cJSON_ArrayForEach(tile, data) { int tileInt = GetInt(tile) - 1; - if (tilesetSize != 0) - { - palette = tileInt / tilesetSize; - tileInt %= tilesetSize; - } if (tileInt != -1) { + if (tilesetSize != 0) + { + palette = tileInt / tilesetSize; + tileInt %= tilesetSize; + } bool vFlip = tileInt >> 30; bool hFlip = tileInt >> 31; tileInt |= vFlip << 11; |