diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_draw_scene.c | 6 | ||||
-rw-r--r-- | src/ft_draw_verline.c | 10 | ||||
-rw-r--r-- | src/ft_hooks_and_loops.c | 2 | ||||
-rw-r--r-- | src/ft_key_events.c | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/ft_draw_scene.c b/src/ft_draw_scene.c index 4a5b56e..6043a55 100644 --- a/src/ft_draw_scene.c +++ b/src/ft_draw_scene.c @@ -21,13 +21,13 @@ void { mlx_clear_window(clist->wlist->wlx, clist->wlist->winptr); clist->img.img = mlx_new_image(clist->wlist->wlx, - clist->wlist->x_size, clist->wlist->y_size); + clist->wlist->x_size, clist->wlist->y_size); clist->img.ptr = mlx_get_data_addr(clist->img.img, &clist->img.bpp, - &clist->img.sizeline, &clist->img.endian); + &clist->img.sizeline, &clist->img.endian); ft_castray(clist); if (clist->minimap) ft_draw_map(clist->mlist->map, clist); mlx_put_image_to_window(clist->wlist->wlx, - clist->wlist->winptr, clist->img.img, 0, 0); + clist->wlist->winptr, clist->img.img, 0, 0); mlx_destroy_image(clist->wlist->wlx, clist->img.img); } diff --git a/src/ft_draw_verline.c b/src/ft_draw_verline.c index 17d754a..f7e5a1c 100644 --- a/src/ft_draw_verline.c +++ b/src/ft_draw_verline.c @@ -1,13 +1,13 @@ #include <cub3d.h> static void -ft_draw_floor(t_cub *cl, int32_t y, int32_t x, int16_t i) +ft_draw_floor(t_cub *cl, int32_t y, int32_t x) { - while (i <= y) + while (y <= cl->wlist->y_size) { *(int*)(cl->img.ptr + - (x * 4 + (i * cl->img.sizeline))) = ft_rgb_to_hex(cl->f_rgb); - i++; + (x * 4 + (y * cl->img.sizeline))) = ft_rgb_to_hex(cl->f_rgb); + y++; } } @@ -50,6 +50,6 @@ ft_draw_verline(t_cub *cl, int32_t x, int32_t y1, int32_t y2, int32_t color) *(int*)(cl->img.ptr + (x * 4 + (y * cl->img.sizeline))) = color; y++; } - ft_draw_floor(cl, x, cl->wlist->y_size, y); + ft_draw_floor(cl, y, x); return (0); } diff --git a/src/ft_hooks_and_loops.c b/src/ft_hooks_and_loops.c index 068b3a7..fdddc10 100644 --- a/src/ft_hooks_and_loops.c +++ b/src/ft_hooks_and_loops.c @@ -18,7 +18,7 @@ void ft_hooks_and_loops(t_win *wl, t_cub *cl) { - mlx_hook(wl->winptr, 2, 1L << 1, ft_key_event, cl); + mlx_hook(wl->winptr, 2, 1L << 0, ft_key_event, cl); mlx_hook(wl->winptr, 17, 0L, ft_click_close, cl); mlx_loop(wl->wlx); } diff --git a/src/ft_key_events.c b/src/ft_key_events.c index a08a534..07c192b 100644 --- a/src/ft_key_events.c +++ b/src/ft_key_events.c @@ -62,7 +62,7 @@ int t_player *pl; t_map *ml; int8_t (*fun_ptr[4])(t_cub*); - const int16_t tmp_code = keycode; + const uint16_t tmp_code = keycode; fun_ptr[0] = ft_w_key; fun_ptr[1] = ft_a_key; |