diff --git a/.ci/psp/build-psp.sh b/.ci/psp/build-psp.sh deleted file mode 100755 index 0c2ece1..0000000 --- a/.ci/psp/build-psp.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -mkdir -p build-psp -cd build-psp -cmake .. -DDUSK_TARGET_SYSTEM=psp -make -j$(nproc) \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index ab7c886..8025c5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,27 +32,18 @@ set(DUSK_LIBRARY_TARGET_NAME "DuskCore" CACHE INTERNAL ${DUSK_CACHE_TARGET}) set(DUSK_BINARY_TARGET_NAME "Dusk" CACHE INTERNAL ${DUSK_CACHE_TARGET}) set(DUSK_ASSETS_ZIP "${DUSK_BUILD_DIR}/dusk.dsk" CACHE INTERNAL ${DUSK_CACHE_TARGET}) -# Create directories -file(MAKE_DIRECTORY ${DUSK_GENERATED_HEADERS_DIR}) - -# Find packages -find_package(Python3 COMPONENTS Interpreter REQUIRED) - -# Set target system +# Set default target system if(NOT DEFINED DUSK_TARGET_SYSTEM) set(DUSK_TARGET_SYSTEM "linux") - # set(DUSK_TARGET_SYSTEM "psp") endif() -# Toolchains -if(DUSK_TARGET_SYSTEM STREQUAL "psp") - find_package(pspsdk REQUIRED) -endif() +# Create directories +file(MAKE_DIRECTORY ${DUSK_GENERATED_HEADERS_DIR}) +file(MAKE_DIRECTORY ${DUSK_TEMP_DIR}) +file(MAKE_DIRECTORY ${DUSK_BUILT_ASSETS_DIR}) -if(DUSK_TARGET_SYSTEM STREQUAL "gamecube" OR DUSK_TARGET_SYSTEM STREQUAL "wii") - # Override to make library and binary be the same. - set(DUSK_LIBRARY_TARGET_NAME "${DUSK_LIBRARY_TARGET_NAME}.elf" CACHE INTERNAL ${DUSK_CACHE_TARGET}) -endif() +# Required build packages +find_package(Python3 COMPONENTS Interpreter REQUIRED) # Init Project. project(${DUSK_LIBRARY_TARGET_NAME} @@ -76,98 +67,21 @@ if(ENABLE_TESTS) ) else() set(DUSK_LIBRARY_TARGET_NAME "${DUSK_BINARY_TARGET_NAME}" CACHE INTERNAL ${DUSK_CACHE_TARGET}) - add_executable(${DUSK_BINARY_TARGET_NAME} ${DUSK_SOURCES_DIR}/null.c) + add_executable(${DUSK_BINARY_TARGET_NAME} ${DUSK_SOURCES_DIR}/dusk/null.c) endif() +# Toolchains +include(cmake/targets/${DUSK_TARGET_SYSTEM}.cmake) + # Add tools add_subdirectory(tools) -# Assets -# add_subdirectory(assets) +# Include generated headers from tools. +target_include_directories(${DUSK_LIBRARY_TARGET_NAME} PUBLIC + ${DUSK_GENERATED_HEADERS_DIR} +) -# Add libraries -if(DUSK_TARGET_SYSTEM STREQUAL "linux") - find_package(SDL2 REQUIRED) - find_package(OpenGL REQUIRED) - target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC - SDL2 - pthread - OpenGL::GL - GL - m - ) - -elseif(DUSK_TARGET_SYSTEM STREQUAL "psp") - find_package(SDL2 REQUIRED) - find_package(OpenGL REQUIRED) - target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC - ${SDL2_LIBRARIES} - SDL2 - pthread - OpenGL::GL - zip - bz2 - z - mbedtls - mbedcrypto - lzma - m - ) - target_include_directories(${DUSK_LIBRARY_TARGET_NAME} PRIVATE - ${SDL2_INCLUDE_DIRS} - ) - -elseif(DUSK_TARGET_SYSTEM STREQUAL "gamecube" OR DUSK_TARGET_SYSTEM STREQUAL "wii") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions") - # configure_file(opengl.pc.in opengl.pc @ONLY) - find_package(PkgConfig REQUIRED) - pkg_check_modules(zip IMPORTED_TARGET libzip) - target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC - DOLPHIN - ) - - # Disable all warnings - target_compile_options(${DUSK_LIBRARY_TARGET_NAME} PRIVATE -w) - - # Custom flags for cglm - set(CGLM_SHARED OFF CACHE BOOL "Build cglm shared" FORCE) - set(CGLM_STATIC ON CACHE BOOL "Build cglm static" FORCE) - find_package(cglm REQUIRED) - - # Compile lua - include(FetchContent) - FetchContent_Declare( - liblua - URL https://www.lua.org/ftp/lua-5.5.0.tar.gz - ) - FetchContent_MakeAvailable(liblua) - set(LUA_SRC_DIR "${liblua_SOURCE_DIR}/src") - set(LUA_C_FILES - lapi.c lauxlib.c lbaselib.c lcode.c lcorolib.c lctype.c ldblib.c ldebug.c - ldo.c ldump.c lfunc.c lgc.c linit.c liolib.c llex.c lmathlib.c lmem.c - loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c - lstrlib.c ltable.c ltablib.c ltm.c lundump.c lutf8lib.c lvm.c lzio.c - ) - list(TRANSFORM LUA_C_FILES PREPEND "${LUA_SRC_DIR}/") - add_library(liblua STATIC ${LUA_C_FILES}) - target_include_directories(liblua PUBLIC "${LUA_SRC_DIR}") - target_compile_definitions(liblua PRIVATE LUA_USE_C89) - add_library(lua::lua ALIAS liblua) - set(Lua_FOUND TRUE CACHE BOOL "Lua found" FORCE) - - target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PRIVATE - cglm - liblua - m - fat - PkgConfig::zip - ) -endif() - -# Force turn tests off for now -set(ENABLE_TESTS OFF CACHE BOOL "Enable tests" FORCE) - -# Add code +# Add main code add_subdirectory(${DUSK_SOURCES_DIR}) # Handle tests @@ -188,30 +102,4 @@ add_custom_command( VERBATIM ) add_custom_target(DUSK_ASSETS_BUILT DEPENDS "${DUSK_ASSETS_ZIP}") -add_dependencies(${DUSK_LIBRARY_TARGET_NAME} DUSK_ASSETS_BUILT) - -# Include generated headers -target_include_directories(${DUSK_LIBRARY_TARGET_NAME} PUBLIC - ${DUSK_GENERATED_HEADERS_DIR} -) - -# Postbuild -if(DUSK_TARGET_SYSTEM STREQUAL "psp") - create_pbp_file( - TARGET "${DUSK_BINARY_TARGET_NAME}" - ICON_PATH NULL - BACKGROUND_PATH NULL - PREVIEW_PATH NULL - TITLE "${DUSK_BINARY_TARGET_NAME}" - PSAR_PATH ${DUSK_ASSETS_ZIP} - VERSION 01.00 - ) -elseif(DUSK_TARGET_SYSTEM STREQUAL "gamecube" OR DUSK_TARGET_SYSTEM STREQUAL "wii") - set(DUSK_BINARY_TARGET_NAME_DOL "${DUSK_BUILD_DIR}/Dusk.dol") - add_custom_command(TARGET ${DUSK_BINARY_TARGET_NAME} POST_BUILD - COMMAND elf2dol - "$" - "${DUSK_BINARY_TARGET_NAME_DOL}" - COMMENT "Generating ${DUSK_BINARY_TARGET_NAME_DOL} from ${DUSK_BINARY_TARGET_NAME}" - ) -endif() +add_dependencies(${DUSK_LIBRARY_TARGET_NAME} DUSK_ASSETS_BUILT) \ No newline at end of file diff --git a/archive/src/CMakeLists.txt b/archive/src/CMakeLists.txt new file mode 100644 index 0000000..13db8e7 --- /dev/null +++ b/archive/src/CMakeLists.txt @@ -0,0 +1,74 @@ +# Copyright (c) 2025 Dominic Masters +# +# This software is released under the MIT License. +# https://opensource.org/licenses/MIT + +if(NOT cglm_FOUND) + find_package(cglm REQUIRED) + target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC cglm) +endif() + +if(NOT libzip_FOUND) + find_package(libzip REQUIRED) + target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC zip) +endif() + +if(NOT Lua_FOUND) + find_package(Lua REQUIRED) + if(Lua_FOUND AND NOT TARGET Lua::Lua) + add_library(Lua::Lua INTERFACE IMPORTED) + set_target_properties( + Lua::Lua + PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${LUA_LIBRARIES}" + ) + endif() + target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC Lua::Lua) +endif() + +# Libs + +# Includes +target_include_directories(${DUSK_LIBRARY_TARGET_NAME} + PUBLIC + ${CMAKE_CURRENT_LIST_DIR} +) + +# Sources + +# Main Binary Source +target_sources(${DUSK_BINARY_TARGET_NAME} + PUBLIC + main.c +) + +# Defs +dusk_env_to_h(duskdefs.env duskdefs.h) +target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} + PUBLIC + DUSK_TARGET_SYSTEM="${DUSK_TARGET_SYSTEM}" +) + +# Subdirs +add_subdirectory(assert) +add_subdirectory(asset) +add_subdirectory(debug) +add_subdirectory(display) +add_subdirectory(engine) +add_subdirectory(error) +add_subdirectory(event) +add_subdirectory(input) +add_subdirectory(item) +add_subdirectory(locale) +add_subdirectory(map) +add_subdirectory(scene) +add_subdirectory(script) +add_subdirectory(story) +add_subdirectory(time) +add_subdirectory(ui) +add_subdirectory(util) + +if(DUSK_TARGET_SYSTEM STREQUAL "linux" OR DUSK_TARGET_SYSTEM STREQUAL "psp") + add_subdirectory(thread) +endif() \ No newline at end of file diff --git a/src/assert/CMakeLists.txt b/archive/src/assert/CMakeLists.txt similarity index 100% rename from src/assert/CMakeLists.txt rename to archive/src/assert/CMakeLists.txt diff --git a/src/assert/assert.c b/archive/src/assert/assert.c similarity index 100% rename from src/assert/assert.c rename to archive/src/assert/assert.c diff --git a/src/assert/assert.h b/archive/src/assert/assert.h similarity index 100% rename from src/assert/assert.h rename to archive/src/assert/assert.h diff --git a/src/asset/CMakeLists.txt b/archive/src/asset/CMakeLists.txt similarity index 100% rename from src/asset/CMakeLists.txt rename to archive/src/asset/CMakeLists.txt diff --git a/src/asset/asset.c b/archive/src/asset/asset.c similarity index 100% rename from src/asset/asset.c rename to archive/src/asset/asset.c diff --git a/src/asset/asset.h b/archive/src/asset/asset.h similarity index 100% rename from src/asset/asset.h rename to archive/src/asset/asset.h diff --git a/src/asset/assettype.h b/archive/src/asset/assettype.h similarity index 100% rename from src/asset/assettype.h rename to archive/src/asset/assettype.h diff --git a/src/asset/type/CMakeLists.txt b/archive/src/asset/type/CMakeLists.txt similarity index 100% rename from src/asset/type/CMakeLists.txt rename to archive/src/asset/type/CMakeLists.txt diff --git a/src/asset/type/assetlanguage.c b/archive/src/asset/type/assetlanguage.c similarity index 100% rename from src/asset/type/assetlanguage.c rename to archive/src/asset/type/assetlanguage.c diff --git a/src/asset/type/assetlanguage.h b/archive/src/asset/type/assetlanguage.h similarity index 100% rename from src/asset/type/assetlanguage.h rename to archive/src/asset/type/assetlanguage.h diff --git a/src/asset/type/assetmap.c b/archive/src/asset/type/assetmap.c similarity index 100% rename from src/asset/type/assetmap.c rename to archive/src/asset/type/assetmap.c diff --git a/src/asset/type/assetmap.h b/archive/src/asset/type/assetmap.h similarity index 100% rename from src/asset/type/assetmap.h rename to archive/src/asset/type/assetmap.h diff --git a/src/asset/type/assetmapchunk.c b/archive/src/asset/type/assetmapchunk.c similarity index 100% rename from src/asset/type/assetmapchunk.c rename to archive/src/asset/type/assetmapchunk.c diff --git a/src/asset/type/assetmapchunk.h b/archive/src/asset/type/assetmapchunk.h similarity index 100% rename from src/asset/type/assetmapchunk.h rename to archive/src/asset/type/assetmapchunk.h diff --git a/src/asset/type/assetpalette.c b/archive/src/asset/type/assetpalette.c similarity index 100% rename from src/asset/type/assetpalette.c rename to archive/src/asset/type/assetpalette.c diff --git a/src/asset/type/assetpalette.h b/archive/src/asset/type/assetpalette.h similarity index 100% rename from src/asset/type/assetpalette.h rename to archive/src/asset/type/assetpalette.h diff --git a/src/asset/type/assetscript.c b/archive/src/asset/type/assetscript.c similarity index 100% rename from src/asset/type/assetscript.c rename to archive/src/asset/type/assetscript.c diff --git a/src/asset/type/assetscript.h b/archive/src/asset/type/assetscript.h similarity index 100% rename from src/asset/type/assetscript.h rename to archive/src/asset/type/assetscript.h diff --git a/src/asset/type/assettexture.c b/archive/src/asset/type/assettexture.c similarity index 100% rename from src/asset/type/assettexture.c rename to archive/src/asset/type/assettexture.c diff --git a/src/asset/type/assettexture.h b/archive/src/asset/type/assettexture.h similarity index 100% rename from src/asset/type/assettexture.h rename to archive/src/asset/type/assettexture.h diff --git a/src/asset/type/assettileset.c b/archive/src/asset/type/assettileset.c similarity index 100% rename from src/asset/type/assettileset.c rename to archive/src/asset/type/assettileset.c diff --git a/src/asset/type/assettileset.h b/archive/src/asset/type/assettileset.h similarity index 100% rename from src/asset/type/assettileset.h rename to archive/src/asset/type/assettileset.h diff --git a/src/debug/CMakeLists.txt b/archive/src/debug/CMakeLists.txt similarity index 100% rename from src/debug/CMakeLists.txt rename to archive/src/debug/CMakeLists.txt diff --git a/src/debug/debug.c b/archive/src/debug/debug.c similarity index 100% rename from src/debug/debug.c rename to archive/src/debug/debug.c diff --git a/src/debug/debug.h b/archive/src/debug/debug.h similarity index 100% rename from src/debug/debug.h rename to archive/src/debug/debug.h diff --git a/src/display/CMakeLists.txt b/archive/src/display/CMakeLists.txt similarity index 100% rename from src/display/CMakeLists.txt rename to archive/src/display/CMakeLists.txt diff --git a/src/display/camera/CMakeLists.txt b/archive/src/display/camera/CMakeLists.txt similarity index 100% rename from src/display/camera/CMakeLists.txt rename to archive/src/display/camera/CMakeLists.txt diff --git a/src/display/camera/camera.c b/archive/src/display/camera/camera.c similarity index 100% rename from src/display/camera/camera.c rename to archive/src/display/camera/camera.c diff --git a/src/display/camera/camera.h b/archive/src/display/camera/camera.h similarity index 100% rename from src/display/camera/camera.h rename to archive/src/display/camera/camera.h diff --git a/src/display/color.csv b/archive/src/display/color.csv similarity index 100% rename from src/display/color.csv rename to archive/src/display/color.csv diff --git a/src/display/display.c b/archive/src/display/display.c similarity index 100% rename from src/display/display.c rename to archive/src/display/display.c diff --git a/src/display/display.h b/archive/src/display/display.h similarity index 100% rename from src/display/display.h rename to archive/src/display/display.h diff --git a/src/display/displaydefs.h b/archive/src/display/displaydefs.h similarity index 100% rename from src/display/displaydefs.h rename to archive/src/display/displaydefs.h diff --git a/src/display/framebuffer.c b/archive/src/display/framebuffer.c similarity index 100% rename from src/display/framebuffer.c rename to archive/src/display/framebuffer.c diff --git a/src/display/framebuffer.h b/archive/src/display/framebuffer.h similarity index 100% rename from src/display/framebuffer.h rename to archive/src/display/framebuffer.h diff --git a/src/display/mesh/CMakeLists.txt b/archive/src/display/mesh/CMakeLists.txt similarity index 100% rename from src/display/mesh/CMakeLists.txt rename to archive/src/display/mesh/CMakeLists.txt diff --git a/src/display/mesh/mesh.c b/archive/src/display/mesh/mesh.c similarity index 100% rename from src/display/mesh/mesh.c rename to archive/src/display/mesh/mesh.c diff --git a/src/display/mesh/mesh.h b/archive/src/display/mesh/mesh.h similarity index 100% rename from src/display/mesh/mesh.h rename to archive/src/display/mesh/mesh.h diff --git a/src/display/mesh/quad.c b/archive/src/display/mesh/quad.c similarity index 100% rename from src/display/mesh/quad.c rename to archive/src/display/mesh/quad.c diff --git a/src/display/mesh/quad.h b/archive/src/display/mesh/quad.h similarity index 100% rename from src/display/mesh/quad.h rename to archive/src/display/mesh/quad.h diff --git a/src/display/palette/CMakeLists.txt b/archive/src/display/palette/CMakeLists.txt similarity index 100% rename from src/display/palette/CMakeLists.txt rename to archive/src/display/palette/CMakeLists.txt diff --git a/src/display/palette/palette.c b/archive/src/display/palette/palette.c similarity index 100% rename from src/display/palette/palette.c rename to archive/src/display/palette/palette.c diff --git a/src/display/palette/palette.h b/archive/src/display/palette/palette.h similarity index 100% rename from src/display/palette/palette.h rename to archive/src/display/palette/palette.h diff --git a/src/display/screen.c b/archive/src/display/screen.c similarity index 100% rename from src/display/screen.c rename to archive/src/display/screen.c diff --git a/src/display/screen.h b/archive/src/display/screen.h similarity index 100% rename from src/display/screen.h rename to archive/src/display/screen.h diff --git a/src/display/spritebatch.c b/archive/src/display/spritebatch.c similarity index 100% rename from src/display/spritebatch.c rename to archive/src/display/spritebatch.c diff --git a/src/display/spritebatch.h b/archive/src/display/spritebatch.h similarity index 100% rename from src/display/spritebatch.h rename to archive/src/display/spritebatch.h diff --git a/src/display/text.c b/archive/src/display/text.c similarity index 100% rename from src/display/text.c rename to archive/src/display/text.c diff --git a/src/display/text.h b/archive/src/display/text.h similarity index 100% rename from src/display/text.h rename to archive/src/display/text.h diff --git a/src/display/texture.c b/archive/src/display/texture.c similarity index 100% rename from src/display/texture.c rename to archive/src/display/texture.c diff --git a/src/display/texture.h b/archive/src/display/texture.h similarity index 100% rename from src/display/texture.h rename to archive/src/display/texture.h diff --git a/src/display/tileset/CMakeLists.txt b/archive/src/display/tileset/CMakeLists.txt similarity index 100% rename from src/display/tileset/CMakeLists.txt rename to archive/src/display/tileset/CMakeLists.txt diff --git a/src/display/tileset/tileset.c b/archive/src/display/tileset/tileset.c similarity index 100% rename from src/display/tileset/tileset.c rename to archive/src/display/tileset/tileset.c diff --git a/src/display/tileset/tileset.h b/archive/src/display/tileset/tileset.h similarity index 100% rename from src/display/tileset/tileset.h rename to archive/src/display/tileset/tileset.h diff --git a/src/dusk.h b/archive/src/dusk.h similarity index 100% rename from src/dusk.h rename to archive/src/dusk.h diff --git a/src/duskdefs.env b/archive/src/duskdefs.env similarity index 100% rename from src/duskdefs.env rename to archive/src/duskdefs.env diff --git a/src/engine/CMakeLists.txt b/archive/src/engine/CMakeLists.txt similarity index 100% rename from src/engine/CMakeLists.txt rename to archive/src/engine/CMakeLists.txt diff --git a/src/engine/engine.c b/archive/src/engine/engine.c similarity index 100% rename from src/engine/engine.c rename to archive/src/engine/engine.c diff --git a/src/engine/engine.h b/archive/src/engine/engine.h similarity index 100% rename from src/engine/engine.h rename to archive/src/engine/engine.h diff --git a/src/error/CMakeLists.txt b/archive/src/error/CMakeLists.txt similarity index 100% rename from src/error/CMakeLists.txt rename to archive/src/error/CMakeLists.txt diff --git a/src/error/error.c b/archive/src/error/error.c similarity index 100% rename from src/error/error.c rename to archive/src/error/error.c diff --git a/src/error/error.h b/archive/src/error/error.h similarity index 100% rename from src/error/error.h rename to archive/src/error/error.h diff --git a/src/event/CMakeLists.txt b/archive/src/event/CMakeLists.txt similarity index 100% rename from src/event/CMakeLists.txt rename to archive/src/event/CMakeLists.txt diff --git a/src/event/event.c b/archive/src/event/event.c similarity index 100% rename from src/event/event.c rename to archive/src/event/event.c diff --git a/src/event/event.h b/archive/src/event/event.h similarity index 100% rename from src/event/event.h rename to archive/src/event/event.h diff --git a/src/event/eventcallback.h b/archive/src/event/eventcallback.h similarity index 100% rename from src/event/eventcallback.h rename to archive/src/event/eventcallback.h diff --git a/src/event/eventuser.h b/archive/src/event/eventuser.h similarity index 100% rename from src/event/eventuser.h rename to archive/src/event/eventuser.h diff --git a/src/input/CMakeLists.txt b/archive/src/input/CMakeLists.txt similarity index 100% rename from src/input/CMakeLists.txt rename to archive/src/input/CMakeLists.txt diff --git a/src/input/input.c b/archive/src/input/input.c similarity index 100% rename from src/input/input.c rename to archive/src/input/input.c diff --git a/src/input/input.csv b/archive/src/input/input.csv similarity index 100% rename from src/input/input.csv rename to archive/src/input/input.csv diff --git a/src/input/input.h b/archive/src/input/input.h similarity index 100% rename from src/input/input.h rename to archive/src/input/input.h diff --git a/src/input/inputaction.c b/archive/src/input/inputaction.c similarity index 100% rename from src/input/inputaction.c rename to archive/src/input/inputaction.c diff --git a/src/input/inputaction.h b/archive/src/input/inputaction.h similarity index 100% rename from src/input/inputaction.h rename to archive/src/input/inputaction.h diff --git a/src/input/inputbutton.c b/archive/src/input/inputbutton.c similarity index 100% rename from src/input/inputbutton.c rename to archive/src/input/inputbutton.c diff --git a/src/input/inputbutton.h b/archive/src/input/inputbutton.h similarity index 100% rename from src/input/inputbutton.h rename to archive/src/input/inputbutton.h diff --git a/src/item/CMakeLists.txt b/archive/src/item/CMakeLists.txt similarity index 100% rename from src/item/CMakeLists.txt rename to archive/src/item/CMakeLists.txt diff --git a/src/item/backpack.c b/archive/src/item/backpack.c similarity index 100% rename from src/item/backpack.c rename to archive/src/item/backpack.c diff --git a/src/item/backpack.h b/archive/src/item/backpack.h similarity index 100% rename from src/item/backpack.h rename to archive/src/item/backpack.h diff --git a/src/item/inventory.c b/archive/src/item/inventory.c similarity index 100% rename from src/item/inventory.c rename to archive/src/item/inventory.c diff --git a/src/item/inventory.h b/archive/src/item/inventory.h similarity index 100% rename from src/item/inventory.h rename to archive/src/item/inventory.h diff --git a/src/item/item.csv b/archive/src/item/item.csv similarity index 100% rename from src/item/item.csv rename to archive/src/item/item.csv diff --git a/src/locale/CMakeLists.txt b/archive/src/locale/CMakeLists.txt similarity index 100% rename from src/locale/CMakeLists.txt rename to archive/src/locale/CMakeLists.txt diff --git a/src/locale/locale.h b/archive/src/locale/locale.h similarity index 100% rename from src/locale/locale.h rename to archive/src/locale/locale.h diff --git a/src/locale/localeinfo.h b/archive/src/locale/localeinfo.h similarity index 100% rename from src/locale/localeinfo.h rename to archive/src/locale/localeinfo.h diff --git a/src/locale/localemanager.c b/archive/src/locale/localemanager.c similarity index 100% rename from src/locale/localemanager.c rename to archive/src/locale/localemanager.c diff --git a/src/locale/localemanager.h b/archive/src/locale/localemanager.h similarity index 100% rename from src/locale/localemanager.h rename to archive/src/locale/localemanager.h diff --git a/src/main.c b/archive/src/main.c similarity index 100% rename from src/main.c rename to archive/src/main.c diff --git a/src/map/CMakeLists.txt b/archive/src/map/CMakeLists.txt similarity index 100% rename from src/map/CMakeLists.txt rename to archive/src/map/CMakeLists.txt diff --git a/src/map/map.c b/archive/src/map/map.c similarity index 100% rename from src/map/map.c rename to archive/src/map/map.c diff --git a/src/map/map.h b/archive/src/map/map.h similarity index 100% rename from src/map/map.h rename to archive/src/map/map.h diff --git a/src/map/mapchunk.c b/archive/src/map/mapchunk.c similarity index 100% rename from src/map/mapchunk.c rename to archive/src/map/mapchunk.c diff --git a/src/map/mapchunk.h b/archive/src/map/mapchunk.h similarity index 100% rename from src/map/mapchunk.h rename to archive/src/map/mapchunk.h diff --git a/src/map/maptile.c b/archive/src/map/maptile.c similarity index 100% rename from src/map/maptile.c rename to archive/src/map/maptile.c diff --git a/src/map/maptile.h b/archive/src/map/maptile.h similarity index 100% rename from src/map/maptile.h rename to archive/src/map/maptile.h diff --git a/src/map/worldpos.c b/archive/src/map/worldpos.c similarity index 100% rename from src/map/worldpos.c rename to archive/src/map/worldpos.c diff --git a/src/map/worldpos.h b/archive/src/map/worldpos.h similarity index 100% rename from src/map/worldpos.h rename to archive/src/map/worldpos.h diff --git a/src/null.c b/archive/src/null.c similarity index 100% rename from src/null.c rename to archive/src/null.c diff --git a/src/scene/CMakeLists.txt b/archive/src/scene/CMakeLists.txt similarity index 100% rename from src/scene/CMakeLists.txt rename to archive/src/scene/CMakeLists.txt diff --git a/src/scene/scene.c b/archive/src/scene/scene.c similarity index 100% rename from src/scene/scene.c rename to archive/src/scene/scene.c diff --git a/src/scene/scene.h b/archive/src/scene/scene.h similarity index 100% rename from src/scene/scene.h rename to archive/src/scene/scene.h diff --git a/src/script/CMakeLists.txt b/archive/src/script/CMakeLists.txt similarity index 100% rename from src/script/CMakeLists.txt rename to archive/src/script/CMakeLists.txt diff --git a/src/script/module/CMakeLists.txt b/archive/src/script/module/CMakeLists.txt similarity index 100% rename from src/script/module/CMakeLists.txt rename to archive/src/script/module/CMakeLists.txt diff --git a/src/script/module/display/CMakeLists.txt b/archive/src/script/module/display/CMakeLists.txt similarity index 100% rename from src/script/module/display/CMakeLists.txt rename to archive/src/script/module/display/CMakeLists.txt diff --git a/src/script/module/display/modulecamera.c b/archive/src/script/module/display/modulecamera.c similarity index 100% rename from src/script/module/display/modulecamera.c rename to archive/src/script/module/display/modulecamera.c diff --git a/src/script/module/display/modulecamera.h b/archive/src/script/module/display/modulecamera.h similarity index 100% rename from src/script/module/display/modulecamera.h rename to archive/src/script/module/display/modulecamera.h diff --git a/src/script/module/display/modulecolor.c b/archive/src/script/module/display/modulecolor.c similarity index 100% rename from src/script/module/display/modulecolor.c rename to archive/src/script/module/display/modulecolor.c diff --git a/src/script/module/display/modulecolor.h b/archive/src/script/module/display/modulecolor.h similarity index 100% rename from src/script/module/display/modulecolor.h rename to archive/src/script/module/display/modulecolor.h diff --git a/src/script/module/display/moduleglm.c b/archive/src/script/module/display/moduleglm.c similarity index 100% rename from src/script/module/display/moduleglm.c rename to archive/src/script/module/display/moduleglm.c diff --git a/src/script/module/display/moduleglm.h b/archive/src/script/module/display/moduleglm.h similarity index 100% rename from src/script/module/display/moduleglm.h rename to archive/src/script/module/display/moduleglm.h diff --git a/src/script/module/display/modulescreen.c b/archive/src/script/module/display/modulescreen.c similarity index 100% rename from src/script/module/display/modulescreen.c rename to archive/src/script/module/display/modulescreen.c diff --git a/src/script/module/display/modulescreen.h b/archive/src/script/module/display/modulescreen.h similarity index 100% rename from src/script/module/display/modulescreen.h rename to archive/src/script/module/display/modulescreen.h diff --git a/src/script/module/display/modulespritebatch.c b/archive/src/script/module/display/modulespritebatch.c similarity index 100% rename from src/script/module/display/modulespritebatch.c rename to archive/src/script/module/display/modulespritebatch.c diff --git a/src/script/module/display/modulespritebatch.h b/archive/src/script/module/display/modulespritebatch.h similarity index 100% rename from src/script/module/display/modulespritebatch.h rename to archive/src/script/module/display/modulespritebatch.h diff --git a/src/script/module/display/moduletext.c b/archive/src/script/module/display/moduletext.c similarity index 100% rename from src/script/module/display/moduletext.c rename to archive/src/script/module/display/moduletext.c diff --git a/src/script/module/display/moduletext.h b/archive/src/script/module/display/moduletext.h similarity index 100% rename from src/script/module/display/moduletext.h rename to archive/src/script/module/display/moduletext.h diff --git a/src/script/module/display/moduletexture.c b/archive/src/script/module/display/moduletexture.c similarity index 100% rename from src/script/module/display/moduletexture.c rename to archive/src/script/module/display/moduletexture.c diff --git a/src/script/module/display/moduletexture.h b/archive/src/script/module/display/moduletexture.h similarity index 100% rename from src/script/module/display/moduletexture.h rename to archive/src/script/module/display/moduletexture.h diff --git a/src/script/module/display/moduletileset.c b/archive/src/script/module/display/moduletileset.c similarity index 100% rename from src/script/module/display/moduletileset.c rename to archive/src/script/module/display/moduletileset.c diff --git a/src/script/module/display/moduletileset.h b/archive/src/script/module/display/moduletileset.h similarity index 100% rename from src/script/module/display/moduletileset.h rename to archive/src/script/module/display/moduletileset.h diff --git a/src/script/module/event/CMakeLists.txt b/archive/src/script/module/event/CMakeLists.txt similarity index 100% rename from src/script/module/event/CMakeLists.txt rename to archive/src/script/module/event/CMakeLists.txt diff --git a/src/script/module/event/moduleevent.c b/archive/src/script/module/event/moduleevent.c similarity index 100% rename from src/script/module/event/moduleevent.c rename to archive/src/script/module/event/moduleevent.c diff --git a/src/script/module/event/moduleevent.h b/archive/src/script/module/event/moduleevent.h similarity index 100% rename from src/script/module/event/moduleevent.h rename to archive/src/script/module/event/moduleevent.h diff --git a/src/script/module/input/CMakeLists.txt b/archive/src/script/module/input/CMakeLists.txt similarity index 100% rename from src/script/module/input/CMakeLists.txt rename to archive/src/script/module/input/CMakeLists.txt diff --git a/src/script/module/input/moduleinput.c b/archive/src/script/module/input/moduleinput.c similarity index 100% rename from src/script/module/input/moduleinput.c rename to archive/src/script/module/input/moduleinput.c diff --git a/src/script/module/input/moduleinput.h b/archive/src/script/module/input/moduleinput.h similarity index 100% rename from src/script/module/input/moduleinput.h rename to archive/src/script/module/input/moduleinput.h diff --git a/src/script/module/item/CMakeLists.txt b/archive/src/script/module/item/CMakeLists.txt similarity index 100% rename from src/script/module/item/CMakeLists.txt rename to archive/src/script/module/item/CMakeLists.txt diff --git a/src/script/module/item/moduleitem.c b/archive/src/script/module/item/moduleitem.c similarity index 100% rename from src/script/module/item/moduleitem.c rename to archive/src/script/module/item/moduleitem.c diff --git a/src/script/module/item/moduleitem.h b/archive/src/script/module/item/moduleitem.h similarity index 100% rename from src/script/module/item/moduleitem.h rename to archive/src/script/module/item/moduleitem.h diff --git a/src/script/module/locale/CMakeLists.txt b/archive/src/script/module/locale/CMakeLists.txt similarity index 100% rename from src/script/module/locale/CMakeLists.txt rename to archive/src/script/module/locale/CMakeLists.txt diff --git a/src/script/module/locale/modulelocale.c b/archive/src/script/module/locale/modulelocale.c similarity index 100% rename from src/script/module/locale/modulelocale.c rename to archive/src/script/module/locale/modulelocale.c diff --git a/src/script/module/locale/modulelocale.h b/archive/src/script/module/locale/modulelocale.h similarity index 100% rename from src/script/module/locale/modulelocale.h rename to archive/src/script/module/locale/modulelocale.h diff --git a/src/script/module/map/CMakeLists.txt b/archive/src/script/module/map/CMakeLists.txt similarity index 100% rename from src/script/module/map/CMakeLists.txt rename to archive/src/script/module/map/CMakeLists.txt diff --git a/src/script/module/map/modulemap.c b/archive/src/script/module/map/modulemap.c similarity index 100% rename from src/script/module/map/modulemap.c rename to archive/src/script/module/map/modulemap.c diff --git a/src/script/module/map/modulemap.h b/archive/src/script/module/map/modulemap.h similarity index 100% rename from src/script/module/map/modulemap.h rename to archive/src/script/module/map/modulemap.h diff --git a/src/script/module/moduleplatform.h b/archive/src/script/module/moduleplatform.h similarity index 100% rename from src/script/module/moduleplatform.h rename to archive/src/script/module/moduleplatform.h diff --git a/src/script/module/scene/CMakeLists.txt b/archive/src/script/module/scene/CMakeLists.txt similarity index 100% rename from src/script/module/scene/CMakeLists.txt rename to archive/src/script/module/scene/CMakeLists.txt diff --git a/src/script/module/scene/modulescene.c b/archive/src/script/module/scene/modulescene.c similarity index 100% rename from src/script/module/scene/modulescene.c rename to archive/src/script/module/scene/modulescene.c diff --git a/src/script/module/scene/modulescene.h b/archive/src/script/module/scene/modulescene.h similarity index 100% rename from src/script/module/scene/modulescene.h rename to archive/src/script/module/scene/modulescene.h diff --git a/src/script/module/story/CMakeLists.txt b/archive/src/script/module/story/CMakeLists.txt similarity index 100% rename from src/script/module/story/CMakeLists.txt rename to archive/src/script/module/story/CMakeLists.txt diff --git a/src/script/module/story/modulestoryflag.c b/archive/src/script/module/story/modulestoryflag.c similarity index 100% rename from src/script/module/story/modulestoryflag.c rename to archive/src/script/module/story/modulestoryflag.c diff --git a/src/script/module/story/modulestoryflag.h b/archive/src/script/module/story/modulestoryflag.h similarity index 100% rename from src/script/module/story/modulestoryflag.h rename to archive/src/script/module/story/modulestoryflag.h diff --git a/src/script/module/system/CMakeLists.txt b/archive/src/script/module/system/CMakeLists.txt similarity index 100% rename from src/script/module/system/CMakeLists.txt rename to archive/src/script/module/system/CMakeLists.txt diff --git a/src/script/module/system/modulesystem.c b/archive/src/script/module/system/modulesystem.c similarity index 100% rename from src/script/module/system/modulesystem.c rename to archive/src/script/module/system/modulesystem.c diff --git a/src/script/module/system/modulesystem.h b/archive/src/script/module/system/modulesystem.h similarity index 100% rename from src/script/module/system/modulesystem.h rename to archive/src/script/module/system/modulesystem.h diff --git a/src/script/module/time/CMakeLists.txt b/archive/src/script/module/time/CMakeLists.txt similarity index 100% rename from src/script/module/time/CMakeLists.txt rename to archive/src/script/module/time/CMakeLists.txt diff --git a/src/script/module/time/moduletime.c b/archive/src/script/module/time/moduletime.c similarity index 100% rename from src/script/module/time/moduletime.c rename to archive/src/script/module/time/moduletime.c diff --git a/src/script/module/time/moduletime.h b/archive/src/script/module/time/moduletime.h similarity index 100% rename from src/script/module/time/moduletime.h rename to archive/src/script/module/time/moduletime.h diff --git a/src/script/module/ui/CMakeLists.txt b/archive/src/script/module/ui/CMakeLists.txt similarity index 100% rename from src/script/module/ui/CMakeLists.txt rename to archive/src/script/module/ui/CMakeLists.txt diff --git a/src/script/module/ui/moduleui.c b/archive/src/script/module/ui/moduleui.c similarity index 100% rename from src/script/module/ui/moduleui.c rename to archive/src/script/module/ui/moduleui.c diff --git a/src/script/module/ui/moduleui.h b/archive/src/script/module/ui/moduleui.h similarity index 100% rename from src/script/module/ui/moduleui.h rename to archive/src/script/module/ui/moduleui.h diff --git a/src/script/scriptcontext.c b/archive/src/script/scriptcontext.c similarity index 100% rename from src/script/scriptcontext.c rename to archive/src/script/scriptcontext.c diff --git a/src/script/scriptcontext.h b/archive/src/script/scriptcontext.h similarity index 100% rename from src/script/scriptcontext.h rename to archive/src/script/scriptcontext.h diff --git a/src/script/scriptmanager.c b/archive/src/script/scriptmanager.c similarity index 100% rename from src/script/scriptmanager.c rename to archive/src/script/scriptmanager.c diff --git a/src/script/scriptmanager.h b/archive/src/script/scriptmanager.h similarity index 100% rename from src/script/scriptmanager.h rename to archive/src/script/scriptmanager.h diff --git a/src/script/scriptmodule.c b/archive/src/script/scriptmodule.c similarity index 100% rename from src/script/scriptmodule.c rename to archive/src/script/scriptmodule.c diff --git a/src/script/scriptmodule.h b/archive/src/script/scriptmodule.h similarity index 100% rename from src/script/scriptmodule.h rename to archive/src/script/scriptmodule.h diff --git a/src/script/scriptvalue.h b/archive/src/script/scriptvalue.h similarity index 100% rename from src/script/scriptvalue.h rename to archive/src/script/scriptvalue.h diff --git a/src/story/CMakeLists.txt b/archive/src/story/CMakeLists.txt similarity index 100% rename from src/story/CMakeLists.txt rename to archive/src/story/CMakeLists.txt diff --git a/src/story/storyflag.c b/archive/src/story/storyflag.c similarity index 100% rename from src/story/storyflag.c rename to archive/src/story/storyflag.c diff --git a/src/story/storyflag.csv b/archive/src/story/storyflag.csv similarity index 100% rename from src/story/storyflag.csv rename to archive/src/story/storyflag.csv diff --git a/src/story/storyflag.h b/archive/src/story/storyflag.h similarity index 100% rename from src/story/storyflag.h rename to archive/src/story/storyflag.h diff --git a/src/story/storyflagdefs.h b/archive/src/story/storyflagdefs.h similarity index 100% rename from src/story/storyflagdefs.h rename to archive/src/story/storyflagdefs.h diff --git a/src/thread/CMakeLists.txt b/archive/src/thread/CMakeLists.txt similarity index 100% rename from src/thread/CMakeLists.txt rename to archive/src/thread/CMakeLists.txt diff --git a/src/thread/thread.c b/archive/src/thread/thread.c similarity index 100% rename from src/thread/thread.c rename to archive/src/thread/thread.c diff --git a/src/thread/thread.h b/archive/src/thread/thread.h similarity index 100% rename from src/thread/thread.h rename to archive/src/thread/thread.h diff --git a/src/thread/threadmutex.c b/archive/src/thread/threadmutex.c similarity index 100% rename from src/thread/threadmutex.c rename to archive/src/thread/threadmutex.c diff --git a/src/thread/threadmutex.h b/archive/src/thread/threadmutex.h similarity index 100% rename from src/thread/threadmutex.h rename to archive/src/thread/threadmutex.h diff --git a/src/time/CMakeLists.txt b/archive/src/time/CMakeLists.txt similarity index 100% rename from src/time/CMakeLists.txt rename to archive/src/time/CMakeLists.txt diff --git a/src/time/time.c b/archive/src/time/time.c similarity index 100% rename from src/time/time.c rename to archive/src/time/time.c diff --git a/src/time/time.h b/archive/src/time/time.h similarity index 100% rename from src/time/time.h rename to archive/src/time/time.h diff --git a/src/ui/CMakeLists.txt b/archive/src/ui/CMakeLists.txt similarity index 100% rename from src/ui/CMakeLists.txt rename to archive/src/ui/CMakeLists.txt diff --git a/src/ui/ui.c b/archive/src/ui/ui.c similarity index 100% rename from src/ui/ui.c rename to archive/src/ui/ui.c diff --git a/src/ui/ui.h b/archive/src/ui/ui.h similarity index 100% rename from src/ui/ui.h rename to archive/src/ui/ui.h diff --git a/src/util/CMakeLists.txt b/archive/src/util/CMakeLists.txt similarity index 100% rename from src/util/CMakeLists.txt rename to archive/src/util/CMakeLists.txt diff --git a/src/util/array.c b/archive/src/util/array.c similarity index 100% rename from src/util/array.c rename to archive/src/util/array.c diff --git a/src/util/array.h b/archive/src/util/array.h similarity index 100% rename from src/util/array.h rename to archive/src/util/array.h diff --git a/src/util/math.c b/archive/src/util/math.c similarity index 100% rename from src/util/math.c rename to archive/src/util/math.c diff --git a/src/util/math.h b/archive/src/util/math.h similarity index 100% rename from src/util/math.h rename to archive/src/util/math.h diff --git a/src/util/memory.c b/archive/src/util/memory.c similarity index 100% rename from src/util/memory.c rename to archive/src/util/memory.c diff --git a/src/util/memory.h b/archive/src/util/memory.h similarity index 100% rename from src/util/memory.h rename to archive/src/util/memory.h diff --git a/src/util/sort.c b/archive/src/util/sort.c similarity index 100% rename from src/util/sort.c rename to archive/src/util/sort.c diff --git a/src/util/sort.h b/archive/src/util/sort.h similarity index 100% rename from src/util/sort.h rename to archive/src/util/sort.h diff --git a/src/util/string.c b/archive/src/util/string.c similarity index 100% rename from src/util/string.c rename to archive/src/util/string.c diff --git a/src/util/string.h b/archive/src/util/string.h similarity index 100% rename from src/util/string.h rename to archive/src/util/string.h diff --git a/cmake/targets/dolphin.cmake b/cmake/targets/dolphin.cmake new file mode 100644 index 0000000..29d893c --- /dev/null +++ b/cmake/targets/dolphin.cmake @@ -0,0 +1,56 @@ +set(DUSK_LIBRARY_TARGET_NAME "${DUSK_LIBRARY_TARGET_NAME}.elf" CACHE INTERNAL ${DUSK_CACHE_TARGET}) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -fno-exceptions") +# configure_file(opengl.pc.in opengl.pc @ONLY) +find_package(PkgConfig REQUIRED) +pkg_check_modules(zip IMPORTED_TARGET libzip) +target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} PUBLIC + DOLPHIN +) + +# Disable all warnings +target_compile_options(${DUSK_LIBRARY_TARGET_NAME} PRIVATE -w) + +# Custom flags for cglm +set(CGLM_SHARED OFF CACHE BOOL "Build cglm shared" FORCE) +set(CGLM_STATIC ON CACHE BOOL "Build cglm static" FORCE) +find_package(cglm REQUIRED) + +# Compile lua +include(FetchContent) +FetchContent_Declare( + liblua + URL https://www.lua.org/ftp/lua-5.5.0.tar.gz +) +FetchContent_MakeAvailable(liblua) +set(LUA_SRC_DIR "${liblua_SOURCE_DIR}/src") +set(LUA_C_FILES + lapi.c lauxlib.c lbaselib.c lcode.c lcorolib.c lctype.c ldblib.c ldebug.c + ldo.c ldump.c lfunc.c lgc.c linit.c liolib.c llex.c lmathlib.c lmem.c + loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c + lstrlib.c ltable.c ltablib.c ltm.c lundump.c lutf8lib.c lvm.c lzio.c +) +list(TRANSFORM LUA_C_FILES PREPEND "${LUA_SRC_DIR}/") +add_library(liblua STATIC ${LUA_C_FILES}) +target_include_directories(liblua PUBLIC "${LUA_SRC_DIR}") +target_compile_definitions(liblua PRIVATE LUA_USE_C89) +add_library(lua::lua ALIAS liblua) +set(Lua_FOUND TRUE CACHE BOOL "Lua found" FORCE) + +target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PRIVATE + cglm + liblua + m + fat + PkgConfig::zip +) + +# Postbuild + +set(DUSK_BINARY_TARGET_NAME_DOL "${DUSK_BUILD_DIR}/Dusk.dol") +add_custom_command(TARGET ${DUSK_BINARY_TARGET_NAME} POST_BUILD + COMMAND elf2dol + "$" + "${DUSK_BINARY_TARGET_NAME_DOL}" + COMMENT "Generating ${DUSK_BINARY_TARGET_NAME_DOL} from ${DUSK_BINARY_TARGET_NAME}" +) \ No newline at end of file diff --git a/cmake/targets/gamecube.cmake b/cmake/targets/gamecube.cmake new file mode 100644 index 0000000..e69de29 diff --git a/cmake/targets/linux.cmake b/cmake/targets/linux.cmake new file mode 100644 index 0000000..ca3d620 --- /dev/null +++ b/cmake/targets/linux.cmake @@ -0,0 +1,9 @@ +find_package(SDL2 REQUIRED) +find_package(OpenGL REQUIRED) +target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC + SDL2 + pthread + OpenGL::GL + GL + m +) \ No newline at end of file diff --git a/cmake/targets/psp.cmake b/cmake/targets/psp.cmake new file mode 100644 index 0000000..d024b5e --- /dev/null +++ b/cmake/targets/psp.cmake @@ -0,0 +1,30 @@ +# find_package(pspsdk REQUIRED) +find_package(SDL2 REQUIRED) +find_package(OpenGL REQUIRED) +target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC + ${SDL2_LIBRARIES} + SDL2 + pthread + OpenGL::GL + zip + bz2 + z + mbedtls + mbedcrypto + lzma + m +) +target_include_directories(${DUSK_LIBRARY_TARGET_NAME} PRIVATE + ${SDL2_INCLUDE_DIRS} +) + +# Postbuild, create .pbp file for PSP. +create_pbp_file( + TARGET "${DUSK_BINARY_TARGET_NAME}" + ICON_PATH NULL + BACKGROUND_PATH NULL + PREVIEW_PATH NULL + TITLE "${DUSK_BINARY_TARGET_NAME}" + PSAR_PATH ${DUSK_ASSETS_ZIP} + VERSION 01.00 +) \ No newline at end of file diff --git a/cmake/targets/wii.cmake b/cmake/targets/wii.cmake new file mode 100644 index 0000000..e69de29 diff --git a/.ci/dolphin/Dockerfile b/docker/dolphin/Dockerfile similarity index 100% rename from .ci/dolphin/Dockerfile rename to docker/dolphin/Dockerfile diff --git a/.ci/dolphin/meta.xml b/docker/dolphin/meta.xml similarity index 100% rename from .ci/dolphin/meta.xml rename to docker/dolphin/meta.xml diff --git a/docker/psp/Dockerfile b/docker/psp/Dockerfile new file mode 100644 index 0000000..de09ebf --- /dev/null +++ b/docker/psp/Dockerfile @@ -0,0 +1,7 @@ +FROM pspdev/pspdev:latest +WORKDIR /workdir +RUN apk add --no-cache \ + python3 \ + py3-pip +VOLUME ["/workdir"] +CMD [ "/bin/bash", "-c", "./scripts/build-psp.sh" ] \ No newline at end of file diff --git a/scripts/build-gamecube-docker.sh b/scripts/build-gamecube-docker.sh new file mode 100755 index 0000000..03f8a5f --- /dev/null +++ b/scripts/build-gamecube-docker.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker build -t dusk-dolphin -f docker/dolphin/Dockerfile . +docker run --rm -v $(pwd):/workdir dusk-dolphin ls \ No newline at end of file diff --git a/scripts/build-gamecube.sh b/scripts/build-gamecube.sh new file mode 100755 index 0000000..faf7665 --- /dev/null +++ b/scripts/build-gamecube.sh @@ -0,0 +1,10 @@ +#!/bin/bash +if [ -z "$DEVKITPRO" ]; then + echo "DEVKITPRO environment variable is not set. Please set it to the path of your DEVKITPRO installation." + exit 1 +fi + +mkdir -p build-gamecube +cmake -S. -Bbuild-gamecube -DDUSK_TARGET_SYSTEM=gamcube -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/GameCube.cmake" +cd build-gamecube +make -j$(nproc) VERBOSE=1 \ No newline at end of file diff --git a/scripts/build-psp-docker.sh b/scripts/build-psp-docker.sh new file mode 100755 index 0000000..f825cee --- /dev/null +++ b/scripts/build-psp-docker.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker build -t dusk-psp -f docker/psp/Dockerfile . +docker run --rm -v $(pwd):/workdir dusk-psp \ No newline at end of file diff --git a/scripts/build-psp.sh b/scripts/build-psp.sh new file mode 100755 index 0000000..f7a887e --- /dev/null +++ b/scripts/build-psp.sh @@ -0,0 +1,10 @@ +#!/bin/bash +if [ -z "$PSPDEV" ]; then + echo "PSPDEV environment variable is not set. Please set it to the path of your PSP development environment." + exit 1 +fi + +mkdir -p build-psp +cd build-psp +cmake .. -DDUSK_TARGET_SYSTEM=psp -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake +make -j$(nproc) \ No newline at end of file diff --git a/scripts/build-wii.sh b/scripts/build-wii.sh new file mode 100755 index 0000000..7fb5ed0 --- /dev/null +++ b/scripts/build-wii.sh @@ -0,0 +1,10 @@ +#!/bin/bash +if [ -z "$DEVKITPRO" ]; then + echo "DEVKITPRO environment variable is not set. Please set it to the path of your DEVKITPRO installation." + exit 1 +fi + +mkdir -p build-wii +cmake -S. -Bbuild-wii -DDUSK_TARGET_SYSTEM=wii -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/Wii.cmake" +cd build-wii +make -j$(nproc) VERBOSE=1 \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 13db8e7..2e410a7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,74 +1,6 @@ -# Copyright (c) 2025 Dominic Masters -# +# Copyright (c) 2026 Dominic Masters +# # This software is released under the MIT License. # https://opensource.org/licenses/MIT -if(NOT cglm_FOUND) - find_package(cglm REQUIRED) - target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC cglm) -endif() - -if(NOT libzip_FOUND) - find_package(libzip REQUIRED) - target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC zip) -endif() - -if(NOT Lua_FOUND) - find_package(Lua REQUIRED) - if(Lua_FOUND AND NOT TARGET Lua::Lua) - add_library(Lua::Lua INTERFACE IMPORTED) - set_target_properties( - Lua::Lua - PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${LUA_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${LUA_LIBRARIES}" - ) - endif() - target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC Lua::Lua) -endif() - -# Libs - -# Includes -target_include_directories(${DUSK_LIBRARY_TARGET_NAME} - PUBLIC - ${CMAKE_CURRENT_LIST_DIR} -) - -# Sources - -# Main Binary Source -target_sources(${DUSK_BINARY_TARGET_NAME} - PUBLIC - main.c -) - -# Defs -dusk_env_to_h(duskdefs.env duskdefs.h) -target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} - PUBLIC - DUSK_TARGET_SYSTEM="${DUSK_TARGET_SYSTEM}" -) - -# Subdirs -add_subdirectory(assert) -add_subdirectory(asset) -add_subdirectory(debug) -add_subdirectory(display) -add_subdirectory(engine) -add_subdirectory(error) -add_subdirectory(event) -add_subdirectory(input) -add_subdirectory(item) -add_subdirectory(locale) -add_subdirectory(map) -add_subdirectory(scene) -add_subdirectory(script) -add_subdirectory(story) -add_subdirectory(time) -add_subdirectory(ui) -add_subdirectory(util) - -if(DUSK_TARGET_SYSTEM STREQUAL "linux" OR DUSK_TARGET_SYSTEM STREQUAL "psp") - add_subdirectory(thread) -endif() \ No newline at end of file +add_subdirectory(dusk) \ No newline at end of file diff --git a/src/dusk/CMakeLists.txt b/src/dusk/CMakeLists.txt new file mode 100644 index 0000000..425b5c2 --- /dev/null +++ b/src/dusk/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright (c) 2025 Dominic Masters +# +# This software is released under the MIT License. +# https://opensource.org/licenses/MIT + +# Libs + +# Includes +target_include_directories(${DUSK_LIBRARY_TARGET_NAME} + PUBLIC + ${CMAKE_CURRENT_LIST_DIR} +) + +# Sources + +# Main Binary Source +target_sources(${DUSK_BINARY_TARGET_NAME} + PUBLIC + main.c +) + +# Defs +target_compile_definitions(${DUSK_LIBRARY_TARGET_NAME} + PUBLIC + DUSK_TARGET_SYSTEM="${DUSK_TARGET_SYSTEM}" +) + +# Subdirs \ No newline at end of file diff --git a/src/dusk/main.c b/src/dusk/main.c new file mode 100644 index 0000000..a8bf0bb --- /dev/null +++ b/src/dusk/main.c @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2026 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +#include + +int main() { + printf("Hello, Dusk!\n"); + return 0; +} \ No newline at end of file diff --git a/src/dusk/null.c b/src/dusk/null.c new file mode 100644 index 0000000..1fa7f4c --- /dev/null +++ b/src/dusk/null.c @@ -0,0 +1,12 @@ +/** + * Copyright (c) 2026 Dominic Masters + * + * This software is released under the MIT License. + * https://opensource.org/licenses/MIT + */ + +// NULL (Empty source) file for allowing CMake to not complain about missing +// a source file early on during the build. +static void nullFunction(void) { + +} \ No newline at end of file