diff options
author | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-03-10 06:11:15 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-03-10 06:11:15 +0100 |
commit | 6cbdde3ec081e2bdaf36974af11baff8e6753d7e (patch) | |
tree | 5db231b8304c414b802c4b7adde4718814c833ac | |
parent | updated larry world (diff) | |
download | 42-cub3d-6cbdde3ec081e2bdaf36974af11baff8e6753d7e.tar.gz 42-cub3d-6cbdde3ec081e2bdaf36974af11baff8e6753d7e.tar.bz2 42-cub3d-6cbdde3ec081e2bdaf36974af11baff8e6753d7e.tar.xz 42-cub3d-6cbdde3ec081e2bdaf36974af11baff8e6753d7e.tar.zst 42-cub3d-6cbdde3ec081e2bdaf36974af11baff8e6753d7e.zip |
ok
-rw-r--r-- | map/lvl_five.cub | 2 | ||||
-rw-r--r-- | map/lvl_one.cub | 8 | ||||
-rw-r--r-- | map/map_two.cub | 1 | ||||
-rw-r--r-- | src/ft_floor_cast.c | 13 |
4 files changed, 17 insertions, 7 deletions
diff --git a/map/lvl_five.cub b/map/lvl_five.cub index 87c6cfb..02df893 100644 --- a/map/lvl_five.cub +++ b/map/lvl_five.cub @@ -9,7 +9,7 @@ S ./media/img/pillar.xpm C ./media/img/plate_small.xpm F ./media/img/plate_small.xpm -LT ./media/img/larry.xpm +LT ./media/img/larry_world.xpm L ./map/map_four.cub SH 16 diff --git a/map/lvl_one.cub b/map/lvl_one.cub index 456f130..4b13df2 100644 --- a/map/lvl_one.cub +++ b/map/lvl_one.cub @@ -1,10 +1,10 @@ -R 1600 1050 +R 1280 800 NO ./media/img/BRIQUASSE_3.xpm SO ./media/img/BRIQUASSE_3.xpm EA ./media/img/BRIQUASSE_3.xpm WE ./media/img/BRIQUASSE_3.xpm -S ./media/img/segfot.xpm +S ./media/img/pillar.xpm C ./media/img/BRIQUASSE_3.xpm F ./media/img/BRIQUASSE_3.xpm @@ -17,7 +17,7 @@ MU ./media/sound/TAPE-DU-PIED-ET-FRAPPE-TA-TANTE.wav 1111111 111111111111L00001 -110101010101111101 +112121212121111101 1E0000000000000001 -110101010101010111 +112121212121212111 111111111111111111 diff --git a/map/map_two.cub b/map/map_two.cub index 2d6dd1c..085b681 100644 --- a/map/map_two.cub +++ b/map/map_two.cub @@ -6,6 +6,7 @@ EA ./media/img/linuz.xpm WE ./media/img/linuz.xpm S ./media/img/linuz.xpm +SH 5 C 50,100,200 F 150,150,124 diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c index 104fb49..384f699 100644 --- a/src/ft_floor_cast.c +++ b/src/ft_floor_cast.c @@ -16,8 +16,16 @@ static void ft_draw_plain_horizontal(t_rgb rgb, t_cub *cl, int32_t y, int32_t x) { - *(int*)(cl->img.ptr + - (x * 4 + (y * cl->img.sizeline))) = ft_darken(rgb, cl); + if (cl->mlist.darklvl > 0) + { + *(int*)(cl->img.ptr + + (x * 4 + (y * cl->img.sizeline))) = ft_darken(rgb, cl); + } + else + { + *(int*)(cl->img.ptr + + (x * 4 + (y * cl->img.sizeline))) = ft_rgb_to_hex(rgb); + } } static void @@ -31,6 +39,7 @@ static void calc = (dist * 0.1 * cl->mlist.darklvl); calc = (calc >= 255) ? (255) : (calc); calc = (calc < 1) ? (1) : (calc); + calc = (cl->mlist.darklvl > 0) ? (calc) : (1); cl->img.ptr[x * 4 + (cl->img.sizeline * y)] = (uint8_t)cl->tlist[tid].ptr[cl->tlist[tid].tex_x * 4 + 4 * cl->tlist[tid].img_h * cl->tlist[tid].tex_y] / calc; |