From 356ccc1b6b834d502d203036feac4800b0ed3361 Mon Sep 17 00:00:00 2001 From: Dominik Kaiser Date: Wed, 15 May 2024 14:49:40 +0200 Subject: Rename t_player to t_actor --- src/init.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/init.c') diff --git a/src/init.c b/src/init.c index 9959da6..9926826 100644 --- a/src/init.c +++ b/src/init.c @@ -6,7 +6,7 @@ /* By: dkaiser input_direction = ZERO; init_hooks(game); - init_player(game); + init_actor(game); return (0); } @@ -33,10 +33,10 @@ static void init_hooks(t_game *game) mlx_key_hook(game->mlx, on_key_input, game); } -static void init_player(t_game *game) +static void init_actor(t_game *game) { mlx_texture_t *texture; - t_player *player; + t_actor *player; player = &game->player; texture = mlx_load_png("textures/player.png"); -- cgit v1.2.3 From 98eb4ded98daf048a97c59b9bd23b0068bd4ba32 Mon Sep 17 00:00:00 2001 From: Dominik Kaiser Date: Wed, 15 May 2024 15:10:55 +0200 Subject: Resolve some norme errors --- include/so_long.h | 13 ++++++------- src/draw.c | 15 ++++++++------- src/init.c | 7 +++---- src/map_utils.c | 16 ++++++++-------- 4 files changed, 25 insertions(+), 26 deletions(-) (limited to 'src/init.c') diff --git a/include/so_long.h b/include/so_long.h index 585527e..4a3c924 100644 --- a/include/so_long.h +++ b/include/so_long.h @@ -6,7 +6,7 @@ /* By: dkaiser mlx, wall_texture); @@ -33,7 +33,8 @@ int draw_map(t_game *game) while (y < game->map.grid_size.y) { if (game->map.tiles[y * game->map.grid_size.x + x] == WALL) - mlx_image_to_window(game->mlx, wall_image, x * game->map.tile_size.x, y * game->map.tile_size.y); + mlx_image_to_window(game->mlx, wall_image, x + * game->map.tile_size.x, y * game->map.tile_size.y); y++; } x++; diff --git a/src/init.c b/src/init.c index 9926826..e7fedf2 100644 --- a/src/init.c +++ b/src/init.c @@ -6,7 +6,7 @@ /* By: dkaiser mlx = mlx_init(1920, 1080, "so_long", false); // TODO: make size and title dynamic game->input_direction = ZERO; @@ -36,7 +35,7 @@ static void init_hooks(t_game *game) static void init_actor(t_game *game) { mlx_texture_t *texture; - t_actor *player; + t_actor *player; player = &game->player; texture = mlx_load_png("textures/player.png"); @@ -49,5 +48,5 @@ static void init_actor(t_game *game) player->img = mlx_texture_to_image(game->mlx, texture); mlx_resize_image(player->img, player->size.x, player->size.y); mlx_image_to_window(game->mlx, player->img, player->position.x, - player->position.y); + player->position.y); } diff --git a/src/map_utils.c b/src/map_utils.c index 82acaa9..6d8fbd9 100644 --- a/src/map_utils.c +++ b/src/map_utils.c @@ -6,7 +6,7 @@ /* By: dkaiser tiles[y * map->grid_size.x + x]; + return (map->tiles[y * map->grid_size.x + x]); } -- cgit v1.2.3