Added weapon hud

This commit is contained in:
Theo Champion 2025-09-08 10:36:52 +02:00
parent fe665eaa4e
commit 416b7a833d
4 changed files with 6674 additions and 3 deletions

6668
ressources/weapon.xpm Normal file

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/17 14:59:37 by kcolin #+# #+# */
/* Updated: 2025/09/03 18:22:15 by tchampio ### ########.fr */
/* Updated: 2025/09/05 20:26:30 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -34,6 +34,7 @@ typedef struct s_cub3d_data
t_img_data *perk_logos[3];
t_img_data *tally_marks[5];
t_img_data *round_figures[10];
t_img_data *gun;
t_mapdata *map;
t_player player;
t_keypresses keypresses;

View file

@ -6,7 +6,7 @@
/* By: tchampio <tchampio@student.42lehavre.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/09/03 17:02:08 by tchampio #+# #+# */
/* Updated: 2025/09/03 18:24:18 by tchampio ### ########.fr */
/* Updated: 2025/09/05 20:26:20 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -92,4 +92,5 @@ void load_textures(t_cub3d_data *data)
load_points_textures(data);
load_perk_logos(data);
load_round_indicators(data);
data->gun = load_hud_texture(data, "ressources/weapon.xpm");
}

View file

@ -6,7 +6,7 @@
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/17 14:14:30 by kcolin #+# #+# */
/* Updated: 2025/09/03 18:31:54 by tchampio ### ########.fr */
/* Updated: 2025/09/05 20:25:30 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -102,6 +102,7 @@ void create_hud(t_cub3d_data *data)
// draw round
draw_round(data);
// draw weapon
matrix_image_put(data, data->gun, WIDTH / 2, HEIGHT - 175);
// draw map
}