Browse Source

cleaner exit and forgiden bzero changed

master
nicolas-arnaud 2 years ago
parent
commit
f5b3242033
  1. 6
      maps/tester.cub
  2. 1
      src/main.c
  3. 7
      src/mlx/mlx_2.c
  4. 2
      src/render/render.c

6
maps/tester.cub

@ -12,14 +12,14 @@ C 27, 210,200
111111111111111111111111111111111111111111111111
100000000000000000010000000000000000000000000001
101000001000010000101000010000100000000000000001
101100000100001000010000100001110000000000000001
101100C00100001000010000100001110000000000000001
101110000010000100000001000010101000000000000001
101011000001000010000010000100100100000000000001
101001100000100001000100001000100010000000000001
101000110000010000101000010000100101000000000001
1010001100J0010000101000010000100101000000000001
101000011000001000010000100000101000100000000001
101000001100000100000001000000110000010000000001
101000000110000010000010000000100000001000000001
101040000110000010000010000000100000001000000001
101000000011000001000100000001010000000100000001
1010000000011000001N1000000010001000000010000001
101111111111110000010000000100100100000001000001

1
src/main.c

@ -29,6 +29,5 @@ int main(int argc, char **argv)
render(env);
mlx_loop_hook(env->mlx, update_hook, env);
mlx_loop(env->mlx);
mlx_destroy_image(env->mlx, env->img);
return (EXIT_SUCCESS);
}

7
src/mlx/mlx_2.c

@ -14,7 +14,12 @@
int exit_game(t_env *env)
{
(void)env;
int i;
i = 0;
while (i < 5)
mlx_destroy_image(env->mlx, env->tex[i++].img);
mlx_destroy_image(env->mlx, env->img);
exit(EXIT_SUCCESS);
}

2
src/render/render.c

@ -88,7 +88,7 @@ void render_view(t_env *env)
void render(t_env *env)
{
bzero(env->buffer, WIN_Y_SZ * WIN_X_SZ * sizeof(int));
ft_bzero(env->buffer, WIN_Y_SZ * WIN_X_SZ * sizeof(int));
render_view(env);
if (env->minimap)
render_minimap(env, (t_vec){WIN_X_SZ / 3, WIN_Y_SZ / 3});

Loading…
Cancel
Save