From 9fc15af52360f55906ca578b5a144b4d70ea75a3 Mon Sep 17 00:00:00 2001 From: attilavs2 Date: Thu, 1 Aug 2024 15:21:54 +0200 Subject: [PATCH] Fix merge issues --- assets/interior1_0.tmx | 2 +- assets/level0.tmx | 2 +- src/game.h | 2 +- src/map.c | 5 ++--- src/player.c | 13 +++++++------ 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/assets/interior1_0.tmx b/assets/interior1_0.tmx index ddb8fc0..a71b471 100644 --- a/assets/interior1_0.tmx +++ b/assets/interior1_0.tmx @@ -70,7 +70,7 @@ - + diff --git a/assets/level0.tmx b/assets/level0.tmx index 6bc62a8..acca1ae 100644 --- a/assets/level0.tmx +++ b/assets/level0.tmx @@ -176,7 +176,7 @@ - + diff --git a/src/game.h b/src/game.h index 6179735..7a20c1c 100644 --- a/src/game.h +++ b/src/game.h @@ -143,7 +143,7 @@ typedef struct { /* structure that contains all the dialogs for that part of the map */ uint32_t nbdialogsdata; Dialog *dialogs; - + uint32_t indoor; /* list of all the tiles to draw the background and the foreground layers */ diff --git a/src/map.c b/src/map.c index c4279e1..3734d8f 100644 --- a/src/map.c +++ b/src/map.c @@ -132,10 +132,9 @@ void map_render_by_layer(Game *game, int layer) { * y. */ int dw = DWIDTH / T_WIDTH + 2, dh = DHEIGHT / T_HEIGHT + 1; /* mw and mh will contain the height and the width of the map. */ - int mw = map_level->w * T_WIDTH, - mh = map_level->h * T_HEIGHT; + int mw = map_level->w * T_WIDTH, mh = map_level->h * T_HEIGHT; /* tile contains the tile to draw. */ - unsigned short int tile; + short int tile; /* The position where I start drawing */ int sx, sy; /* The position of the tile in the tileset. */ diff --git a/src/player.c b/src/player.c index e1a2a28..dd0f843 100644 --- a/src/player.c +++ b/src/player.c @@ -89,12 +89,13 @@ void player_move(Game *game, Direction direction) { /* Check if we should change map */ /* Disable map change for indoor maps */ - if(!game->map_level->indoor){ - Map *target = map_get_for_tile(game, - game->map_level->x + player->x / T_WIDTH + - one_px_mov[direction * 2], - game->map_level->y + player->y / T_HEIGHT + - one_px_mov[direction * 2 + 1]); + if(!game->map_level->indoor) { + Map *target = + map_get_for_tile(game, + game->map_level->x + player->x / T_WIDTH + + one_px_mov[direction * 2], + game->map_level->y + player->y / T_HEIGHT + + one_px_mov[direction * 2 + 1]); if(target != game->map_level) { if(target->x > game->map_level->x) { player->x = 0;