mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-08-29 08:17:38 -04:00
Merge branch 'main' into sse
This commit is contained in:
commit
5931c6eab4
37 changed files with 739 additions and 147 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "../../game/skeldal.h"
|
||||
#include "../getopt.h"
|
||||
#include "../platform.h"
|
||||
#include "../error.h"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
@ -86,7 +87,7 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
} catch (const std::exception &e) {
|
||||
cfg.show_error(e.what());
|
||||
cfg.show_error(exception_to_string(e).c_str());
|
||||
return 1;
|
||||
}
|
||||
catch (...) {
|
||||
|
|
|
@ -15,13 +15,17 @@ std::string getSavedGamesDirectory() {
|
|||
PWSTR path = nullptr;
|
||||
if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_SavedGames, 0, NULL, &path))) {
|
||||
fs::path savedGamesPath(path);
|
||||
CoTaskMemFree(path);
|
||||
return (savedGamesPath / SAVEGAME_FOLDERNAME).string();
|
||||
CoTaskMemFree(path);
|
||||
|
||||
// Převod na UTF-8 std::string
|
||||
std::u8string utf8 = (savedGamesPath / SAVEGAME_FOLDERNAME).u8string();
|
||||
return std::string(reinterpret_cast<const char*>(utf8.data()), utf8.size());
|
||||
} else {
|
||||
display_error("Failed to retrieve FOLDEROD_SavedGames");
|
||||
display_error("Failed to retrieve FOLDERID_SavedGames");
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
const char *get_default_savegame_directory() {
|
||||
|
||||
static std::string dir = getSavedGamesDirectory();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue