summaryrefslogtreecommitdiff
path: root/src/init.c
diff options
context:
space:
mode:
authorDominik Kaiser2024-05-10 12:17:52 +0200
committerDominik Kaiser2024-05-10 12:17:52 +0200
commit7e992a69a2031f630f1e30b0d864c0e4e7d32067 (patch)
treec3b0ec31cb6c4cb104579c801bbef0678ab99304 /src/init.c
parentb114117e5f62761dfecd618432a44e75263a929c (diff)
downloadso_long-7e992a69a2031f630f1e30b0d864c0e4e7d32067.tar.gz
so_long-7e992a69a2031f630f1e30b0d864c0e4e7d32067.zip
Make norminette happy
Diffstat (limited to 'src/init.c')
-rw-r--r--src/init.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/init.c b/src/init.c
index d72f486..bd6b48f 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/10 12:11:01 by dkaiser ### ########.fr */
+/* Updated: 2024/05/10 12:13:33 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -17,15 +17,18 @@ static void init_player(t_player *player, int x, int y);
int init(t_game *game)
{
+ mlx_texture_t *texture;
+
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->player, 960, 540);
// TODO: make player spawn point dynamic
- mlx_texture_t *texture = mlx_load_png("textures/player.png");
+ texture = mlx_load_png("textures/player.png");
game->player.img = mlx_texture_to_image(game->mlx, texture);
- mlx_image_to_window(game->mlx, game->player.img, game->player.position.x, game->player.position.y);
+ mlx_image_to_window(game->mlx, game->player.img, game->player.position.x,
+ game->player.position.y);
return (0);
}