summaryrefslogtreecommitdiff
path: root/src/init.c
diff options
context:
space:
mode:
authorDominik Kaiser2024-05-15 17:02:29 +0200
committerGitHub2024-05-15 17:02:29 +0200
commitcb6f98a5fa7bb2ed361abe68b3000f2e3f578ea7 (patch)
tree150075893065fd1e41c8b3a8272e0faee421848e /src/init.c
parente6edad24c9fa56538d66067dcff6bde39f746239 (diff)
parent33a54536567a8b93cd0320814eba4ff515d5277b (diff)
downloadso_long-cb6f98a5fa7bb2ed361abe68b3000f2e3f578ea7.tar.gz
so_long-cb6f98a5fa7bb2ed361abe68b3000f2e3f578ea7.zip
Merge refactoring into master
Refactoring
Diffstat (limited to 'src/init.c')
-rw-r--r--src/init.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/init.c b/src/init.c
index 9959da6..e7fedf2 100644
--- a/src/init.c
+++ b/src/init.c
@@ -6,7 +6,7 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/09 14:50:09 by dkaiser #+# #+# */
-/* Updated: 2024/05/15 12:13:03 by dkaiser ### ########.fr */
+/* Updated: 2024/05/15 15:09:44 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,16 +14,15 @@
#include "so_long.h"
static void init_hooks(t_game *game);
-static void init_player(t_game *game);
+static void init_actor(t_game *game);
int init(t_game *game)
{
-
game->mlx = mlx_init(1920, 1080, "so_long", false);
// TODO: make size and title dynamic
game->input_direction = ZERO;
init_hooks(game);
- init_player(game);
+ init_actor(game);
return (0);
}
@@ -33,10 +32,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");
@@ -49,5 +48,5 @@ static void init_player(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);
}