diff options
-rw-r--r-- | inc/cub3d_structs.h | 4 | ||||
-rw-r--r-- | map/map_one.cub | 30 | ||||
-rw-r--r-- | src/ft_draw_verline.c | 4 | ||||
-rw-r--r-- | src/ft_init_winlx.c | 2 | ||||
-rw-r--r-- | src/ft_raycasting.c | 2 |
5 files changed, 21 insertions, 21 deletions
diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index 13225af..2f032e0 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -23,8 +23,8 @@ typedef struct s_win uint8_t inited; uint16_t x_max_size; uint16_t y_max_size; - uint16_t x_size; - uint16_t y_size; + uint32_t x_size; + uint32_t y_size; } t_win; typedef struct s_img diff --git a/map/map_one.cub b/map/map_one.cub index 74914d7..e4704c7 100644 --- a/map/map_one.cub +++ b/map/map_one.cub @@ -6,20 +6,20 @@ EA ./path_to_the_east_texture.xpm WE ./path_to_the_west_texture.xpm S ./path_to_the_sprite_texture.xpm -C 30,130,255 +C 50,100,200 F 150,150,124 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 2 0 0 0 0 0 1 0 0 0 1 -1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 -1 0 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 1 0 1 1 1 1 0 0 0 1 -1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 0 0 0 1 0 0 0 1 -1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 0 1 0 0 1 0 0 0 1 -1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 0 0 0 0 0 0 1 0 0 0 1 -1 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 1 0 N 0 1 -1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 1 0 1 1 1 1 0 0 0 1 -1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 0 0 0 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +11111111111111111 1 +1 00000000011000001 +1N0100000000000001 +101100000111000001 +111111111111111111 +100000000011000001 +111101111111110111 +111101111111110111 +11000 0001101010111 +100020000000000011 +100000000000000011 +1100000011010101 11 +111101111111010111 +111111111111111111 diff --git a/src/ft_draw_verline.c b/src/ft_draw_verline.c index d7ebe34..5c5ed29 100644 --- a/src/ft_draw_verline.c +++ b/src/ft_draw_verline.c @@ -15,7 +15,7 @@ static void ft_draw_floor(t_cub *cl, int32_t y, int32_t x) { - while (y < cl->wlist->y_size) + while ((uint32_t)y < cl->wlist->y_size) { *(int*)(cl->img.ptr + (x * 4 + (y * cl->img.sizeline))) = ft_rgb_to_hex(cl->f_rgb); @@ -47,7 +47,7 @@ int8_t y1 = 0; if (y2 < 0) y2 = 0; - if (y2 >= cl->wlist->y_size) + if ((uint32_t)y2 >= cl->wlist->y_size) y2 = cl->wlist->x_size - 1; if (y1 > y2) { diff --git a/src/ft_init_winlx.c b/src/ft_init_winlx.c index 1b60477..6657408 100644 --- a/src/ft_init_winlx.c +++ b/src/ft_init_winlx.c @@ -26,7 +26,7 @@ int clist->wlist->x_size, clist->wlist->y_size, "Cub3D"))) return (-1); clist->wlist->inited = 1; - ft_printf("Created window of size %dx%d\n", + ft_printf("Created window of size %ux%u\n", clist->wlist->x_size, clist->wlist->y_size); return (0); } diff --git a/src/ft_raycasting.c b/src/ft_raycasting.c index a4446b3..bf33374 100644 --- a/src/ft_raycasting.c +++ b/src/ft_raycasting.c @@ -55,7 +55,7 @@ void if (cl->rlist.wall_t < 0) cl->rlist.wall_t = 0; cl->rlist.wall_b = cl->rlist.line_h / 2 + wl->y_size / 2; - if (cl->rlist.wall_b >= wl->y_size) + if (cl->rlist.wall_b >= (float)wl->y_size) cl->rlist.wall_b = wl->y_size - 1; ft_draw_verline(cl, i, cl->rlist.wall_t - 1, cl->rlist.wall_b); i++; |