⚗️ chore: try to make less modification from upstream

This commit is contained in:
Helloyunho 2025-07-01 21:47:53 +09:00
parent 1bcfcf7e82
commit 45c9fadc7b
5 changed files with 23 additions and 8 deletions

View File

@ -1,8 +1,5 @@
cmake_minimum_required(VERSION 3.25...4.0 FATAL_ERROR) cmake_minimum_required(VERSION 3.25...4.0 FATAL_ERROR)
set(CMAKE_SYSTEM_NAME WindowsStore)
set(CMAKE_SYSTEM_VERSION 10.0.26100.0)
project(isle LANGUAGES CXX C VERSION 0.1) project(isle LANGUAGES CXX C VERSION 0.1)
if(EMSCRIPTEN) if(EMSCRIPTEN)
@ -43,7 +40,6 @@ cmake_dependent_option(ISLE_USE_DX5 "Build with internal DirectX 5 SDK" "${NOT_M
cmake_dependent_option(ISLE_MINIWIN "Use miniwin" ON "NOT ISLE_USE_DX5" OFF) cmake_dependent_option(ISLE_MINIWIN "Use miniwin" ON "NOT ISLE_USE_DX5" OFF)
cmake_dependent_option(ISLE_BUILD_CONFIG "Build CONFIG.EXE application" ON "MSVC OR ISLE_MINIWIN;NOT NINTENDO_3DS;NOT WINDOWS_STORE" OFF) cmake_dependent_option(ISLE_BUILD_CONFIG "Build CONFIG.EXE application" ON "MSVC OR ISLE_MINIWIN;NOT NINTENDO_3DS;NOT WINDOWS_STORE" OFF)
cmake_dependent_option(ISLE_COMPILE_SHADERS "Compile shaders" ON "SDL_SHADERCROSS_BIN;TARGET Python3::Interpreter" OFF) cmake_dependent_option(ISLE_COMPILE_SHADERS "Compile shaders" ON "SDL_SHADERCROSS_BIN;TARGET Python3::Interpreter" OFF)
option(ISLE_XBOX_ONE "Build for Xbox One/Series X|S" ON)
option(CMAKE_POSITION_INDEPENDENT_CODE "Build with -fPIC" ON) option(CMAKE_POSITION_INDEPENDENT_CODE "Build with -fPIC" ON)
option(ENABLE_CLANG_TIDY "Enable clang-tidy") option(ENABLE_CLANG_TIDY "Enable clang-tidy")
option(DOWNLOAD_DEPENDENCIES "Download dependencies" ON) option(DOWNLOAD_DEPENDENCIES "Download dependencies" ON)
@ -56,7 +52,6 @@ message(STATUS "Internal DirectX5 SDK: ${ISLE_USE_DX5}")
message(STATUS "Internal miniwin: ${ISLE_MINIWIN}") message(STATUS "Internal miniwin: ${ISLE_MINIWIN}")
message(STATUS "Isle debugging: ${ISLE_DEBUG}") message(STATUS "Isle debugging: ${ISLE_DEBUG}")
message(STATUS "Compile shaders: ${ISLE_COMPILE_SHADERS}") message(STATUS "Compile shaders: ${ISLE_COMPILE_SHADERS}")
message(STATUS "Build for Xbox One/Series X|S: ${ISLE_XBOX_ONE}")
add_library(Isle::iniparser INTERFACE IMPORTED) add_library(Isle::iniparser INTERFACE IMPORTED)
@ -64,12 +59,21 @@ if(DOWNLOAD_DEPENDENCIES)
# FetchContent downloads and configures dependencies # FetchContent downloads and configures dependencies
message(STATUS "Fetching SDL3 and iniparser. This might take a while...") message(STATUS "Fetching SDL3 and iniparser. This might take a while...")
include(FetchContent) include(FetchContent)
if(WINDOWS_STORE)
FetchContent_Declare( FetchContent_Declare(
SDL3 SDL3
GIT_REPOSITORY "https://github.com/Helloyunho/SDL3-uwp.git" GIT_REPOSITORY "https://github.com/Helloyunho/SDL3-uwp.git"
GIT_TAG "main" GIT_TAG "main"
EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL
) )
else()
FetchContent_Declare(
SDL3
GIT_REPOSITORY "https://github.com/libsdl-org/SDL.git"
GIT_TAG "main"
EXCLUDE_FROM_ALL
)
endif()
FetchContent_MakeAvailable(SDL3) FetchContent_MakeAvailable(SDL3)
FetchContent_Declare( FetchContent_Declare(

View File

@ -11,4 +11,11 @@
#define SDL_XBOX_BUTTON_DPAD_UP 10 #define SDL_XBOX_BUTTON_DPAD_UP 10
#define SDL_XBOX_BUTTON_DPAD_DOWN 11 #define SDL_XBOX_BUTTON_DPAD_DOWN 11
#define SDL_XBOX_BUTTON_DPAD_LEFT 12 #define SDL_XBOX_BUTTON_DPAD_LEFT 12
#define SDL_XBOX_BUTTON_DPAD_RIGHT 13 #define SDL_XBOX_BUTTON_DPAD_RIGHT 13
#define SDL_XBOX_AXIS_LEFT_Y 0
#define SDL_XBOX_AXIS_LEFT_X 1
#define SDL_XBOX_AXIS_RIGHT_Y 2
#define SDL_XBOX_AXIS_RIGHT_X 3
#define SDL_XBOX_AXIS_LEFT_TRIGGER 4
#define SDL_XBOX_AXIS_RIGHT_TRIGGER 5

View File

@ -96,6 +96,10 @@ if(WIN32 AND NOT WINDOWS_STORE)
target_link_libraries(miniwin PRIVATE d3d9) target_link_libraries(miniwin PRIVATE d3d9)
endif() endif()
if(WINDOWS_STORE)
add_compile_definitions(WINDOWS_STORE)
endif()
target_compile_definitions(miniwin PUBLIC MINIWIN) target_compile_definitions(miniwin PUBLIC MINIWIN)
target_include_directories(miniwin target_include_directories(miniwin

View File

@ -167,7 +167,7 @@ HRESULT Direct3DRMImpl::CreateDeviceFromSurface(
DDRenderer = new Citro3DRenderer(DDSDesc.dwWidth, DDSDesc.dwHeight); DDRenderer = new Citro3DRenderer(DDSDesc.dwWidth, DDSDesc.dwHeight);
} }
#endif #endif
#ifdef _WIN32 #if defined(_WIN32) && !defined(WINDOWS_STORE)
else if (SDL_memcmp(&guid, &DirectX9_GUID, sizeof(GUID)) == 0) { else if (SDL_memcmp(&guid, &DirectX9_GUID, sizeof(GUID)) == 0) {
DDRenderer = DirectX9Renderer::Create(DDSDesc.dwWidth, DDSDesc.dwHeight); DDRenderer = DirectX9Renderer::Create(DDSDesc.dwWidth, DDSDesc.dwHeight);
} }

View File

@ -238,7 +238,7 @@ HRESULT DirectDrawImpl::EnumDevices(LPD3DENUMDEVICESCALLBACK cb, void* ctx)
#ifdef __3DS__ #ifdef __3DS__
Citro3DRenderer_EnumDevice(cb, ctx); Citro3DRenderer_EnumDevice(cb, ctx);
#endif #endif
#ifdef _WIN32 #if defined(_WIN32) && !defined(WINDOWS_STORE)
DirectX9Renderer_EnumDevice(cb, ctx); DirectX9Renderer_EnumDevice(cb, ctx);
#endif #endif
Direct3DRMSoftware_EnumDevice(cb, ctx); Direct3DRMSoftware_EnumDevice(cb, ctx);