Fixed til accesse variables types.

This commit is contained in:
Ulysse Cura 2026-09-02 18:35:06 +02:00
parent 6ce19277e5
commit 365df6a0c8
1 changed files with 7 additions and 7 deletions

View File

@ -401,7 +401,7 @@ int map_remove_entities(map_t *map)
}
static inline int draw_tile(uint32_t tile_x, uint32_t tile_y, uint16_t tile_id)
static inline int draw_tile(uint16_t tile_x, uint16_t tile_y, uint16_t tile_id)
{
if(!tile_id) return EXIT_SUCCESS;
@ -426,24 +426,24 @@ static inline int draw_tile(uint32_t tile_x, uint32_t tile_y, uint16_t tile_id)
int map_display_background(void)
{
uint32_t left_tile = 0;
uint16_t left_tile = 0;
if(game.camera.view_rect.x / TILE_SIZE > 0)
left_tile = game.camera.view_rect.x / TILE_SIZE;
uint32_t right_tile = game.map->width;
uint16_t right_tile = game.map->width;
if((game.camera.view_rect.x + game.camera.view_rect.w) / TILE_SIZE + 1 < game.map->width)
right_tile = (game.camera.view_rect.x + game.camera.view_rect.w) / TILE_SIZE + 1;
uint32_t top_tile = 0;
uint16_t top_tile = 0;
if(game.camera.view_rect.y / TILE_SIZE > 0)
top_tile = game.camera.view_rect.y / TILE_SIZE;
uint32_t bottom_tile = game.map->height;
uint16_t bottom_tile = game.map->height;
if((game.camera.view_rect.y + game.camera.view_rect.h) / TILE_SIZE + 1 < game.map->height)
bottom_tile = (game.camera.view_rect.y + game.camera.view_rect.h) / TILE_SIZE + 1;
for(uint32_t tile_y = top_tile; tile_y < bottom_tile; tile_y++)
for(uint32_t tile_x = left_tile; tile_x < right_tile; tile_x++)
for(uint16_t tile_y = top_tile; tile_y < bottom_tile; tile_y++)
for(uint16_t tile_x = left_tile; tile_x < right_tile; tile_x++)
{
elem_t *backgroundlayer_elem = game.map->backgroundlayers.first;