mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
Merge pull request #19 from GooborgStudios/master
Re-add case-insensitive search for "fonts" folder, update steamshim's CMake instructions
This commit is contained in:
commit
0773b52aae
4 changed files with 54 additions and 36 deletions
|
|
@ -315,37 +315,39 @@ IF(APPLE)
|
|||
ENDIF()
|
||||
|
||||
# Steamshim
|
||||
IF(NOT WIN32)
|
||||
set(STEAMSHIM_SOURCES
|
||||
steamshim_parent/steamshim_parent.cpp
|
||||
)
|
||||
IF(STEAM)
|
||||
IF(NOT WIN32)
|
||||
set(STEAMSHIM_SOURCES
|
||||
steamshim_parent/steamshim_parent.cpp
|
||||
)
|
||||
|
||||
include_directories(${STEAMWORKS_PATH}/public)
|
||||
include_directories(${STEAMWORKS_PATH}/public)
|
||||
|
||||
add_definitions(-DGAME_LAUNCH_NAME="${GAME_LAUNCH_NAME}")
|
||||
add_definitions(-DGAME_LAUNCH_NAME="${GAME_LAUNCH_NAME}")
|
||||
|
||||
IF(DEBUG)
|
||||
add_definitions(-DSTEAMSHIM_DEBUG)
|
||||
ENDIF()
|
||||
IF(DEBUG)
|
||||
add_definitions(-DSTEAMSHIM_DEBUG)
|
||||
ENDIF()
|
||||
|
||||
IF(APPLE)
|
||||
link_directories(${STEAMWORKS_PATH}/redistributable_bin/osx32)
|
||||
ELSEIF(WIN32)
|
||||
list(APPEND STEAMSHIM_SOURCES steamshim_parent/resources.rc)
|
||||
link_directories(${STEAMWORKS_PATH}/redistributable_bin/win64)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mwindows")
|
||||
ELSEIF(LINUX)
|
||||
link_directories(${STEAMWORKS_PATH}/redistributable_bin/linux64)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
|
||||
ENDIF()
|
||||
IF(APPLE)
|
||||
link_directories(${STEAMWORKS_PATH}/redistributable_bin/osx32)
|
||||
ELSEIF(WIN32)
|
||||
list(APPEND STEAMSHIM_SOURCES steamshim_parent/resources.rc)
|
||||
link_directories(${STEAMWORKS_PATH}/redistributable_bin/win64)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mwindows")
|
||||
ELSEIF(LINUX)
|
||||
link_directories(${STEAMWORKS_PATH}/redistributable_bin/linux64)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
|
||||
ENDIF()
|
||||
|
||||
add_executable(steamshim
|
||||
${STEAMSHIM_SOURCES}
|
||||
)
|
||||
add_executable(steamshim
|
||||
${STEAMSHIM_SOURCES}
|
||||
)
|
||||
|
||||
IF(WIN32)
|
||||
target_link_libraries(steamshim steam_api64)
|
||||
ELSE()
|
||||
target_link_libraries(steamshim steam_api)
|
||||
IF(WIN32)
|
||||
target_link_libraries(steamshim steam_api64)
|
||||
ELSE()
|
||||
target_link_libraries(steamshim steam_api)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ Thanks to [hunternet93](https://github.com/hunternet93) for starting the reimple
|
|||
* Ruby
|
||||
* Python 3 (journal reimplementation only)
|
||||
* PyQt5 for Python 3 (journal reimplementation only)
|
||||
* Steamworks SDK (optional, place contents of sdk folder in ZIP into "steamworks" folder in root)
|
||||
|
||||
### Building with Conan
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@ cd `dirname $0`
|
|||
mac_version="1.1.0"
|
||||
make_threads=8
|
||||
ONESHOT_PATH=$HOME/Library/Application\ Support/Steam/steamapps/common/OneShot
|
||||
STEAMWORKS_PATH=$HOME/Developer/downloaded/steamworks
|
||||
|
||||
# Colors
|
||||
white="\033[0;37m" # White - Regular
|
||||
bold="\033[1;37m" # White - Bold
|
||||
|
|
@ -30,7 +28,7 @@ if [[ $use_qmake == True ]]
|
|||
echo "-> ${cyan}Compile steamshim...${color_reset}"
|
||||
cd steamshim_parent
|
||||
mkdir build && cd build
|
||||
cmake -DSTEAMWORKS_PATH=${STEAMWORKS_PATH} ..
|
||||
cmake ..
|
||||
make -j${make_threads}
|
||||
cd ../..
|
||||
else
|
||||
|
|
|
|||
|
|
@ -40,11 +40,8 @@
|
|||
#include <stack>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define OS_OSX
|
||||
#endif
|
||||
|
||||
#ifdef OS_OSX
|
||||
#include <iconv.h>
|
||||
#define OS_OSX
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
|
||||
struct SDLRWIoContext
|
||||
|
|
@ -465,7 +462,7 @@ struct FontSetsCBData
|
|||
};
|
||||
|
||||
static PHYSFS_EnumerateCallbackResult
|
||||
findFontsFolderCB (void *data, const char *dir, const char *fname)
|
||||
fontSetEnumCB (void *data, const char *dir, const char *fname)
|
||||
{
|
||||
FontSetsCBData *d = static_cast<FontSetsCBData*>(data);
|
||||
|
||||
|
|
@ -503,11 +500,31 @@ findFontsFolderCB (void *data, const char *dir, const char *fname)
|
|||
return PHYSFS_ENUM_OK;
|
||||
}
|
||||
|
||||
/* Basically just a case-insensitive search
|
||||
* for the folder "Fonts"... */
|
||||
static PHYSFS_EnumerateCallbackResult
|
||||
findFontsFolderCB(void *data, const char *, const char *fname)
|
||||
{
|
||||
size_t i = 0;
|
||||
char buffer[512];
|
||||
const char *s = fname;
|
||||
|
||||
while (s && i < sizeof(buffer))
|
||||
buffer[i++] = tolower(*s++);
|
||||
|
||||
buffer[i] = '\0';
|
||||
|
||||
if (strcmp(buffer, "fonts") == 0)
|
||||
PHYSFS_enumerate(fname, fontSetEnumCB, data);
|
||||
|
||||
return PHYSFS_ENUM_OK;
|
||||
}
|
||||
|
||||
void FileSystem::initFontSets(SharedFontState &sfs)
|
||||
{
|
||||
FontSetsCBData d = { p, &sfs };
|
||||
|
||||
PHYSFS_enumerate("Fonts", findFontsFolderCB, &d);
|
||||
PHYSFS_enumerate("", findFontsFolderCB, &d);
|
||||
}
|
||||
|
||||
struct OpenReadEnumData
|
||||
|
|
|
|||
Loading…
Reference in a new issue