From 73cc3dcf4e3d61e2ae0b5f8c8455454fe538e25d Mon Sep 17 00:00:00 2001 From: mathusummut Date: Thu, 4 Apr 2019 23:05:10 +0200 Subject: [PATCH] No more issues I think --- source/game/global/config.cpp | 4 +--- source/game/main/main.cpp | 6 ------ .../shared_lib/sources/platform/sdl/gl_wrap.cpp | 11 +++++------ source/shared_lib/sources/util/properties.cpp | 16 ---------------- 4 files changed, 6 insertions(+), 31 deletions(-) diff --git a/source/game/global/config.cpp b/source/game/global/config.cpp index eed48e53c..14dafcafa 100644 --- a/source/game/global/config.cpp +++ b/source/game/global/config.cpp @@ -217,9 +217,7 @@ namespace Game { #if defined(DATADIR) if (foundPath == false) { - foundPath = - tryCustomPath(cfgType, fileName, - formatPath(TOSTRING(DATADIR))); + foundPath = tryCustomPath(cfgType, fileName, endPathWithSlash(formatPath(TOSTRING(DATADIR)))); } #endif diff --git a/source/game/main/main.cpp b/source/game/main/main.cpp index 274e75f05..931b01eec 100644 --- a/source/game/main/main.cpp +++ b/source/game/main/main.cpp @@ -5737,12 +5737,6 @@ namespace Game { } PlatformExceptionHandler::disableBacktrace = disableBacktrace; -#if defined(DATADIR) - if (SystemFlags::VERBOSE_MODE_ENABLED) - printf("\n\nDATADIR = [%s]\n\n", - formatPath(TOSTRING(DATADIR)).c_str()); -#endif - const int knownArgCount = sizeof(GAME_ARGS) / sizeof(GAME_ARGS[0]); for (int idx = 1; idx < argc; ++idx) { diff --git a/source/shared_lib/sources/platform/sdl/gl_wrap.cpp b/source/shared_lib/sources/platform/sdl/gl_wrap.cpp index 1913d8d71..60d623321 100644 --- a/source/shared_lib/sources/platform/sdl/gl_wrap.cpp +++ b/source/shared_lib/sources/platform/sdl/gl_wrap.cpp @@ -225,16 +225,15 @@ namespace Shared { SDL_SetRelativeMouseMode(SDL_FALSE); SDL_SetRelativeMouseMode(SDL_TRUE); } - + #ifndef WIN32 string icon_file = ""; #if defined(DATADIR) - if (fileExists(formatPath(TOSTRING(DATADIR)) + "glest.png")) { - icon_file = formatPath(TOSTRING(DATADIR)) + "glest.png"; - } else if (fileExists(formatPath(TOSTRING(DATADIR)) + "glest.bmp")) { - icon_file = formatPath(TOSTRING(DATADIR)) + "glest.bmp"; + if (fileExists(endPathWithSlash(formatPath(TOSTRING(DATADIR))) + "glest.png")) { + icon_file = endPathWithSlash(formatPath(TOSTRING(DATADIR))) + "glest.png"; + } else if (fileExists(endPathWithSlash(formatPath(TOSTRING(DATADIR))) + "glest.bmp")) { + icon_file = endPathWithSlash(formatPath(TOSTRING(DATADIR))) + "glest.bmp"; } - #endif if (icon_file == "" && fileExists("glest.png")) { diff --git a/source/shared_lib/sources/util/properties.cpp b/source/shared_lib/sources/util/properties.cpp index 6a3cd50d7..a57709b4b 100644 --- a/source/shared_lib/sources/util/properties.cpp +++ b/source/shared_lib/sources/util/properties.cpp @@ -262,18 +262,10 @@ namespace Shared { mapTagReplacementValues["%%APPLICATIONPATH%%"] = Properties::applicationPath; mapTagReplacementValues["{APPLICATIONPATH}"] = Properties::applicationPath; -/*#if defined(DATADIR) - mapTagReplacementValues["$APPLICATIONDATAPATH"] = formatPath(TOSTRING(DATADIR)); - mapTagReplacementValues["%%APPLICATIONDATAPATH%%"] = formatPath(TOSTRING(DATADIR)); - mapTagReplacementValues["{APPLICATIONDATAPATH}"] = formatPath(TOSTRING(DATADIR)); - -#else*/ mapTagReplacementValues["$APPLICATIONDATAPATH"] = Properties::applicationDataPath; mapTagReplacementValues["%%APPLICATIONDATAPATH%%"] = Properties::applicationDataPath; mapTagReplacementValues["{APPLICATIONDATAPATH}"] = Properties::applicationDataPath; -//#endif - mapTagReplacementValues["{TECHTREEPATH}"] = Properties::techtreePath; mapTagReplacementValues["{SCENARIOPATH}"] = Properties::scenarioPath; mapTagReplacementValues["{TUTORIALPATH}"] = Properties::tutorialPath; @@ -395,18 +387,10 @@ namespace Shared { replaceAll(value, "%%APPLICATIONPATH%%", Properties::applicationPath); replaceAll(value, "{APPLICATIONPATH}", Properties::applicationPath); -/*#if defined(DATADIR) - replaceAll(value, "$APPLICATIONDATAPATH", formatPath(TOSTRING(DATADIR))); - replaceAll(value, "%%APPLICATIONDATAPATH%%", formatPath(TOSTRING(DATADIR))); - replaceAll(value, "{APPLICATIONDATAPATH}", formatPath(TOSTRING(DATADIR))); - -#else*/ replaceAll(value, "$APPLICATIONDATAPATH", Properties::applicationDataPath); replaceAll(value, "%%APPLICATIONDATAPATH%%", Properties::applicationDataPath); replaceAll(value, "{APPLICATIONDATAPATH}", Properties::applicationDataPath); -//#endif - replaceAll(value, "{TECHTREEPATH}", Properties::techtreePath); // if(value.find("{SCENARIOPATH}") != string::npos) { // printf("\n\n** WILL REPLACE [%s]\n",value.c_str());