Browse Source

Add GOG installation paths to game data search paths (fixes #2709) (#2748)

pull/2758/head
Cong 5 years ago committed by GitHub
parent
commit
6091c3f3c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      3rdParty/find_steam_game/CMakeLists.txt
  2. 8
      CMakeLists.txt
  3. 11
      Source/init.cpp

11
3rdParty/find_steam_game/CMakeLists.txt vendored

@ -0,0 +1,11 @@
include(FetchContent_MakeAvailableExcludeFromAll)
include(FetchContent)
FetchContent_Declare(find_steam_game
URL https://github.com/cxong/find_steam_game/archive/94e9046bcf94a655bdc051b6e6662fabd18e3f30.zip
URL_HASH MD5=c2742aff3d2a2dd162200fdab1b2b4a4
)
FetchContent_MakeAvailableExcludeFromAll(find_steam_game)
add_library(find_steam_game INTERFACE)
target_include_directories(find_steam_game INTERFACE ${find_steam_game_SOURCE_DIR})

8
CMakeLists.txt

@ -290,6 +290,10 @@ add_library(smacker STATIC
3rdParty/libsmacker/smacker.c) 3rdParty/libsmacker/smacker.c)
target_include_directories(smacker PUBLIC 3rdParty/libsmacker) target_include_directories(smacker PUBLIC 3rdParty/libsmacker)
if(WIN32)
add_subdirectory(3rdParty/find_steam_game)
endif()
add_subdirectory(3rdParty/simpleini) add_subdirectory(3rdParty/simpleini)
add_library(StormLib STATIC add_library(StormLib STATIC
@ -645,6 +649,10 @@ target_link_libraries(libdevilutionx PUBLIC
smacker smacker
simpleini) simpleini)
if(WIN32)
target_link_libraries(libdevilutionx PUBLIC find_steam_game)
endif()
if(NOT NONET) if(NOT NONET)
if(NOT DISABLE_TCP) if(NOT DISABLE_TCP)
target_link_libraries(libdevilutionx PUBLIC asio) target_link_libraries(libdevilutionx PUBLIC asio)

11
Source/init.cpp

@ -8,6 +8,10 @@
#include <string> #include <string>
#include <vector> #include <vector>
#if defined(_WIN64) || defined(_WIN32)
#include <find_steam_game.h>
#endif
#include "DiabloUI/diabloui.h" #include "DiabloUI/diabloui.h"
#include "dx.h" #include "dx.h"
#include "pfile.h" #include "pfile.h"
@ -148,6 +152,13 @@ void init_archives()
paths.emplace_back("/usr/local/share/diasurgical/devilutionx/"); paths.emplace_back("/usr/local/share/diasurgical/devilutionx/");
#elif defined(__3DS__) #elif defined(__3DS__)
paths.emplace_back("romfs:/"); paths.emplace_back("romfs:/");
#elif defined(_WIN64) || defined(_WIN32)
char gogpath[_FSG_PATH_MAX];
fsg_get_gog_game_path(gogpath, "1412601690");
if (strlen(gogpath) > 0) {
paths.emplace_back(std::string(gogpath) + "/");
paths.emplace_back(std::string(gogpath) + "/hellfire/");
}
#endif #endif
paths.emplace_back(""); // PWD paths.emplace_back(""); // PWD

Loading…
Cancel
Save