diff --git a/Makefile b/Makefile index 79a0a2a..3d60b4f 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: qmennen +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2024/10/15 11:48:46 by whaffman #+# #+# # -# Updated: 2025/06/04 18:59:44 by qmennen ### ########.fr # +# Updated: 2025/06/04 20:10:47 by qmennen ### ########.fr # # # # **************************************************************************** # @@ -47,7 +47,7 @@ SOURCES = $(shell basename -a $(shell find $(SRC_PATH) -type f -name "*.c")) # Build configurations BUILD_CONFIGS = release debug asan tsan -release_CFLAGS = -Wall -Werror -Werror -flto -Ofast -march=native -mtune=native -ffast-math -DFULLSCREEN=0 +release_CFLAGS = -Wall -Werror -Werror -flto -Ofast -march=native -mtune=native -ffast-math -DFULLSCREEN=1 unity_CFLAGS = -Wall -Werror -Werror -Ofast -march=native -mtune=native -ffast-math debug_CFLAGS = -Wall -Werror -Werror -g3 -DDEBUG -DDBG='fprintf(stderr, RED "DEBUG: " RESET "%s:%d (%s)\n", __FILE__, __LINE__, __PRETTY_FUNCTION__);' asan_CFLAGS = -Wall -Werror -Werror -flto -fsanitize=address,leak,undefined -g3 -DFULLSCREEN=0 diff --git a/assets/Run.png b/assets/Run.png deleted file mode 100644 index e9b6ee7..0000000 Binary files a/assets/Run.png and /dev/null differ diff --git a/assets/overlay2.png b/assets/hud/cam_overlay.png similarity index 100% rename from assets/overlay2.png rename to assets/hud/cam_overlay.png diff --git a/assets/hud.png b/assets/hud/hud.png similarity index 100% rename from assets/hud.png rename to assets/hud/hud.png diff --git a/assets/hud_2.png b/assets/hud/hud_2.png similarity index 100% rename from assets/hud_2.png rename to assets/hud/hud_2.png diff --git a/assets/end_screen.png b/assets/menu/end_screen.png similarity index 100% rename from assets/end_screen.png rename to assets/menu/end_screen.png diff --git a/assets/menu_background.png b/assets/menu/menu_background.png similarity index 100% rename from assets/menu_background.png rename to assets/menu/menu_background.png diff --git a/assets/surveillor_background.png b/assets/menu/surveillor_background.png similarity index 100% rename from assets/surveillor_background.png rename to assets/menu/surveillor_background.png diff --git a/assets/pixel-art-pack/box.png b/assets/pixel-art-pack/box.png new file mode 100644 index 0000000..3283ffc Binary files /dev/null and b/assets/pixel-art-pack/box.png differ diff --git a/assets/pixel-art-pack/broken_wall.png b/assets/pixel-art-pack/broken_wall.png new file mode 100644 index 0000000..a99cb82 Binary files /dev/null and b/assets/pixel-art-pack/broken_wall.png differ diff --git a/assets/pixel-art-pack/chain.png b/assets/pixel-art-pack/chain.png new file mode 100644 index 0000000..9d56c85 Binary files /dev/null and b/assets/pixel-art-pack/chain.png differ diff --git a/assets/pixel-art-pack/dungeon_ceil.png b/assets/pixel-art-pack/dungeon_ceil.png new file mode 100644 index 0000000..1b6e578 Binary files /dev/null and b/assets/pixel-art-pack/dungeon_ceil.png differ diff --git a/assets/pixel-art-pack/dungeon_floor.png b/assets/pixel-art-pack/dungeon_floor.png new file mode 100644 index 0000000..9fe9dc7 Binary files /dev/null and b/assets/pixel-art-pack/dungeon_floor.png differ diff --git a/assets/pixel-art-pack/dungeon_wall.png b/assets/pixel-art-pack/dungeon_wall.png new file mode 100644 index 0000000..0eb6662 Binary files /dev/null and b/assets/pixel-art-pack/dungeon_wall.png differ diff --git a/assets/pixel-art-pack/dungeon_wall_2.png b/assets/pixel-art-pack/dungeon_wall_2.png new file mode 100644 index 0000000..3015611 Binary files /dev/null and b/assets/pixel-art-pack/dungeon_wall_2.png differ diff --git a/assets/pixel-art-pack/fantasma.png b/assets/pixel-art-pack/fantasma.png new file mode 100644 index 0000000..783cbd4 Binary files /dev/null and b/assets/pixel-art-pack/fantasma.png differ diff --git a/assets/pixel-art-pack/flying_eye.png b/assets/pixel-art-pack/flying_eye.png new file mode 100644 index 0000000..cd6d5de Binary files /dev/null and b/assets/pixel-art-pack/flying_eye.png differ diff --git a/assets/pixel-art-pack/pixel_floor.png b/assets/pixel-art-pack/pixel_floor.png new file mode 100644 index 0000000..89ff824 Binary files /dev/null and b/assets/pixel-art-pack/pixel_floor.png differ diff --git a/assets/pixel-art-pack/plant.png b/assets/pixel-art-pack/plant.png new file mode 100644 index 0000000..7762cee Binary files /dev/null and b/assets/pixel-art-pack/plant.png differ diff --git a/assets/pixel-art-pack/small_plant.png b/assets/pixel-art-pack/small_plant.png new file mode 100644 index 0000000..398be29 Binary files /dev/null and b/assets/pixel-art-pack/small_plant.png differ diff --git a/assets/end_screen.xcf b/assets/xcf/end_screen.xcf similarity index 100% rename from assets/end_screen.xcf rename to assets/xcf/end_screen.xcf diff --git a/assets/menu.xcf b/assets/xcf/menu.xcf similarity index 100% rename from assets/menu.xcf rename to assets/xcf/menu.xcf diff --git a/assets/overlay.xcf b/assets/xcf/overlay.xcf similarity index 100% rename from assets/overlay.xcf rename to assets/xcf/overlay.xcf diff --git a/assets/overlay2.xcf b/assets/xcf/overlay2.xcf similarity index 100% rename from assets/overlay2.xcf rename to assets/xcf/overlay2.xcf diff --git a/assets/surveillor_background.xcf b/assets/xcf/surveillor_background.xcf similarity index 100% rename from assets/surveillor_background.xcf rename to assets/xcf/surveillor_background.xcf diff --git a/maps/pixel.cub b/maps/pixel.cub new file mode 100644 index 0000000..0a6d263 --- /dev/null +++ b/maps/pixel.cub @@ -0,0 +1,40 @@ +NO ./assets/pixel-art-pack/dungeon_wall.png +WE ./assets/pixel-art-pack/dungeon_wall_2.png +SO ./assets/pixel-art-pack/dungeon_wall.png +EA ./assets/pixel-art-pack/dungeon_wall_2.png + +D ./assets/pixel-art-pack/broken_wall.png + +F 90,30,30 +C 100,100,200 + +FT ./assets/pixel-art-pack/dungeon_ceil.png +CT ./assets/pixel-art-pack/dungeon_floor.png + +-s a ./assets/pixel-art-pack/chain.png +-c b ./assets/pixel-art-pack/box.png +-s p ./assets/pixel-art-pack/small_plant.png +-s m ./assets/broken_mirror.png +-s t ./assets/test.png + +-e e ./assets/pixel-art-pack/flying_eye.png +-e f ./assets/pixel-art-pack/fantasma.png + +1111111 111 1111 111111 1111111111 111111 +1a00001110111a01 10a001 1000000001 10001 +10010a00000b0e01 100001 10a00011011110a011 +10b0001110000001110011111111 1100b0001000000f01 +100a001 1000100a00001000a001 1000a0e0100b000001 +100m00111000100000b00000b00111110p00000100p00m0a1 +10b0e0bb000011111111111000000a0000111111000a00001 +1000t0bW00001 10a0011111111 1000001001 +10p0011111DD1 111111100001 1111111111110001 +100a01 1001 1pa0000000011111111000010111 10b01 +111111 1001 100000100a00000a0010b0000101 10a001 + 1b01 10000p1111111111111000a10001 10bf0m1 + 1001 100a000000000a00f0a00111b001 100001 + 1001 1b000000b0a00p00000011 11111 100001 + 10a11111111100111111111111111111001110001 + 1000000000000000000000b00000a0f0000a00001 + 111111b0111111101100111100011101011111111 + 1111 1111111 11111 11111 \ No newline at end of file diff --git a/src/menu/end_screen.c b/src/menu/end_screen.c index 07a0738..f3c4580 100644 --- a/src/menu/end_screen.c +++ b/src/menu/end_screen.c @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ -/* :::::::: */ -/* end_screen.c :+: :+: */ -/* +:+ */ -/* By: qmennen +#+ */ -/* +#+ */ -/* Created: 2025/06/03 16:20:35 by qmennen #+# #+# */ -/* Updated: 2025/06/04 15:48:54 by whaffman ######## odam.nl */ +/* ::: :::::::: */ +/* end_screen.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: qmennen +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/06/03 16:20:35 by qmennen #+# #+# */ +/* Updated: 2025/06/04 19:53:34 by qmennen ### ########.fr */ /* */ /* ************************************************************************** */ @@ -112,7 +112,7 @@ t_menu *create_end_screen(t_game_manager *manager) }; t_menu *menu; - menu = menu_create(manager, "assets/end_screen.png", menu_items); + menu = menu_create(manager, "assets/menu/end_screen.png", menu_items); menu->items[0]->image->instances[0].x = 100; menu->items[0]->image->instances[0].y = manager->game->screen->height / 2; if (!menu) diff --git a/src/menu/main_menu.c b/src/menu/main_menu.c index 06cd7aa..ff9b2fc 100644 --- a/src/menu/main_menu.c +++ b/src/menu/main_menu.c @@ -6,7 +6,7 @@ /* By: qmennen +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/05/28 14:14:11 by qmennen #+# #+# */ -/* Updated: 2025/06/03 20:15:01 by qmennen ### ########.fr */ +/* Updated: 2025/06/04 19:53:06 by qmennen ### ########.fr */ /* */ /* ************************************************************************** */ @@ -42,7 +42,7 @@ t_menu *create_main_menu(t_game_manager *manager) }; t_menu *menu; - menu = menu_create(manager, "./assets/surveillor_background.png", menu_items); + menu = menu_create(manager, "./assets/menu/surveillor_background.png", menu_items); if (!menu) return (NULL); return (menu); diff --git a/src/render/render_floor.c b/src/render/render_floor.c index 01f7e36..0849159 100644 --- a/src/render/render_floor.c +++ b/src/render/render_floor.c @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ -/* :::::::: */ -/* render_floor.c :+: :+: */ -/* +:+ */ -/* By: whaffman +#+ */ -/* +#+ */ -/* Created: 2025/05/14 13:06:39 by whaffman #+# #+# */ -/* Updated: 2025/06/03 13:38:31 by whaffman ######## odam.nl */ +/* ::: :::::::: */ +/* render_floor.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: qmennen +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/05/14 13:06:39 by whaffman #+# #+# */ +/* Updated: 2025/06/04 20:07:21 by qmennen ### ########.fr */ /* */ /* ************************************************************************** */ @@ -26,7 +26,7 @@ static t_vec2 calc_floor_step(t_game *game, static void draw_floor_ceiling_pixel(t_game *game, t_vec2_int coord, double row_dist, t_vec2 floor_pos) { - const t_vec2_int tex = vec2_to_int(mul(get_fraction(floor_pos), 64)); + const t_vec2_int tex = vec2_to_int(mul(get_fraction(floor_pos), game->map->texture_floor->width)); int color; if (game->map->texture_floor == NULL) diff --git a/src/util/initialize.c b/src/util/initialize.c index 801489e..cb329d9 100644 --- a/src/util/initialize.c +++ b/src/util/initialize.c @@ -6,7 +6,7 @@ /* By: qmennen +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/22 17:08:26 by qmennen #+# #+# */ -/* Updated: 2025/06/03 19:31:25 by qmennen ### ########.fr */ +/* Updated: 2025/06/04 19:51:13 by qmennen ### ########.fr */ /* */ /* ************************************************************************** */ @@ -30,7 +30,7 @@ static int init_temp(t_game **game) { mlx_texture_t *hud_texture; - hud_texture = mlx_load_png("./assets/overlay2.png"); + hud_texture = mlx_load_png("./assets/hud/cam_overlay.png"); (*game)->screen->hud = mlx_texture_to_image((*game)->screen->mlx, hud_texture); mlx_delete_texture(hud_texture);