From 17a9d765f17ad62d326fd6d9a60bf0c467e0c068 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Mon, 24 Feb 2020 17:15:39 +0100 Subject: Removed lifebars --- Makefile | 3 +-- inc/cub3d_structs.h | 1 - map/map_one.cub | 6 +++--- src/ft_draw_hud.c | 2 -- src/ft_draw_life_bar.c | 28 ---------------------------- src/ft_init_lists.c | 1 - 6 files changed, 4 insertions(+), 37 deletions(-) delete mode 100644 src/ft_draw_life_bar.c diff --git a/Makefile b/Makefile index 9332243..646ef0b 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,6 @@ SRCS_NAME += ft_key_release.c SRCS_NAME += ft_convert_keycode.c SRCS_NAME += ft_key_loop.c SRCS_NAME += ft_draw_hud.c -SRCS_NAME += ft_draw_life_bar.c SRCS_NAME += ft_music.c #--------------------------------------------------------------------------------------------------# SRCS = $(addprefix ${SRCS_DIR},${SRCS_NAME}) @@ -74,11 +73,11 @@ LFT_SRCS = $(shell find libft/src -name "*.c") MKDIR = mkdir -p RM = rm -rf OS = $(shell uname) -USER = $(shell w | grep tty7 | awk '{print $$1}') ifeq (${OS}, Darwin) SCR_SZE = $(shell osascript -e 'tell application "Finder" to get bounds of window of desktop' \ | tr ',' 'x' | tr -d '\n' | tr -d ' ' | cut -c 5-) else + USER = $(shell w | grep tty7 | awk '{print $$1}') SCR_SZE = $(shell xdpyinfo | grep dimensions | awk '{print $$2}') endif #==================================================================================================# diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index b185d92..639de11 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -67,7 +67,6 @@ typedef struct s_player float cam_x; float plane_x; float plane_y; - int8_t life; } t_player; typedef struct s_ray diff --git a/map/map_one.cub b/map/map_one.cub index ba4cae9..22f3bc5 100644 --- a/map/map_one.cub +++ b/map/map_one.cub @@ -4,13 +4,13 @@ NO ./media/img/BRIQUASSES.xpm SO ./media/img/BRIQUASSE_3.xpm EA ./media/img/BRIQUASSES_2.xpm WE ./media/img/MURLOL.xpm -S ./media/img/segfot.xpm +S ./media/img/MURLOL.xpm C 50,100,200 F 50,190,124 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 2 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 +1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 S 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 @@ -22,5 +22,5 @@ F 50,190,124 1 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 -1 1 1 1 L 1 1 1 1 1 1 1 0 1 0 1 1 1 +1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/src/ft_draw_hud.c b/src/ft_draw_hud.c index 038d1f2..9cb5b1c 100644 --- a/src/ft_draw_hud.c +++ b/src/ft_draw_hud.c @@ -110,6 +110,4 @@ void ft_draw_hud_back_top_r(clist->mlist->map_h, clist->mlist->map_w, clist->wlist, clist); ft_draw_map(clist->mlist->map, clist); - ft_draw_life_bar(clist->mlist->map_w, clist->mlist->scale, - clist->plist->life, clist); } diff --git a/src/ft_draw_life_bar.c b/src/ft_draw_life_bar.c deleted file mode 100644 index bfe642b..0000000 --- a/src/ft_draw_life_bar.c +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include - -void - ft_draw_life_bar(size_t map_w, - const uint16_t scale, - const int8_t life, - t_cub *cl) -{ - uint32_t x; - uint32_t y; - int32_t col; - - (void)life; - col = 0x0022fa38; - x = (map_w * scale) + (scale * 15); - y = cl->wlist->y_size - (scale * 4); - while (x < cl->wlist->x_size - (map_w * scale) - (scale * 15)) - { - while (y < cl->wlist->y_size - (scale * 2)) - { - *(int*)(cl->img.ptr + (x * 4 + (y * cl->img.sizeline))) = col; - y++; - } - y = cl->wlist->y_size - (scale * 4); - x++; - } -} diff --git a/src/ft_init_lists.c b/src/ft_init_lists.c index b9dbfd3..5592358 100644 --- a/src/ft_init_lists.c +++ b/src/ft_init_lists.c @@ -45,7 +45,6 @@ static t_player plist->dir_y = 0; plist->plane_x = 0; plist->plane_y = 0.66666666; - plist->life = 100; return (plist); } -- cgit v1.2.3