diff --git a/src/game/rpg/CMakeLists.txt b/archive/rpg/CMakeLists.txt similarity index 100% rename from src/game/rpg/CMakeLists.txt rename to archive/rpg/CMakeLists.txt diff --git a/src/game/rpg/entity/CMakeLists.txt b/archive/rpg/entity/CMakeLists.txt similarity index 100% rename from src/game/rpg/entity/CMakeLists.txt rename to archive/rpg/entity/CMakeLists.txt diff --git a/src/game/rpg/entity/direction.c b/archive/rpg/entity/direction.c similarity index 100% rename from src/game/rpg/entity/direction.c rename to archive/rpg/entity/direction.c diff --git a/src/game/rpg/entity/direction.h b/archive/rpg/entity/direction.h similarity index 100% rename from src/game/rpg/entity/direction.h rename to archive/rpg/entity/direction.h diff --git a/src/game/rpg/entity/entity.c b/archive/rpg/entity/entity.c similarity index 100% rename from src/game/rpg/entity/entity.c rename to archive/rpg/entity/entity.c diff --git a/src/game/rpg/entity/entity.h b/archive/rpg/entity/entity.h similarity index 100% rename from src/game/rpg/entity/entity.h rename to archive/rpg/entity/entity.h diff --git a/src/game/rpg/entity/npc.c b/archive/rpg/entity/npc.c similarity index 100% rename from src/game/rpg/entity/npc.c rename to archive/rpg/entity/npc.c diff --git a/src/game/rpg/entity/npc.h b/archive/rpg/entity/npc.h similarity index 100% rename from src/game/rpg/entity/npc.h rename to archive/rpg/entity/npc.h diff --git a/src/game/rpg/entity/player.c b/archive/rpg/entity/player.c similarity index 100% rename from src/game/rpg/entity/player.c rename to archive/rpg/entity/player.c diff --git a/src/game/rpg/entity/player.h b/archive/rpg/entity/player.h similarity index 100% rename from src/game/rpg/entity/player.h rename to archive/rpg/entity/player.h diff --git a/archive/rpg/game.c b/archive/rpg/game.c new file mode 100644 index 0000000..40298d0 --- /dev/null +++ b/archive/rpg/game.c @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2025 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#include "game/game.h" + +errorret_t gameInit(void) { + printf("Init RPG\n"); + errorOk(); +} + +void gameUpdate(void) { + +} + +void gameDispose(void) { + +} \ No newline at end of file diff --git a/src/game/rpg/overworld/CMakeLists.txt b/archive/rpg/overworld/CMakeLists.txt similarity index 100% rename from src/game/rpg/overworld/CMakeLists.txt rename to archive/rpg/overworld/CMakeLists.txt diff --git a/src/game/rpg/overworld/sceneoverworld.c b/archive/rpg/overworld/sceneoverworld.c similarity index 97% rename from src/game/rpg/overworld/sceneoverworld.c rename to archive/rpg/overworld/sceneoverworld.c index 27a3a53..3c49511 100644 --- a/src/game/rpg/overworld/sceneoverworld.c +++ b/archive/rpg/overworld/sceneoverworld.c @@ -7,8 +7,8 @@ #include "sceneoverworld.h" #include "rpg/entity/entity.h" -#include "display/spritebatch/spritebatch.h" -#include "display/framebuffer/framebuffer.h" +#include "display/spritebatch.h" +#include "display/framebuffer.h" #include "display/scene/scenemanager.h" #include "display/mesh/quad.h" #include "asset/assetmanager.h" diff --git a/src/game/rpg/overworld/sceneoverworld.h b/archive/rpg/overworld/sceneoverworld.h similarity index 100% rename from src/game/rpg/overworld/sceneoverworld.h rename to archive/rpg/overworld/sceneoverworld.h diff --git a/src/game/rpg/rpg.c b/archive/rpg/rpg.c similarity index 100% rename from src/game/rpg/rpg.c rename to archive/rpg/rpg.c diff --git a/src/game/rpg/rpg.h b/archive/rpg/rpg.h similarity index 100% rename from src/game/rpg/rpg.h rename to archive/rpg/rpg.h diff --git a/src/game/rpg/screen.c b/archive/rpg/screen.c similarity index 98% rename from src/game/rpg/screen.c rename to archive/rpg/screen.c index f85b8fd..a570a01 100644 --- a/src/game/rpg/screen.c +++ b/archive/rpg/screen.c @@ -7,7 +7,7 @@ #include "screen.h" #include "assert/assert.h" -#include "display/spritebatch/spritebatch.h" +#include "display/spritebatch.h" screen_t SCREEN; diff --git a/src/game/rpg/screen.h b/archive/rpg/screen.h similarity index 93% rename from src/game/rpg/screen.h rename to archive/rpg/screen.h index cdc0faf..41b58a5 100644 --- a/src/game/rpg/screen.h +++ b/archive/rpg/screen.h @@ -7,7 +7,7 @@ #pragma once #include "display/camera.h" -#include "display/framebuffer/framebuffer.h" +#include "display/framebuffer.h" typedef struct { #if DISPLAY_SIZE_DYNAMIC == 1 diff --git a/src/game/rpg/test/CMakeLists.txt b/archive/rpg/test/CMakeLists.txt similarity index 100% rename from src/game/rpg/test/CMakeLists.txt rename to archive/rpg/test/CMakeLists.txt diff --git a/src/game/rpg/test/scenetest.c b/archive/rpg/test/scenetest.c similarity index 96% rename from src/game/rpg/test/scenetest.c rename to archive/rpg/test/scenetest.c index e1d1354..8ccc3c2 100644 --- a/src/game/rpg/test/scenetest.c +++ b/archive/rpg/test/scenetest.c @@ -7,7 +7,7 @@ #include "scenetest.h" #include "display/scene/scenemanager.h" -#include "display/spritebatch/spritebatch.h" +#include "display/spritebatch.h" scenetest_t SCENE_TEST; diff --git a/src/game/rpg/test/scenetest.h b/archive/rpg/test/scenetest.h similarity index 100% rename from src/game/rpg/test/scenetest.h rename to archive/rpg/test/scenetest.h diff --git a/src/game/rpg/world/CMakeLists.txt b/archive/rpg/world/CMakeLists.txt similarity index 100% rename from src/game/rpg/world/CMakeLists.txt rename to archive/rpg/world/CMakeLists.txt diff --git a/src/game/rpg/world/map.c b/archive/rpg/world/map.c similarity index 100% rename from src/game/rpg/world/map.c rename to archive/rpg/world/map.c diff --git a/src/game/rpg/world/map.h b/archive/rpg/world/map.h similarity index 100% rename from src/game/rpg/world/map.h rename to archive/rpg/world/map.h diff --git a/src/game/rpg/world/tile.h b/archive/rpg/world/tile.h similarity index 100% rename from src/game/rpg/world/tile.h rename to archive/rpg/world/tile.h diff --git a/assets/CMakeLists.txt b/assets/CMakeLists.txt index f4eb068..280a291 100644 --- a/assets/CMakeLists.txt +++ b/assets/CMakeLists.txt @@ -3,10 +3,11 @@ # This software is released under the MIT License. # https://opensource.org/licenses/MIT -if(DUSK_TARGET_GAME STREQUAL "rpg") - add_subdirectory(rpg) -elseif(DUSK_TARGET_GAME STREQUAL "minesweeper") - add_subdirectory(minesweeper) -else() - message(FATAL_ERROR "Unknown game specified: ${DUSK_TARGET_GAME}") -endif() \ No newline at end of file +set(DUSK_GAME_ASSETS_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL ${DUSK_CACHE_TARGET}) + +add_subdirectory(palette)# Palette asset needs to be added before any images. + +add_subdirectory(config) +add_subdirectory(entity) +add_subdirectory(map) +add_subdirectory(ui) \ No newline at end of file diff --git a/assets/minesweeper/config/CMakeLists.txt b/assets/config/CMakeLists.txt similarity index 71% rename from assets/minesweeper/config/CMakeLists.txt rename to assets/config/CMakeLists.txt index bd115c1..07960fa 100644 --- a/assets/minesweeper/config/CMakeLists.txt +++ b/assets/config/CMakeLists.txt @@ -4,4 +4,5 @@ # https://opensource.org/licenses/MIT add_asset(CONFIG init.dcf) -add_asset(CONFIG init_psp.dcf) \ No newline at end of file +add_asset(CONFIG init-base.dcf) +add_asset(CONFIG init-psp.dcf) \ No newline at end of file diff --git a/assets/config/init-base.dcf b/assets/config/init-base.dcf new file mode 100644 index 0000000..cffccea --- /dev/null +++ b/assets/config/init-base.dcf @@ -0,0 +1,2 @@ +echo " = Dawn Init = "; +fps 1; \ No newline at end of file diff --git a/assets/rpg/config/init_psp.dcf b/assets/config/init-psp.dcf similarity index 76% rename from assets/rpg/config/init_psp.dcf rename to assets/config/init-psp.dcf index 18162c5..5a47663 100644 --- a/assets/rpg/config/init_psp.dcf +++ b/assets/config/init-psp.dcf @@ -1,4 +1,6 @@ -echo " = Dawn PSP = "; +exec "config/init-base"; + +screen backbuffer; bind up up; bind down down; @@ -8,10 +10,7 @@ bind cross accept; bind circle cancel; bind select toggleconsole; bind start toggleconsole; - bind lstick_negative_y up; bind lstick_positive_y down; bind lstick_negative_x left; -bind lstick_positive_x right; - -fps 1; \ No newline at end of file +bind lstick_positive_x right; \ No newline at end of file diff --git a/assets/rpg/config/init.dcf b/assets/config/init.dcf similarity index 76% rename from assets/rpg/config/init.dcf rename to assets/config/init.dcf index 714d2c7..f1022b3 100644 --- a/assets/rpg/config/init.dcf +++ b/assets/config/init.dcf @@ -1,4 +1,6 @@ -echo " = Dawn Init = "; +exec "config/init-base"; + +screen height 270; bind ` toggleconsole; bind w up; @@ -12,6 +14,4 @@ bind right right; bind e accept; bind enter accept; bind q cancel; -bind esc quit; - -fps 1; \ No newline at end of file +bind esc quit; \ No newline at end of file diff --git a/assets/rpg/entity/CMakeLists.txt b/assets/entity/CMakeLists.txt similarity index 100% rename from assets/rpg/entity/CMakeLists.txt rename to assets/entity/CMakeLists.txt diff --git a/assets/rpg/entity/entities.png b/assets/entity/entities.png similarity index 100% rename from assets/rpg/entity/entities.png rename to assets/entity/entities.png diff --git a/assets/rpg/entity/entities.tsx b/assets/entity/entities.tsx similarity index 100% rename from assets/rpg/entity/entities.tsx rename to assets/entity/entities.tsx diff --git a/assets/rpg/map/CMakeLists.txt b/assets/map/CMakeLists.txt similarity index 100% rename from assets/rpg/map/CMakeLists.txt rename to assets/map/CMakeLists.txt diff --git a/assets/rpg/map/untitled.tmx b/assets/map/untitled.tmx similarity index 100% rename from assets/rpg/map/untitled.tmx rename to assets/map/untitled.tmx diff --git a/assets/minesweeper/CMakeLists.txt b/assets/minesweeper/CMakeLists.txt deleted file mode 100644 index 4dc5bc9..0000000 --- a/assets/minesweeper/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2025 Dominic Masters -# -# This software is released under the MIT License. -# https://opensource.org/licenses/MIT - -set(DUSK_GAME_ASSETS_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL ${DUSK_CACHE_TARGET}) - -# Palette asset needs to be added before any images. -add_subdirectory(palette) -add_subdirectory(config) -add_subdirectory(ui) \ No newline at end of file diff --git a/assets/minesweeper/config/init.dcf b/assets/minesweeper/config/init.dcf deleted file mode 100644 index 30edff1..0000000 --- a/assets/minesweeper/config/init.dcf +++ /dev/null @@ -1,19 +0,0 @@ -echo " = Dawn Init = "; - -bind ` toggleconsole; -bind w up; -bind s down; -bind a left; -bind d right; -bind up up; -bind down down; -bind left left; -bind right right; -bind e accept; -bind enter accept; -bind q cancel; -bind esc quit; - -fps 1; - -scene sweep; \ No newline at end of file diff --git a/assets/minesweeper/config/init_psp.dcf b/assets/minesweeper/config/init_psp.dcf deleted file mode 100644 index 802b20a..0000000 --- a/assets/minesweeper/config/init_psp.dcf +++ /dev/null @@ -1,19 +0,0 @@ -echo " = Dawn PSP = "; - -bind up up; -bind down down; -bind left left; -bind right right; -bind cross accept; -bind circle cancel; -bind select toggleconsole; -bind start toggleconsole; - -bind lstick_negative_y up; -bind lstick_positive_y down; -bind lstick_negative_x left; -bind lstick_positive_x right; - -fps 1; - -scene sweep; \ No newline at end of file diff --git a/assets/minesweeper/palette/palette0.png b/assets/minesweeper/palette/palette0.png deleted file mode 100644 index 51dbd9f..0000000 Binary files a/assets/minesweeper/palette/palette0.png and /dev/null differ diff --git a/assets/minesweeper/palette/palette0.pxo b/assets/minesweeper/palette/palette0.pxo deleted file mode 100644 index f314160..0000000 Binary files a/assets/minesweeper/palette/palette0.pxo and /dev/null differ diff --git a/assets/minesweeper/sweep/CMakeLists.txt b/assets/minesweeper/sweep/CMakeLists.txt deleted file mode 100644 index 45c387e..0000000 --- a/assets/minesweeper/sweep/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) 2025 Dominic Masters -# -# This software is released under the MIT License. -# https://opensource.org/licenses/MIT diff --git a/assets/minesweeper/sweep/backgrounds.png b/assets/minesweeper/sweep/backgrounds.png deleted file mode 100644 index a27f452..0000000 Binary files a/assets/minesweeper/sweep/backgrounds.png and /dev/null differ diff --git a/assets/minesweeper/sweep/borders.png b/assets/minesweeper/sweep/borders.png deleted file mode 100644 index a293a2e..0000000 Binary files a/assets/minesweeper/sweep/borders.png and /dev/null differ diff --git a/assets/minesweeper/sweep/cells.png b/assets/minesweeper/sweep/cells.png deleted file mode 100644 index df2edcf..0000000 Binary files a/assets/minesweeper/sweep/cells.png and /dev/null differ diff --git a/assets/minesweeper/sweep/grids.png b/assets/minesweeper/sweep/grids.png deleted file mode 100644 index 6c62ec6..0000000 Binary files a/assets/minesweeper/sweep/grids.png and /dev/null differ diff --git a/assets/minesweeper/ui/CMakeLists.txt b/assets/minesweeper/ui/CMakeLists.txt deleted file mode 100644 index 2877a88..0000000 --- a/assets/minesweeper/ui/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (c) 2025 Dominic Masters -# -# This software is released under the MIT License. -# https://opensource.org/licenses/MIT - -add_asset(TILESET minogram.png type=ALPHA tileWidth=6 tileHeight=10 columns=16 rows=6) -add_asset(TILESET ui.png type=PALETTIZED tileWidth=16 tileHeight=16) -add_asset(TILESET ui_frame.png type=PALETTIZED tileWidth=16 tileHeight=16) -add_asset(TILESET background.png type=PALETTIZED tileWidth=16 tileHeight=16) diff --git a/assets/minesweeper/ui/background.png b/assets/minesweeper/ui/background.png deleted file mode 100644 index 077cca2..0000000 Binary files a/assets/minesweeper/ui/background.png and /dev/null differ diff --git a/assets/minesweeper/ui/background.pxo b/assets/minesweeper/ui/background.pxo deleted file mode 100644 index 49a75fd..0000000 Binary files a/assets/minesweeper/ui/background.pxo and /dev/null differ diff --git a/assets/minesweeper/ui/frame_large.png b/assets/minesweeper/ui/frame_large.png deleted file mode 100644 index 3d3d3ad..0000000 Binary files a/assets/minesweeper/ui/frame_large.png and /dev/null differ diff --git a/assets/minesweeper/ui/frame_large.pxo b/assets/minesweeper/ui/frame_large.pxo deleted file mode 100644 index 51c8460..0000000 Binary files a/assets/minesweeper/ui/frame_large.pxo and /dev/null differ diff --git a/assets/minesweeper/ui/ui.png b/assets/minesweeper/ui/ui.png deleted file mode 100644 index 74832f9..0000000 Binary files a/assets/minesweeper/ui/ui.png and /dev/null differ diff --git a/assets/minesweeper/ui/ui.pxo b/assets/minesweeper/ui/ui.pxo deleted file mode 100644 index 1ff4fcf..0000000 Binary files a/assets/minesweeper/ui/ui.pxo and /dev/null differ diff --git a/assets/minesweeper/ui/ui_frame b/assets/minesweeper/ui/ui_frame deleted file mode 100644 index 3f3c281..0000000 Binary files a/assets/minesweeper/ui/ui_frame and /dev/null differ diff --git a/assets/minesweeper/ui/ui_frame.png b/assets/minesweeper/ui/ui_frame.png deleted file mode 100644 index 5815eb1..0000000 Binary files a/assets/minesweeper/ui/ui_frame.png and /dev/null differ diff --git a/assets/minesweeper/palette/CMakeLists.txt b/assets/palette/CMakeLists.txt similarity index 100% rename from assets/minesweeper/palette/CMakeLists.txt rename to assets/palette/CMakeLists.txt diff --git a/assets/rpg/palette/palette0.png b/assets/palette/palette0.png similarity index 100% rename from assets/rpg/palette/palette0.png rename to assets/palette/palette0.png diff --git a/assets/rpg/palette/palette0.pxo b/assets/palette/palette0.pxo similarity index 100% rename from assets/rpg/palette/palette0.pxo rename to assets/palette/palette0.pxo diff --git a/assets/rpg/CMakeLists.txt b/assets/rpg/CMakeLists.txt deleted file mode 100644 index 280a291..0000000 --- a/assets/rpg/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2025 Dominic Masters -# -# This software is released under the MIT License. -# https://opensource.org/licenses/MIT - -set(DUSK_GAME_ASSETS_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL ${DUSK_CACHE_TARGET}) - -add_subdirectory(palette)# Palette asset needs to be added before any images. - -add_subdirectory(config) -add_subdirectory(entity) -add_subdirectory(map) -add_subdirectory(ui) \ No newline at end of file diff --git a/assets/rpg/config/CMakeLists.txt b/assets/rpg/config/CMakeLists.txt deleted file mode 100644 index bd115c1..0000000 --- a/assets/rpg/config/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2025 Dominic Masters -# -# This software is released under the MIT License. -# https://opensource.org/licenses/MIT - -add_asset(CONFIG init.dcf) -add_asset(CONFIG init_psp.dcf) \ No newline at end of file diff --git a/assets/rpg/palette/CMakeLists.txt b/assets/rpg/palette/CMakeLists.txt deleted file mode 100644 index d8eda53..0000000 --- a/assets/rpg/palette/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2025 Dominic Masters -# -# This software is released under the MIT License. -# https://opensource.org/licenses/MIT - -add_asset(PALETTE palette0.png) \ No newline at end of file diff --git a/assets/rpg/ui/minogram.png b/assets/rpg/ui/minogram.png deleted file mode 100644 index c41f917..0000000 Binary files a/assets/rpg/ui/minogram.png and /dev/null differ diff --git a/assets/rpg/tileset/prarie.png b/assets/tileset/prarie.png similarity index 100% rename from assets/rpg/tileset/prarie.png rename to assets/tileset/prarie.png diff --git a/assets/rpg/tileset/prarie.pxo b/assets/tileset/prarie.pxo similarity index 100% rename from assets/rpg/tileset/prarie.pxo rename to assets/tileset/prarie.pxo diff --git a/assets/rpg/tileset/prarie.tsx b/assets/tileset/prarie.tsx similarity index 100% rename from assets/rpg/tileset/prarie.tsx rename to assets/tileset/prarie.tsx diff --git a/assets/rpg/ui/CMakeLists.txt b/assets/ui/CMakeLists.txt similarity index 100% rename from assets/rpg/ui/CMakeLists.txt rename to assets/ui/CMakeLists.txt diff --git a/assets/minesweeper/ui/minogram.png b/assets/ui/minogram.png similarity index 100% rename from assets/minesweeper/ui/minogram.png rename to assets/ui/minogram.png diff --git a/assets/rpg/untitled.tiled-project b/assets/untitled.tiled-project similarity index 100% rename from assets/rpg/untitled.tiled-project rename to assets/untitled.tiled-project diff --git a/assets/rpg/untitled.tiled-session b/assets/untitled.tiled-session similarity index 100% rename from assets/rpg/untitled.tiled-session rename to assets/untitled.tiled-session diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 815168f..0d76f8c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -33,7 +33,6 @@ add_subdirectory(console) add_subdirectory(display) add_subdirectory(engine) add_subdirectory(error) -add_subdirectory(game) add_subdirectory(input) # add_subdirectory(locale) add_subdirectory(physics) diff --git a/src/asset/type/assetalphaimage.h b/src/asset/type/assetalphaimage.h index 219a186..f3af5ba 100644 --- a/src/asset/type/assetalphaimage.h +++ b/src/asset/type/assetalphaimage.h @@ -7,7 +7,7 @@ #pragma once #include "error/error.h" -#include "display/texture/texture.h" +#include "display/texture.h" #define ASSET_ALPHA_IMAGE_WIDTH_MAX 256 #define ASSET_ALPHA_IMAGE_HEIGHT_MAX 256 diff --git a/src/asset/type/assetpaletteimage.h b/src/asset/type/assetpaletteimage.h index 37a595e..ebb754e 100644 --- a/src/asset/type/assetpaletteimage.h +++ b/src/asset/type/assetpaletteimage.h @@ -7,7 +7,7 @@ #pragma once #include "error/error.h" -#include "display/texture/texture.h" +#include "display/texture.h" #define ASSET_PALETTE_IMAGE_WIDTH_MAX 128 #define ASSET_PALETTE_IMAGE_HEIGHT_MAX 128 diff --git a/src/console/cmd/cmdscreen.h b/src/console/cmd/cmdscreen.h new file mode 100644 index 0000000..de2a173 --- /dev/null +++ b/src/console/cmd/cmdscreen.h @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2025 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#pragma once +#include "console/console.h" +#include "display/screen.h" + +void cmdScreen(const consolecmdexec_t *exec) { + if(exec->argc < 1) { + consolePrint("Expected 1 argument: [value]"); + return; + } + + if(strcmp(exec->argv[0], "backbuffer") == 0) { + SCREEN.mode = SCREEN_MODE_BACKBUFFER; + return; + } +} \ No newline at end of file diff --git a/src/console/console.c b/src/console/console.c index 18fd874..9c75030 100644 --- a/src/console/console.c +++ b/src/console/console.c @@ -20,6 +20,7 @@ #include "console/cmd/cmdtoggleconsole.h" #include "console/cmd/cmdalias.h" #include "console/cmd/cmdscene.h" +#include "console/cmd/cmdscreen.h" console_t CONSOLE; @@ -36,6 +37,7 @@ void consoleInit() { consoleRegCmd("toggleconsole", cmdToggleConsole); consoleRegCmd("alias", cmdAlias); consoleRegCmd("scene", cmdScene); + consoleRegCmd("screen", cmdScreen); #if CONSOLE_POSIX threadInit(&CONSOLE.thread, consoleInputThread); diff --git a/src/display/CMakeLists.txt b/src/display/CMakeLists.txt index 1f982c7..3c88a0e 100644 --- a/src/display/CMakeLists.txt +++ b/src/display/CMakeLists.txt @@ -7,17 +7,17 @@ target_sources(${DUSK_TARGET_NAME} PRIVATE display.c + framebuffer.c camera.c - tileset.c screen.c + texture.c + spritebatch.c ) # Subdirectories -add_subdirectory(framebuffer) add_subdirectory(mesh) add_subdirectory(palette) -add_subdirectory(texture) -add_subdirectory(spritebatch) +add_subdirectory(tileset) if(DUSK_TARGET_SYSTEM STREQUAL "linux") target_compile_definitions(${DUSK_TARGET_NAME} diff --git a/src/display/camera.c b/src/display/camera.c index 9582815..d60507e 100644 --- a/src/display/camera.c +++ b/src/display/camera.c @@ -8,7 +8,7 @@ #include "camera.h" #include "display/display.h" #include "assert/assert.h" -#include "display/framebuffer/framebuffer.h" +#include "display/framebuffer.h" void cameraInit(camera_t *camera) { cameraInitPerspective(camera); diff --git a/src/display/display.c b/src/display/display.c index 238aa79..bb7dd2f 100644 --- a/src/display/display.c +++ b/src/display/display.c @@ -7,11 +7,10 @@ #include "display/display.h" #include "console/console.h" -#include "display/framebuffer/framebuffer.h" +#include "display/framebuffer.h" #include "scene/scenemanager.h" -#include "display/spritebatch/spritebatch.h" +#include "display/spritebatch.h" #include "display/mesh/quad.h" -#include "game/game.h" #include "display/screen.h" display_t DISPLAY; diff --git a/src/display/display.h b/src/display/display.h index 63e007a..34d1397 100644 --- a/src/display/display.h +++ b/src/display/display.h @@ -9,7 +9,7 @@ #include "displaydefs.h" #include "error/error.h" #include "display/camera.h" -#include "display/framebuffer/framebuffer.h" +#include "display/framebuffer.h" typedef struct { #if DISPLAY_SDL2 diff --git a/src/display/framebuffer/framebuffer.c b/src/display/framebuffer.c similarity index 100% rename from src/display/framebuffer/framebuffer.c rename to src/display/framebuffer.c diff --git a/src/display/framebuffer/framebuffer.h b/src/display/framebuffer.h similarity index 98% rename from src/display/framebuffer/framebuffer.h rename to src/display/framebuffer.h index dd8b4c4..b33b19c 100644 --- a/src/display/framebuffer/framebuffer.h +++ b/src/display/framebuffer.h @@ -6,7 +6,7 @@ */ #pragma once -#include "display/texture/texture.h" +#include "display/texture.h" #define FRAMEBUFFER_CLEAR_COLOR (1 << 0) #define FRAMEBUFFER_CLEAR_DEPTH (1 << 1) diff --git a/src/display/framebuffer/CMakeLists.txt b/src/display/framebuffer/CMakeLists.txt deleted file mode 100644 index 9f0656b..0000000 --- a/src/display/framebuffer/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) 2025 Dominic Masters -# -# This software is released under the MIT License. -# https://opensource.org/licenses/MIT - -# Sources -target_sources(${DUSK_TARGET_NAME} - PRIVATE - framebuffer.c -) \ No newline at end of file diff --git a/src/display/screen.h b/src/display/screen.h index 41437fc..397aee8 100644 --- a/src/display/screen.h +++ b/src/display/screen.h @@ -7,7 +7,7 @@ #pragma once #include "dusk.h" -#include "display/framebuffer/framebuffer.h" +#include "display/framebuffer.h" #include "display/camera.h" #include "display/mesh/quad.h" diff --git a/src/display/spritebatch/spritebatch.c b/src/display/spritebatch.c similarity index 100% rename from src/display/spritebatch/spritebatch.c rename to src/display/spritebatch.c diff --git a/src/display/spritebatch/spritebatch.h b/src/display/spritebatch.h similarity index 98% rename from src/display/spritebatch/spritebatch.h rename to src/display/spritebatch.h index 54fe051..d89af54 100644 --- a/src/display/spritebatch/spritebatch.h +++ b/src/display/spritebatch.h @@ -7,7 +7,7 @@ #pragma once #include "display/mesh/quad.h" -#include "display/texture/texture.h" +#include "display/texture.h" #define SPRITEBATCH_SPRITES_MAX 1 #define SPRITEBATCH_VERTEX_COUNT (SPRITEBATCH_SPRITES_MAX * QUAD_VERTEX_COUNT) diff --git a/src/display/texture/texture.c b/src/display/texture.c similarity index 100% rename from src/display/texture/texture.c rename to src/display/texture.c diff --git a/src/display/texture/texture.h b/src/display/texture.h similarity index 100% rename from src/display/texture/texture.h rename to src/display/texture.h diff --git a/src/display/texture/CMakeLists.txt b/src/display/texture/CMakeLists.txt deleted file mode 100644 index 369aaac..0000000 --- a/src/display/texture/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2025 Dominic Masters -# -# This software is released under the MIT License. -# https://opensource.org/licenses/MIT - -# Sources -target_sources(${DUSK_TARGET_NAME} - PRIVATE - texture.c -) - -# Subdirs -# add_subdirectory(draw) \ No newline at end of file diff --git a/src/display/spritebatch/CMakeLists.txt b/src/display/tileset/CMakeLists.txt similarity index 91% rename from src/display/spritebatch/CMakeLists.txt rename to src/display/tileset/CMakeLists.txt index 7c64a15..2be6457 100644 --- a/src/display/spritebatch/CMakeLists.txt +++ b/src/display/tileset/CMakeLists.txt @@ -6,5 +6,5 @@ # Sources target_sources(${DUSK_TARGET_NAME} PRIVATE - spritebatch.c + tileset.c ) \ No newline at end of file diff --git a/src/display/tileset.c b/src/display/tileset/tileset.c similarity index 100% rename from src/display/tileset.c rename to src/display/tileset/tileset.c diff --git a/src/display/tileset.h b/src/display/tileset/tileset.h similarity index 100% rename from src/display/tileset.h rename to src/display/tileset/tileset.h diff --git a/src/engine/engine.c b/src/engine/engine.c index ee9814a..4b1e552 100644 --- a/src/engine/engine.c +++ b/src/engine/engine.c @@ -13,7 +13,6 @@ #include "display/display.h" #include "scene/scenemanager.h" #include "asset/assetmanager.h" -#include "game/game.h" engine_t ENGINE; @@ -31,11 +30,10 @@ errorret_t engineInit(void) { errorChain(assetManagerInit()); errorChain(displayInit()); errorChain(sceneManagerInit()); - errorChain(gameInit()); // Init scripts #if PSP - consoleExec("exec config/init_psp.dcf"); + consoleExec("exec config/init-psp.dcf"); #else consoleExec("exec config/init.dcf"); #endif @@ -49,7 +47,6 @@ errorret_t engineUpdate(void) { consoleUpdate(); assetManagerUpdate(); - gameUpdate(); sceneManagerUpdate(); errorChain(displayUpdate()); @@ -57,11 +54,9 @@ errorret_t engineUpdate(void) { } errorret_t engineDispose(void) { - gameDispose(); sceneManagerDispose(); errorChain(displayDispose()); assetManagerDispose(); consoleDispose(); - errorOk(); } \ No newline at end of file diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt deleted file mode 100644 index 7dcf24b..0000000 --- a/src/game/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2025 Dominic Masters -# -# This software is released under the MIT License. -# https://opensource.org/licenses/MIT - -if(NOT DEFINED DUSK_TARGET_GAME) - message(FATAL_ERROR "DUSK_TARGET_GAME is not defined.") -endif() - -string(TOUPPER "${DUSK_TARGET_GAME}" DUSK_TARGET_GAME_UPPER) - -target_compile_definitions(${DUSK_TARGET_NAME} - PRIVATE - DUSK_TARGET_GAME=${DUSK_TARGET_GAME} - DUSK_GAME_${DUSK_TARGET_GAME_UPPER}=1 -) - -add_subdirectory(${DUSK_TARGET_GAME}) \ No newline at end of file diff --git a/src/game/game.h b/src/game/game.h deleted file mode 100644 index 513877d..0000000 --- a/src/game/game.h +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) 2025 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#pragma once -#include "error/error.h" - -/** - * Initialize the game. - * - * @return Error code. - */ -errorret_t gameInit(void); - -/** - * Update the game state. - */ -void gameUpdate(void); - -/** - * Dispose of the game. - */ -void gameDispose(void); \ No newline at end of file diff --git a/src/game/minesweeper/CMakeLists.txt b/src/game/minesweeper/CMakeLists.txt deleted file mode 100644 index fb9665a..0000000 --- a/src/game/minesweeper/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2025 Dominic Masters -# -# This software is released under the MIT License. -# https://opensource.org/licenses/MIT - -# Sources -target_sources(${DUSK_TARGET_NAME} - PRIVATE - game.c -) - -# Subdirs -add_subdirectory(display) -add_subdirectory(scene) -add_subdirectory(ui) \ No newline at end of file diff --git a/src/game/minesweeper/display/CMakeLists.txt b/src/game/minesweeper/display/CMakeLists.txt deleted file mode 100644 index ba4feac..0000000 --- a/src/game/minesweeper/display/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2025 Dominic Masters -# -# This software is released under the MIT License. -# https://opensource.org/licenses/MIT - -# Sources -target_sources(${DUSK_TARGET_NAME} - PRIVATE - sweepboard.c -) - -# Subdirs \ No newline at end of file diff --git a/src/game/minesweeper/display/sweepboard.c b/src/game/minesweeper/display/sweepboard.c deleted file mode 100644 index 2fb13b2..0000000 --- a/src/game/minesweeper/display/sweepboard.c +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright (c) 2025 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#include "sweepboard.h" - -sweepboard_t SWEEPBOARD; - -void sweepBoardInit() { - // Initialize the sweep board -} - -void sweepBoardRender(const float_t x, const float_t y) { - // Frame - // uiFrameDrawTiled( - // 32, 32, - // w - 64, h - 64, - // UI.frameTileset, - // 0, 0, - // true, - // &UI.frameAsset->paletteImage.texture - // ); -} - -void sweepBoardDispose() { - // Dispose of the sweep board resources -} \ No newline at end of file diff --git a/src/game/minesweeper/display/sweepboard.h b/src/game/minesweeper/display/sweepboard.h deleted file mode 100644 index 69144da..0000000 --- a/src/game/minesweeper/display/sweepboard.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2025 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#pragma once -#include "dusk.h" - -typedef struct { - int32_t nothing; -} sweepboard_t; - -extern sweepboard_t SWEEPBOARD; - -/** - * Initializes the sweep board. - */ -void sweepBoardInit(); - -/** - * Disposes of the sweep board resources. - */ -void sweepBoardDispose(); \ No newline at end of file diff --git a/src/game/minesweeper/game.c b/src/game/minesweeper/game.c deleted file mode 100644 index b1c8139..0000000 --- a/src/game/minesweeper/game.c +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2025 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#include "game/game.h" -#include "game/minesweeper/ui/ui.h" -#include "game/minesweeper/scene/scenesweep.h" -#include "scene/scenemanager.h" -#include "console/console.h" -#include "display/screen.h" - -errorret_t gameInit(void) { - // Setup screen - SCREEN.mode = SCREEN_MODE_FIXED_HEIGHT; - SCREEN.fixedHeight.height = 270; - - errorChain(uiInit()); - - sceneManagerRegisterScene(&SCENE_SWEEP); - - errorOk(); -} - -void gameUpdate(void) { - -} - -void gameDispose(void) { - uiDispose(); -} \ No newline at end of file diff --git a/src/game/minesweeper/scene/CMakeLists.txt b/src/game/minesweeper/scene/CMakeLists.txt deleted file mode 100644 index cb19f3a..0000000 --- a/src/game/minesweeper/scene/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2025 Dominic Masters -# -# This software is released under the MIT License. -# https://opensource.org/licenses/MIT - -# Sources -target_sources(${DUSK_TARGET_NAME} - PRIVATE - scenesweep.c -) - -# Subdirs \ No newline at end of file diff --git a/src/game/minesweeper/scene/scenesweep.c b/src/game/minesweeper/scene/scenesweep.c deleted file mode 100644 index 435778f..0000000 --- a/src/game/minesweeper/scene/scenesweep.c +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (c) 2025 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#include "scenesweep.h" -#include "game/minesweeper/ui/ui.h" -#include "ui/uiframe.h" -#include "display/spritebatch/spritebatch.h" -#include "game/minesweeper/display/sweepboard.h" -#include "display/screen.h" - -scene_t SCENE_SWEEP = { - .name = "sweep", - .init = sceneSweepInit, - .update = sceneSweepUpdate, - .render = sceneSweepRender, - .dispose = sceneSweepDispose, - .background = color_hex(0x48413cff) -}; - -scenesweep_t SCENE_SWEEP_DATA; - -errorret_t sceneSweepInit(void) { - cameraInitOrthographic(&SCENE_SWEEP_DATA.camera); - - // Initialize scene data here - errorOk(); -} - -void sceneSweepUpdate(void) { - // Update scene logic here -} - -void sceneSweepRender(void) { - int32_t w = SCREEN.width; - int32_t h = SCREEN.height; - - SCENE_SWEEP_DATA.camera.orthographic.left = 0; - SCENE_SWEEP_DATA.camera.orthographic.right = w; - SCENE_SWEEP_DATA.camera.orthographic.bottom = h; - SCENE_SWEEP_DATA.camera.orthographic.top = 0; - cameraPushMatrix(&SCENE_SWEEP_DATA.camera); - - // Background - uiFrameDrawTiled( - 8, 8, - w - 16, h - 16, - UI.backgroundTileset, - 0, 0, - true, - &UI.backgroundAsset->paletteImage.texture - ); - - // Frame - uiFrameDrawTiled( - 32, 32, - w - 64, h - 64, - UI.frameTileset, - 0, 0, - true, - &UI.frameAsset->paletteImage.texture - ); - - spriteBatchFlush(); - cameraPopMatrix(); - - uiRender(); -} - -void sceneSweepDispose(void) { - // Clean up scene resources here - printf("Disposing sweep scene\n"); -} \ No newline at end of file diff --git a/src/game/minesweeper/scene/scenesweep.h b/src/game/minesweeper/scene/scenesweep.h deleted file mode 100644 index 4da8de8..0000000 --- a/src/game/minesweeper/scene/scenesweep.h +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (c) 2025 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#pragma once -#include "scene/scene.h" -#include "display/camera.h" - -typedef struct { - camera_t camera; -} scenesweep_t; - -extern scene_t SCENE_SWEEP; -extern scenesweep_t SCENE_SWEEP_DATA; - -/** - * Initializes the scene. - */ -errorret_t sceneSweepInit(void); - -/** - * Updates the state of the scene. - */ -void sceneSweepUpdate(void); - -/** - * Renders the current state of the scene. - */ -void sceneSweepRender(void); - -/** - * Cleans up resources used by the scene. - */ -void sceneSweepDispose(void); \ No newline at end of file diff --git a/src/game/minesweeper/sweeper.c b/src/game/minesweeper/sweeper.c deleted file mode 100644 index 6472ab6..0000000 --- a/src/game/minesweeper/sweeper.c +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright (c) 2025 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#include "sweeper.h" -#include "assert/assert.h" -#include "util/memory.h" - -extern sweeper_t SWEEPER; - -void sweeperInit(void) { - memoryZero(&SWEEPER, sizeof(sweeper_t)); -} - -void sweeperReveal(const uint16_t x, const uint16_t y) { - assertTrue(x < SWEEPER_GRID_WIDTH, "X coordinate out of bounds"); - assertTrue(y < SWEEPER_GRID_HEIGHT, "Y coordinate out of bounds"); - - sweepercell_t *cell = &SWEEPER.grid[y * SWEEPER_GRID_WIDTH + x]; - - // Dont reveal twice. - if(*cell != SWEEPER_CELL_HIDDEN) { - return; - } - - // Can't reveal flag. - if(*cell == SWEEPER_CELL_FLAGGED) { - return; - } - - // Game over - if(cell == SWEEPER_CELL_HIDDEN_MINE) { - *cell = SWEEPER_CELL_MINE; - SWEEPER.gameOver = true; - return; - } - - // Adjacent mines - uint8_t surrounding = 0; - for(int16_t dy = -1; dy <= 1; ++dy) { - for(int16_t dx = -1; dx <= 1; ++dx) { - if(dx == 0 && dy == 0) continue; - - int16_t nx = x + dx; - int16_t ny = y + dy; - if( - nx < 0 || nx >= SWEEPER_GRID_WIDTH || - ny < 0 || ny >= SWEEPER_GRID_HEIGHT - ) continue; - - sweepercell_t neighbor = SWEEPER.grid[ny * SWEEPER_GRID_WIDTH + nx]; - if(neighbor == SWEEPER_CELL_HIDDEN_MINE) surrounding++; - } - } - - if(surrounding > 0) { - *cell = SWEEPER_CELL_0 + surrounding; - return; - } - - // Cascade reveal - printf("Cascading reveal at %d, %d\n", x, y); - *cell = SWEEPER_CELL_0; -} - -void sweeperFlag(const uint16_t x, const uint16_t y) { - assertTrue(x < SWEEPER_GRID_WIDTH, "X coordinate out of bounds"); - assertTrue(y < SWEEPER_GRID_HEIGHT, "Y coordinate out of bounds"); - - sweepercell_t *cell = &SWEEPER.grid[y * SWEEPER_GRID_WIDTH + x]; - - if(*cell == SWEEPER_CELL_HIDDEN) { - *cell = SWEEPER_CELL_FLAGGED; - } else if(*cell == SWEEPER_CELL_FLAGGED) { - *cell = SWEEPER_CELL_HIDDEN; - } -} \ No newline at end of file diff --git a/src/game/minesweeper/sweeper.h b/src/game/minesweeper/sweeper.h deleted file mode 100644 index 993d9fd..0000000 --- a/src/game/minesweeper/sweeper.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (c) 2025 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#pragma once -#include "dusk.h" - -typedef enum { - SWEEPER_CELL_HIDDEN = 0x00, - SWEEPER_CELL_HIDDEN_MINE = 0x01, - SWEEPER_CELL_0 = 0x02, - SWEEPER_CELL_1 = 0x03, - SWEEPER_CELL_2 = 0x04, - SWEEPER_CELL_3 = 0x05, - SWEEPER_CELL_4 = 0x06, - SWEEPER_CELL_5 = 0x07, - SWEEPER_CELL_6 = 0x08, - SWEEPER_CELL_7 = 0x09, - SWEEPER_CELL_8 = 0x0A, - SWEEPER_CELL_9 = 0x0B, - SWEEPER_CELL_FLAGGED = 0x0C, - SWEEPER_CELL_MINE = 0x0D, -} sweepercell_t; - -#define SWEEPER_GRID_WIDTH 16 -#define SWEEPER_GRID_HEIGHT 16 - -typedef struct { - sweepercell_t grid[SWEEPER_GRID_WIDTH * SWEEPER_GRID_HEIGHT]; - bool_t gameOver; -} sweeper_t; - -extern sweeper_t SWEEPER; - -/** - * Initializes the Minesweeper game state. - */ -void sweeperInit(void); - -/** - * Reveals the cell at the specified coordinates. - * - * @param x The x-coordinate of the cell to reveal. - * @param y The y-coordinate of the cell to reveal. - */ -void sweeperReveal(const uint16_t x, const uint16_t y); - -/** - * Flags or unflags the cell at the specified coordinates. - * - * @param x The x-coordinate of the cell to flag or unflag. - * @param y The y-coordinate of the cell to flag or unflag. - */ -void sweeperFlag(const uint16_t x, const uint16_t y); \ No newline at end of file diff --git a/src/game/minesweeper/ui/CMakeLists.txt b/src/game/minesweeper/ui/CMakeLists.txt deleted file mode 100644 index 8684c52..0000000 --- a/src/game/minesweeper/ui/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (c) 2025 Dominic Masters -# -# This software is released under the MIT License. -# https://opensource.org/licenses/MIT - -# Sources -target_sources(${DUSK_TARGET_NAME} - PRIVATE - ui.c -) - -# Subdirs \ No newline at end of file diff --git a/src/game/minesweeper/ui/ui.c b/src/game/minesweeper/ui/ui.c deleted file mode 100644 index 8dedac6..0000000 --- a/src/game/minesweeper/ui/ui.c +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (c) 2025 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#include "ui.h" -#include "ui/uifps.h" -#include "ui/uiconsole.h" -#include "ui/uiframe.h" -#include "display/screen.h" -#include "display/spritebatch/spritebatch.h" - -#include "display/tileset/tileset_minogram.h" -#include "display/tileset/tileset_ui.h" -#include "display/tileset/tileset_ui_frame.h" -#include "display/tileset/tileset_background.h" - -ui_t UI; - -errorret_t uiInit(void) { - cameraInitOrthographic(&UI.camera); - - UI.minogramTileset = (tileset_t*)&TILESET_MINOGRAM; - errorChain(assetManagerLoadAsset( - UI.minogramTileset->image, - &UI.minogramAsset, - &UI.minogramRef - )); - - UI.uiTileset = (tileset_t*)&TILESET_UI; - errorChain(assetManagerLoadAsset( - UI.uiTileset->image, - &UI.uiAsset, - &UI.uiRef - )); - - UI.frameTileset = (tileset_t*)&TILESET_UI_FRAME; - errorChain(assetManagerLoadAsset( - UI.frameTileset->image, - &UI.frameAsset, - &UI.frameRef - )); - - UI.backgroundTileset = (tileset_t*)&TILESET_BACKGROUND; - errorChain(assetManagerLoadAsset( - UI.backgroundTileset->image, - &UI.backgroundAsset, - &UI.backgroundRef - )); - - errorOk(); -} - -void uiRender(void) { - UI.camera.orthographic.left = 0; - UI.camera.orthographic.right = SCREEN.width; - UI.camera.orthographic.bottom = SCREEN.height; - UI.camera.orthographic.top = 0; - - cameraPushMatrix(&UI.camera); - - uiFPSRender(UI.minogramTileset, &UI.minogramAsset->alphaImage.texture); - uiConsoleRender( - 0, 0, - UI.minogramTileset, &UI.minogramAsset->alphaImage.texture - ); - spriteBatchFlush(); - - cameraPopMatrix(); -} - -void uiDispose(void) { - -} \ No newline at end of file diff --git a/src/game/minesweeper/ui/ui.h b/src/game/minesweeper/ui/ui.h deleted file mode 100644 index 3155032..0000000 --- a/src/game/minesweeper/ui/ui.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (c) 2025 Dominic Masters - * - * This software is released under the MIT License. - * https://opensource.org/licenses/MIT - */ - -#pragma once -#include "dusk.h" -#include "display/camera.h" -#include "asset/assetmanager.h" -#include "display/tileset.h" - -typedef struct { - camera_t camera; - - tileset_t *minogramTileset; - asset_t *minogramAsset; - ref_t minogramRef; - - tileset_t *uiTileset; - asset_t *uiAsset; - ref_t uiRef; - - tileset_t *frameTileset; - asset_t *frameAsset; - ref_t frameRef; - - tileset_t *backgroundTileset; - asset_t *backgroundAsset; - ref_t backgroundRef; -} ui_t; - -extern ui_t UI; - -/** - * Initializes the Minesweeper UI. - * - * @return Error code indicating success or failure. - */ -errorret_t uiInit(void); - -/** - * Renders the Minesweeper UI. - */ -void uiRender(void); - -/** - * Disposes of the Minesweeper UI. - */ -void uiDispose(void); \ No newline at end of file diff --git a/src/scene/scenemanager.c b/src/scene/scenemanager.c index e0c0e7d..b13deb1 100644 --- a/src/scene/scenemanager.c +++ b/src/scene/scenemanager.c @@ -9,7 +9,7 @@ #include "util/memory.h" #include "assert/assert.h" #include "console/console.h" -#include "display/framebuffer/framebuffer.h" +#include "display/framebuffer.h" #include "util/string.h" scenemanager_t SCENE_MANAGER; diff --git a/src/ui/uiconsole.h b/src/ui/uiconsole.h index a1a1260..6232a4d 100644 --- a/src/ui/uiconsole.h +++ b/src/ui/uiconsole.h @@ -6,8 +6,8 @@ */ #pragma once -#include "display/tileset.h" -#include "display/texture/texture.h" +#include "display/tileset/tileset.h" +#include "display/texture.h" /** * Renders the console UI. diff --git a/src/ui/uifps.c b/src/ui/uifps.c index 4978fc5..2f6bb12 100644 --- a/src/ui/uifps.c +++ b/src/ui/uifps.c @@ -10,7 +10,7 @@ #include "console/console.h" #include "util/string.h" #include "ui/uitext.h" -#include "display/framebuffer/framebuffer.h" +#include "display/framebuffer.h" void uiFPSRender(const tileset_t *tileset, texture_t *texture) { if(stringCompare(consoleVarGet("fps")->value, "0") == 0) { diff --git a/src/ui/uifps.h b/src/ui/uifps.h index b2b4654..24823f0 100644 --- a/src/ui/uifps.h +++ b/src/ui/uifps.h @@ -6,8 +6,8 @@ */ #pragma once -#include "display/tileset.h" -#include "display/texture/texture.h" +#include "display/tileset/tileset.h" +#include "display/texture.h" /** * Renders the FPS counter UI. diff --git a/src/ui/uiframe.c b/src/ui/uiframe.c index 80b15dc..d47509d 100644 --- a/src/ui/uiframe.c +++ b/src/ui/uiframe.c @@ -6,7 +6,7 @@ */ #include "uiframe.h" -#include "display/spritebatch/spritebatch.h" +#include "display/spritebatch.h" #include "assert/assert.h" #include diff --git a/src/ui/uiframe.h b/src/ui/uiframe.h index 1a4b82d..2a9e9d0 100644 --- a/src/ui/uiframe.h +++ b/src/ui/uiframe.h @@ -6,8 +6,8 @@ */ #pragma once -#include "display/tileset.h" -#include "display/texture/texture.h" +#include "display/tileset/tileset.h" +#include "display/texture.h" /** * Draw a UI Frame (using the 9-slice technique). diff --git a/src/ui/uitext.c b/src/ui/uitext.c index 3e41067..de062a4 100644 --- a/src/ui/uitext.c +++ b/src/ui/uitext.c @@ -9,7 +9,7 @@ #include "asset/assetmanager.h" #include "assert/assert.h" #include "util/memory.h" -#include "display/spritebatch/spritebatch.h" +#include "display/spritebatch.h" void uiTextDrawChar( const float_t x, diff --git a/tools/assetstool/processtileset.py b/tools/assetstool/processtileset.py index 1e159e8..15570c1 100644 --- a/tools/assetstool/processtileset.py +++ b/tools/assetstool/processtileset.py @@ -124,7 +124,7 @@ def processTileset(asset): # Create header data = f"// Tileset Generated for {asset['path']} at {now}\n" data += f"#pragma once\n" - data += f"#include \"display/tileset.h\"\n\n" + data += f"#include \"display/tileset/tileset.h\"\n\n" data += f"static const tileset_t TILESET_{tilesetNameUpper} = {{\n" data += f" .tileWidth = {tilesetData['tileWidth']},\n" data += f" .tileHeight = {tilesetData['tileHeight']},\n"