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

This commit is contained in:
Cong 2021-08-30 22:00:21 +10:00 committed by GitHub
commit 6091c3f3c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 0 deletions

View file

@ -8,6 +8,10 @@
#include <string>
#include <vector>
#if defined(_WIN64) || defined(_WIN32)
#include <find_steam_game.h>
#endif
#include "DiabloUI/diabloui.h"
#include "dx.h"
#include "pfile.h"
@ -148,6 +152,13 @@ void init_archives()
paths.emplace_back("/usr/local/share/diasurgical/devilutionx/");
#elif defined(__3DS__)
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
paths.emplace_back(""); // PWD