pokemon_animation_graphics: remove declarations from for loops

This commit is contained in:
yenatch 2017-05-28 23:52:23 -04:00
parent d9c329eb3c
commit c81a7aa162
1 changed files with 4 additions and 2 deletions

View File

@ -43,7 +43,8 @@ void transpose_tiles(uint8_t* tiles, int width, int size, int tile_size) {
} }
bool compare_tile(uint8_t *tile, uint8_t *other) { bool compare_tile(uint8_t *tile, uint8_t *other) {
for (int j = 0; j < 16; j++) { int j;
for (j = 0; j < 16; j++) {
if (tile[j] != other[j]) { if (tile[j] != other[j]) {
return false; return false;
} }
@ -58,7 +59,8 @@ int get_tile_index(uint8_t* tile, uint8_t* tiles, int num_tiles, int preferred_t
return preferred_tile_id; return preferred_tile_id;
} }
} }
for (int i = 0; i < num_tiles; i++) { int i;
for (i = 0; i < num_tiles; i++) {
uint8_t *other = &tiles[i * 16]; uint8_t *other = &tiles[i * 16];
if (compare_tile(tile, other)) { if (compare_tile(tile, other)) {
return i; return i;