use ceiling and floor colors from the map file
This commit is contained in:
parent
6eb1479fc5
commit
184c8a60af
3 changed files with 19 additions and 7 deletions
|
@ -6,7 +6,7 @@
|
|||
/* By: mc <mc@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/31 17:00:59 by mc #+# #+# */
|
||||
/* Updated: 2024/11/07 17:10:50 by mc ### ########.fr */
|
||||
/* Updated: 2024/11/07 19:26:53 by mc ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -22,9 +22,6 @@
|
|||
# define MOUSE_ROTATION_SPEED 0.001 // rad/px
|
||||
# define HITBOX 0.25 // Hitbox of N cases around player.
|
||||
|
||||
# define COLOR_CEILING 0x29f8ff // TODO get from cub file
|
||||
# define COLOR_FLOOR 0xFF985C // TODO get from cub file
|
||||
|
||||
# define SCREEN_WIDTH 640 // Width of the window
|
||||
# define SCREEN_HEIGHT 480 // Height of the window
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mc <mc@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/14 14:55:05 by greg #+# #+# */
|
||||
/* Updated: 2024/11/07 00:54:17 by mc ### ########.fr */
|
||||
/* Updated: 2024/11/07 19:27:54 by mc ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -121,13 +121,13 @@ static void draw_vertical_line(int x, u_int32_t *img_data,
|
|||
while (y++ < SCREEN_HEIGHT)
|
||||
{
|
||||
if (y < draw_start)
|
||||
img_data[y * SCREEN_WIDTH + x] = COLOR_CEILING;
|
||||
img_data[y * SCREEN_WIDTH + x] = g_map.color_ceiling;
|
||||
else if (y < draw_end)
|
||||
{
|
||||
draw_wall(tex, ray, line_height, x, y, img_data);
|
||||
}
|
||||
else
|
||||
img_data[y * SCREEN_WIDTH + x] = COLOR_FLOOR;
|
||||
img_data[y * SCREEN_WIDTH + x] = g_map.color_floor;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
15
testmaps/good_floor_ceiling.cub
Normal file
15
testmaps/good_floor_ceiling.cub
Normal file
|
@ -0,0 +1,15 @@
|
|||
F 255,0,127
|
||||
C 0,255,255
|
||||
EA textures/east.xpm
|
||||
NO textures/north.xpm
|
||||
SO textures/south.xpm
|
||||
WE textures/west.xpm
|
||||
111111111
|
||||
100000001
|
||||
100010001
|
||||
100000001
|
||||
1000N0001
|
||||
100000001
|
||||
100000001
|
||||
100000001
|
||||
111111111
|
Loading…
Add table
Reference in a new issue