mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
⚗️ chore: try to make less modification from upstream
This commit is contained in:
parent
1bcfcf7e82
commit
45c9fadc7b
@ -1,8 +1,5 @@
|
||||
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)
|
||||
|
||||
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_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)
|
||||
option(ISLE_XBOX_ONE "Build for Xbox One/Series X|S" ON)
|
||||
option(CMAKE_POSITION_INDEPENDENT_CODE "Build with -fPIC" ON)
|
||||
option(ENABLE_CLANG_TIDY "Enable clang-tidy")
|
||||
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 "Isle debugging: ${ISLE_DEBUG}")
|
||||
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)
|
||||
|
||||
@ -64,12 +59,21 @@ if(DOWNLOAD_DEPENDENCIES)
|
||||
# FetchContent downloads and configures dependencies
|
||||
message(STATUS "Fetching SDL3 and iniparser. This might take a while...")
|
||||
include(FetchContent)
|
||||
if(WINDOWS_STORE)
|
||||
FetchContent_Declare(
|
||||
SDL3
|
||||
GIT_REPOSITORY "https://github.com/Helloyunho/SDL3-uwp.git"
|
||||
GIT_TAG "main"
|
||||
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_Declare(
|
||||
|
||||
@ -11,4 +11,11 @@
|
||||
#define SDL_XBOX_BUTTON_DPAD_UP 10
|
||||
#define SDL_XBOX_BUTTON_DPAD_DOWN 11
|
||||
#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
|
||||
@ -96,6 +96,10 @@ if(WIN32 AND NOT WINDOWS_STORE)
|
||||
target_link_libraries(miniwin PRIVATE d3d9)
|
||||
endif()
|
||||
|
||||
if(WINDOWS_STORE)
|
||||
add_compile_definitions(WINDOWS_STORE)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(miniwin PUBLIC MINIWIN)
|
||||
|
||||
target_include_directories(miniwin
|
||||
|
||||
@ -167,7 +167,7 @@ HRESULT Direct3DRMImpl::CreateDeviceFromSurface(
|
||||
DDRenderer = new Citro3DRenderer(DDSDesc.dwWidth, DDSDesc.dwHeight);
|
||||
}
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(WINDOWS_STORE)
|
||||
else if (SDL_memcmp(&guid, &DirectX9_GUID, sizeof(GUID)) == 0) {
|
||||
DDRenderer = DirectX9Renderer::Create(DDSDesc.dwWidth, DDSDesc.dwHeight);
|
||||
}
|
||||
|
||||
@ -238,7 +238,7 @@ HRESULT DirectDrawImpl::EnumDevices(LPD3DENUMDEVICESCALLBACK cb, void* ctx)
|
||||
#ifdef __3DS__
|
||||
Citro3DRenderer_EnumDevice(cb, ctx);
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(WINDOWS_STORE)
|
||||
DirectX9Renderer_EnumDevice(cb, ctx);
|
||||
#endif
|
||||
Direct3DRMSoftware_EnumDevice(cb, ctx);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user