From 34db19c1a2a6f472effc9b08eb387cada960afb7 Mon Sep 17 00:00:00 2001 From: Theo Champion Date: Mon, 30 Jun 2025 16:16:45 +0200 Subject: [PATCH] testing with bonus rules --- Makefile | 10 ++++++++-- src/main.c | 7 +++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ebdf9d1..98c0e00 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ CC=cc -SANITIZERS= -#-fsanitize=address -fno-omit-frame-pointer +SANITIZERS=-fsanitize=address -fno-omit-frame-pointer CFLAGS=-Wall -Wextra -Werror -ggdb $(SANITIZERS) -I mlx SOURCEFILES=src/main.c \ src/map/map_checker.c \ @@ -28,6 +27,13 @@ clean: fclean: clean rm -f $(NAME) +bonus: CFLAGS += -D BONUS=1 +bonus: fclean $(OBJECTS) + $(MAKE) -C mlx/ + $(MAKE) -C libft/ + cp libft/libft.a . + $(CC) $(CFLAGS) $(OBJECTS) -D BONUS=1 -o $(NAME) -L. -lft -Lmlx -lmlx -lz -lXext -lX11 + re: fclean all .PHONY: all clean fclean re diff --git a/src/main.c b/src/main.c index f24d6e5..7b1435c 100644 --- a/src/main.c +++ b/src/main.c @@ -6,7 +6,7 @@ /* By: tchampio error), 1); data.mlx = mlx_init(); @@ -106,5 +106,8 @@ int main(int argc, char **argv) draw_map(data.map, data.mlx_data); mlx_key_hook(data.mlx_win, key_destroy, &data); mlx_put_image_to_window(data.mlx, data.mlx_win, data.mlx_data->img, 0, 0); + #ifdef BONUS + mlx_string_put(data.mlx, data.mlx_win, 100, 100, 0x00FFFFFF, "compiled with bonuses"); + #endif mlx_loop(data.mlx); }