diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 3823bcb..c5dfc42 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -57,7 +57,7 @@ jobs: apt-get update apt-get install -y build-essential cmake python3 python3-pip python3-polib python3-pil libsdl2-dev libgl1-mesa-dev libzip-dev python3-dotenv python3-pyqt5 python3-opengl liblua5.3-dev - name: Configure CMake - run: cmake -S . -B build -DDUSK_TARGET_SYSTEM=psp + run: cmake -S . -B build -DDUSK_TARGET_SYSTEM=psp -DENABLE_TESTS=OFF - name: Build run: cmake --build build -- -j$(nproc) - name: Move EBOOT.PBP to Dusk subfolder diff --git a/CMakeLists.txt b/CMakeLists.txt index f62030b..61945a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,11 +11,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/mod option(ENABLE_TESTS "Enable tests" ON) - # Set target system if(NOT DEFINED DUSK_TARGET_SYSTEM) - set(DUSK_TARGET_SYSTEM "linux") - # set(DUSK_TARGET_SYSTEM "psp") + # set(DUSK_TARGET_SYSTEM "linux") + set(DUSK_TARGET_SYSTEM "psp") endif() # Prep cache @@ -85,7 +84,7 @@ if(DUSK_TARGET_SYSTEM STREQUAL "linux") elseif(DUSK_TARGET_SYSTEM STREQUAL "psp") find_package(SDL2 REQUIRED) find_package(OpenGL REQUIRED) - target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PRIVATE + target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC ${SDL2_LIBRARIES} SDL2 OpenGL::GL @@ -99,6 +98,9 @@ elseif(DUSK_TARGET_SYSTEM STREQUAL "psp") target_include_directories(${DUSK_LIBRARY_TARGET_NAME} PRIVATE ${SDL2_INCLUDE_DIRS} ) + + # Force turn tests off for now + set(ENABLE_TESTS OFF CACHE BOOL "Enable tests" FORCE) endif() # Add code @@ -130,11 +132,11 @@ target_include_directories(${DUSK_LIBRARY_TARGET_NAME} PUBLIC # Postbuild if(DUSK_TARGET_SYSTEM STREQUAL "psp") create_pbp_file( - TARGET "${DUSK_LIBRARY_TARGET_NAME}" + TARGET "${DUSK_BINARY_TARGET_NAME}" ICON_PATH NULL BACKGROUND_PATH NULL PREVIEW_PATH NULL - TITLE "${DUSK_LIBRARY_TARGET_NAME}" + TITLE "${DUSK_BINARY_TARGET_NAME}" PSAR_PATH ${DUSK_BUILD_DIR}/dusk.dsk VERSION 01.00 ) diff --git a/src/script/module/moduleinput.h b/src/script/module/moduleinput.h index b53aba5..4bd3e1f 100644 --- a/src/script/module/moduleinput.h +++ b/src/script/module/moduleinput.h @@ -9,7 +9,7 @@ #include "script/scriptcontext.h" #include "input/input.h" -int32_t moduleInputBind(lua_State *L) { +int moduleInputBind(lua_State *L) { assertNotNull(L, "Lua state cannot be NULL"); // Requires action and button. diff --git a/src/script/module/modulemap.h b/src/script/module/modulemap.h index e3b15a3..928ab33 100644 --- a/src/script/module/modulemap.h +++ b/src/script/module/modulemap.h @@ -11,7 +11,7 @@ #include "assert/assert.h" #include "rpg/world/map.h" -int32_t moduleMapLoad(lua_State *L) { +int moduleMapLoad(lua_State *L) { assertNotNull(L, "Lua state cannot be NULL"); if(!lua_isstring(L, 1)) { diff --git a/src/script/module/modulescene.h b/src/script/module/modulescene.h index d06c526..25879ce 100644 --- a/src/script/module/modulescene.h +++ b/src/script/module/modulescene.h @@ -9,7 +9,7 @@ #include "script/scriptcontext.h" #include "scene/scenemanager.h" -int32_t moduleSceneSetScene(lua_State *L) { +int moduleSceneSetScene(lua_State *L) { assertNotNull(L, "Lua state cannot be NULL"); assertTrue(lua_isstring(L, 1), "Expected string scene name"); diff --git a/src/script/module/modulesystem.h b/src/script/module/modulesystem.h index 1de2f0a..fff2ffd 100644 --- a/src/script/module/modulesystem.h +++ b/src/script/module/modulesystem.h @@ -12,7 +12,7 @@ #include "util/string.h" #include "script/scriptmodule.h" -int32_t moduleSysPrint(lua_State *L) { +int moduleSysPrint(lua_State *L) { assertNotNull(L, "Lua state cannot be NULL"); int n = lua_gettop(L); @@ -33,7 +33,7 @@ int32_t moduleSysPrint(lua_State *L) { return 0; // no values returned to Lua } -int32_t moduleSysInclude(lua_State *L) { +int moduleSysInclude(lua_State *L) { assertNotNull(L, "Lua state cannot be NULL"); if(!lua_isstring(L, 1)) { @@ -82,7 +82,7 @@ int32_t moduleSysInclude(lua_State *L) { return 0; } -int32_t moduleSysModule(lua_State *L) { +int moduleSysModule(lua_State *L) { assertNotNull(L, "Lua state cannot be NULL"); if(!lua_isstring(L, 1)) { diff --git a/src/script/module/scriptfuncentity.h b/src/script/module/scriptfuncentity.h index ea0d3a7..dc75f6a 100644 --- a/src/script/module/scriptfuncentity.h +++ b/src/script/module/scriptfuncentity.h @@ -10,7 +10,7 @@ #include "rpg/entity/entity.h" #include "assert/assert.h" -int32_t scriptFuncEntityAdd(lua_State *L) { +int scriptFuncEntityAdd(lua_State *L) { assertNotNull(L, "Lua state cannot be NULL"); assertTrue(lua_isinteger(L, 1), "Expected integer entity type"); @@ -50,7 +50,7 @@ int32_t scriptFuncEntityAdd(lua_State *L) { return 1; } -int32_t scriptFuncEntitySetX(lua_State *L) { +int scriptFuncEntitySetX(lua_State *L) { assertNotNull(L, "Lua state cannot be NULL"); assertTrue(lua_isinteger(L, 1), "Expected integer entity id"); @@ -75,7 +75,7 @@ int32_t scriptFuncEntitySetX(lua_State *L) { return 0; } -int32_t scriptFuncEntitySetY(lua_State *L) { +int scriptFuncEntitySetY(lua_State *L) { assertNotNull(L, "Lua state cannot be NULL"); assertTrue(lua_isinteger(L, 1), "Expected integer entity id"); @@ -100,7 +100,7 @@ int32_t scriptFuncEntitySetY(lua_State *L) { return 0; } -int32_t scriptFuncEntitySetZ(lua_State *L) { +int scriptFuncEntitySetZ(lua_State *L) { assertNotNull(L, "Lua state cannot be NULL"); assertTrue(lua_isinteger(L, 1), "Expected integer entity id");