move config cmake

This commit is contained in:
olebeck 2025-07-06 19:04:30 +02:00
parent 02b942b491
commit eea79553d8
4 changed files with 49 additions and 79 deletions

View File

@ -754,52 +754,7 @@ endif()
if(VITA)
include("${VITASDK}/share/vita.cmake" REQUIRED)
# config app
include(FetchContent)
FetchContent_Declare(
ScePaf_External
URL https://github.com/olebeck/ScePaf/releases/download/continuous/ScePaf-1.0.0.zip
)
FetchContent_MakeAvailable(ScePaf_External)
add_executable(isle-config
CONFIG_vita/src/app.cpp
CONFIG_vita/src/main.cpp
)
target_compile_options(isle-config PRIVATE
-fno-rtti -fno-exceptions -Wl,-q -Wall -fno-builtin -fshort-wchar -Wno-unused-function -Wno-sign-compare
)
# todo _start symbol warning
target_link_options(isle-config PRIVATE
-nostartfiles -nostdlib
)
target_link_libraries(isle-config PRIVATE
SceAppMgr_stub
SceLibKernel_stub
SceSysmodule_stub
ScePafToplevel_stub
ScePafResource_stub
ScePafWidget_stub
ScePafCommon_stub
ScePafStdc_stub
)
block()
set(VITA_MAKE_FSELF_FLAGS "${VITA_MAKE_FSELF_FLAGS} -a 0x2F00000000000101")
vita_create_self(isle-config.self isle-config
CONFIG CONFIG_vita/exports.yml
UNSAFE
STRIPPED
REL_OPTIMIZE
)
endblock()
include(${scepaf_external_SOURCE_DIR}/rco.cmake)
make_rco(CONFIG_vita/cxml/config_plugin.xml config_plugin.rco)
include(CONFIG_vita/CONFIG_vita.cmake)
set(ISLE_PACKAGE_NAME "vita-isle")
set(VITA_APP_NAME "Lego Island")

View File

@ -0,0 +1,45 @@
# config app
include(FetchContent)
FetchContent_Declare(
ScePaf_External
URL https://github.com/olebeck/ScePaf/releases/download/continuous/ScePaf-1.0.0.zip
)
FetchContent_MakeAvailable(ScePaf_External)
add_executable(isle-config
${CMAKE_CURRENT_LIST_DIR}/src/app.cpp
${CMAKE_CURRENT_LIST_DIR}/src/main.cpp
)
target_compile_options(isle-config PRIVATE
-fno-rtti -fno-exceptions -Wl,-q -Wall -fno-builtin -fshort-wchar -Wno-unused-function -Wno-sign-compare
)
target_link_options(isle-config PRIVATE
-nostartfiles -nostdlib
)
target_link_libraries(isle-config PRIVATE
SceAppMgr_stub
SceLibKernel_stub
SceSysmodule_stub
ScePafToplevel_stub
ScePafResource_stub
ScePafWidget_stub
ScePafCommon_stub
ScePafStdc_stub
)
block()
set(VITA_MAKE_FSELF_FLAGS "${VITA_MAKE_FSELF_FLAGS} -a 0x2F00000000000101")
vita_create_self(isle-config.self isle-config
CONFIG CONFIG_vita/exports.yml
UNSAFE
STRIPPED
REL_OPTIMIZE
)
endblock()
include(${scepaf_external_SOURCE_DIR}/rco.cmake)
make_rco(${CMAKE_CURRENT_LIST_DIR}/cxml/config_plugin.xml config_plugin.rco)

View File

@ -159,7 +159,7 @@ MxResult LegoInputManager::GetJoystick()
}
m_joyids = SDL_GetGamepads(&numJoysticks);
if (m_useJoystick != FALSE) {
if (m_useJoystick != FALSE && numJoysticks != 0) {
MxS32 joyid = m_joystickIndex;
if (joyid >= 0) {
m_joystick = SDL_OpenGamepad(m_joyids[joyid]);

View File

@ -1421,6 +1421,7 @@ void GXMRenderer::StartScene()
&gxm->displayBuffersSurface[gxm->backBufferIndex],
&gxm->depthSurface
);
sceGxmSetCullMode(gxm->context, SCE_GXM_CULL_CCW);
gxm->sceneStarted = true;
this->quadsUsed = 0;
@ -1476,37 +1477,6 @@ void GXMRenderer::EnableTransparency()
this->transparencyEnabled = true;
}
static void transpose4x4(const float src[4][4], float dst[4][4])
{
for (int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
dst[j][i] = src[i][j];
}
}
}
static void transpose3x3(const float src[3][3], float dst[3][3])
{
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
dst[j][i] = src[i][j];
}
}
}
static const D3DRMMATRIX4D identity4x4 = {
{1.0, 0.0, 0.0, 0.0},
{0.0, 1.0, 0.0, 0.0},
{0.0, 0.0, 1.0, 0.0},
{0.0, 0.0, 0.0, 1.0},
};
static const Matrix3x3 identity3x3 = {
{1.0, 0.0, 0.0},
{0.0, 1.0, 0.0},
{0.0, 0.0, 1.0},
};
void GXMRenderer::SubmitDraw(
DWORD meshId,
const D3DRMMATRIX4D& modelViewMatrix,
@ -1560,7 +1530,7 @@ void GXMRenderer::SubmitDraw(
this->UseTexture(texture);
}
sceGxmSetVertexStream(gxm->context, 0, mesh.vertexBuffer);
sceGxmSetFrontDepthFunc(gxm->context, SCE_GXM_DEPTH_FUNC_LESS);
sceGxmSetFrontDepthFunc(gxm->context, SCE_GXM_DEPTH_FUNC_LESS_EQUAL);
sceGxmDraw(gxm->context, SCE_GXM_PRIMITIVE_TRIANGLES, SCE_GXM_INDEX_FORMAT_U16, mesh.indexBuffer, mesh.indexCount);
#ifdef DEBUG