diff options
author | Rudy Bousset <rbousset@z2r5p6.le-101.fr> | 2020-03-08 15:28:26 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r5p6.le-101.fr> | 2020-03-08 15:28:26 +0100 |
commit | 3205176d60f52ce487c3e3c5efaa89e15b9dd5ca (patch) | |
tree | 4a41010a24a01be60eb11a77e3556d7643b67769 | |
parent | Norme iksde (diff) | |
download | 42-cub3d-3205176d60f52ce487c3e3c5efaa89e15b9dd5ca.tar.gz 42-cub3d-3205176d60f52ce487c3e3c5efaa89e15b9dd5ca.tar.bz2 42-cub3d-3205176d60f52ce487c3e3c5efaa89e15b9dd5ca.tar.xz 42-cub3d-3205176d60f52ce487c3e3c5efaa89e15b9dd5ca.tar.zst 42-cub3d-3205176d60f52ce487c3e3c5efaa89e15b9dd5ca.zip |
Normed
Diffstat (limited to '')
-rw-r--r-- | src/ft_darken_rgb.c | 2 | ||||
-rw-r--r-- | src/ft_draw_scene.c | 19 | ||||
-rw-r--r-- | src/ft_draw_textures.c | 3 | ||||
-rw-r--r-- | src/ft_draw_verline.c | 7 | ||||
-rw-r--r-- | src/ft_floor_cast.c | 2 |
5 files changed, 15 insertions, 18 deletions
diff --git a/src/ft_darken_rgb.c b/src/ft_darken_rgb.c index 90188b4..434fcf8 100644 --- a/src/ft_darken_rgb.c +++ b/src/ft_darken_rgb.c @@ -13,7 +13,6 @@ #include <cub3d.h> #include <stdint.h> -#include <stdio.h> uint32_t ft_darken_ceil(t_rgb rgb, int32_t y, t_cub *cl) { @@ -39,7 +38,6 @@ uint32_t /* calc = ((float)(y + (75000.0 / cl->wlist.y_size)) */ /* / (cl->wlist.y_size / 2)) - 1.0; */ /* calc = (calc < 0) ? (0) : (calc); */ - printf("%f\n", dist); (void)cl; calc = (dist * 0.4); calc = (calc >= 255) ? (255) : (calc); diff --git a/src/ft_draw_scene.c b/src/ft_draw_scene.c index e7895f5..bcbf8a3 100644 --- a/src/ft_draw_scene.c +++ b/src/ft_draw_scene.c @@ -18,21 +18,22 @@ static int8_t ft_put_stage(t_cub *clist) { - const uint32_t x = 15; - const uint32_t y = clist->wlist.y_size - - (clist->mlist.map_h * clist->mlist.scale) - 20; - uint8_t len; - char *str; + uint8_t len; + char *str; + uint32_t x; + uint32_t y; + x = 15; + y = clist->wlist.y_size - (clist->mlist.map_h * clist->mlist.scale) - 20; len = 6 + ft_uintlen(clist->currlvl); if (!(str = (char*)malloc((len + 1) * sizeof(char)))) return (-1); ft_sprintf(str, "Stage %hd", clist->currlvl); mlx_string_put(clist->wlist.wlx, - clist->wlist.winptr, - x, y, - 0x00ff0000, - str); + clist->wlist.winptr, + x, y, + 0x00ff0000, + str); ft_memdel((void**)&str); return (0); } diff --git a/src/ft_draw_textures.c b/src/ft_draw_textures.c index 7893ffe..e19d014 100644 --- a/src/ft_draw_textures.c +++ b/src/ft_draw_textures.c @@ -40,8 +40,7 @@ void ft_draw_texture(t_cub *cl, int x, int y, int tex_y) cl->tlist[cl->w_side].img_h * tex_y + 1] / calc; cl->img.ptr[x * 4 + (cl->img.sizeline * y) + 2] = (uint8_t)cl->tlist[cl->w_side].ptr[cl->tlist[cl->w_side].tex_x * 4 + 4 * - cl->tlist[cl->w_side].img_h * tex_y + 2] - / calc; + cl->tlist[cl->w_side].img_h * tex_y + 2] / calc; cl->img.ptr[x * 4 + cl->wlist.x_size * y + 3] = (char)0; } diff --git a/src/ft_draw_verline.c b/src/ft_draw_verline.c index 3728996..915e513 100644 --- a/src/ft_draw_verline.c +++ b/src/ft_draw_verline.c @@ -28,7 +28,6 @@ static void cl->img.ptr[x * 4 + cl->wlist.x_size * y + 3] = (int8_t)0; } -#include <libft.h> static void ft_draw_floor(t_cub *cl, int32_t y, int32_t x) { @@ -57,9 +56,9 @@ static void cl->tlist[6].tex_y = (cl->tlist[6].tex_y > 0) ? (cl->tlist[6].tex_y) : (-cl->tlist[6].tex_y); ft_draw_floor_tex(cl, y, x, cl->tlist[6].tex_y); - /* *(int*)(cl->img.ptr + */ - /* (x * 4 + (y * cl->img.sizeline))) */ - /* = ft_darken_floor(cl->f_rgb, weight, cl); */ + *(int*)(cl->img.ptr + + (x * 4 + (y * cl->img.sizeline))) + = ft_darken_floor(cl->f_rgb, weight, cl); y++; } } diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c index 9077b9b..e7d3b0f 100644 --- a/src/ft_floor_cast.c +++ b/src/ft_floor_cast.c @@ -16,7 +16,7 @@ void ft_floor_cast(t_cub *cl) { - t_ray *rl; + t_ray *rl; const uint32_t map_x = (uint32_t)&cl->plist.pos_x; const uint32_t map_y = (uint32_t)&cl->plist.pos_y; |