diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f95aa58..c310108f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ endif() if (NINTENDO_SWITCH) set(CMAKE_TOOLCHAIN_FILE "${DEVKITPRO}/cmake/Switch.cmake" CACHE PATH "toolchain file") add_compile_definitions(__SWITCH__) + add_compile_definitions(SDL_PLATFORM_SWITCH) add_compile_definitions(SDL_VIDEO_DRIVER_SWITCH) add_compile_definitions(IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS) endif() @@ -98,7 +99,8 @@ if (DOWNLOAD_DEPENDENCIES) # Official repo missing Threads support? #GIT_REPOSITORY "https://github.com/devkitPro/SDL.git" #GIT_TAG "switch-sdl-3.2" - GIT_REPOSITORY "https://github.com/vs49688/SDL.git" + #GIT_REPOSITORY "https://github.com/vs49688/SDL.git" + GIT_REPOSITORY "https://github.com/SnepOMatic/SDL3-Switch.git" GIT_TAG "switch-sdl-3.2.14" EXCLUDE_FROM_ALL ) @@ -606,7 +608,6 @@ if (ISLE_BUILD_APP) endif() if(NINTENDO_SWITCH) target_sources(isle PRIVATE - ISLE/switch/filesys.cpp ISLE/switch/config.cpp ) endif() diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index b53697d6..9fb78886 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -67,8 +67,6 @@ #ifdef __SWITCH__ #include "switch/config.h" -#include "switch/filesys.h" - #include #endif diff --git a/ISLE/switch/config.cpp b/ISLE/switch/config.cpp index 883f8226..9f7f1b56 100644 --- a/ISLE/switch/config.cpp +++ b/ISLE/switch/config.cpp @@ -8,4 +8,5 @@ void NX_SetupDefaultConfigOverrides(dictionary* p_dictionary) iniparser_set(p_dictionary, "isle:diskpath", "sdmc:/switch/isle/LEGO/"); iniparser_set(p_dictionary, "isle:cdpath", "sdmc:/switch/isle/"); iniparser_set(p_dictionary, "isle:savepath", "sdmc:/switch/isle/"); + iniparser_set(p_dictionary, "isle:Cursor Sensitivity", "16.000000"); } diff --git a/ISLE/switch/filesys.cpp b/ISLE/switch/filesys.cpp deleted file mode 100644 index f96b3712..00000000 --- a/ISLE/switch/filesys.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "filesys.h" - -#include -#include -#include -#include -#include - -// Missing from Switch SDL3 implementation -#ifndef S_ISREG -#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) -#endif - -// Uses core of SDL's SDL_GetPathInfo but handles null 'info'. -bool NX_GetPathInfo(const char* path, SDL_PathInfo* info) -{ - SDL_PathInfo tmp_info; - struct stat statbuf; - const int rc = stat(path, &statbuf); - - if (rc < 0) { - return SDL_SetError("Can't stat: %s", strerror(errno)); - } - else if (S_ISREG(statbuf.st_mode)) { - tmp_info.type = SDL_PATHTYPE_FILE; - tmp_info.size = (Uint64) statbuf.st_size; - } - else if (S_ISDIR(statbuf.st_mode)) { - tmp_info.type = SDL_PATHTYPE_DIRECTORY; - tmp_info.size = 0; - } - else { - tmp_info.type = SDL_PATHTYPE_OTHER; - tmp_info.size = (Uint64) statbuf.st_size; - } - - tmp_info.create_time = (SDL_Time) SDL_SECONDS_TO_NS(statbuf.st_ctime); - tmp_info.modify_time = (SDL_Time) SDL_SECONDS_TO_NS(statbuf.st_mtime); - tmp_info.access_time = (SDL_Time) SDL_SECONDS_TO_NS(statbuf.st_atime); - - if (info) { - *info = tmp_info; - } - - return true; -} diff --git a/ISLE/switch/filesys.h b/ISLE/switch/filesys.h deleted file mode 100644 index c7905090..00000000 --- a/ISLE/switch/filesys.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef NX_FILESYS_H -#define NX_FILESYS_H - -#include - -#define SDL_GetPathInfo NX_GetPathInfo // Override broken SDL_GetPathInfo -bool NX_GetPathInfo(const char* path, SDL_PathInfo* info); - -#endif // NX_FILESYS_H