diff options
-rw-r--r-- | src/tileset.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/tileset.c b/src/tileset.c index c41f4ff..cb21f7a 100644 --- a/src/tileset.c +++ b/src/tileset.c @@ -468,10 +468,8 @@ int db_tile_render(struct db_tileset *tileset, SDL_Renderer *renderer, int gid, SDL_Rect *dstrect) { - SDL_bool tile_found; SDL_Rect srcrect; - tile_found = SDL_FALSE; for (; tileset != NULL; tileset = tileset->next) { if (gid >= tileset->firstgid && gid < tileset->firstgid + tileset->tc) { @@ -494,13 +492,9 @@ db_tile_render(struct db_tileset *tileset, SDL_Renderer *renderer, int gid, SDL_GetError()); return -1; } - tile_found = SDL_TRUE; - break; + return 1; } } - if (!tile_found) { - db_warn("Tile with gid 0x%8.8x not found", (unsigned int) gid); - return 0; - } - return 1; + db_warn("Tile with gid 0x%8.8x not found", (unsigned int) gid); + return 0; } |