From dfd4a658aae825de9faeb11b160d2bca15de7b20 Mon Sep 17 00:00:00 2001 From: mathusummut Date: Fri, 29 Jun 2018 16:14:38 +0200 Subject: [PATCH] Test fix for LUA environment variables --- source/glest_game/types/faction_type.cpp | 1 - source/glest_game/world/scenario.cpp | 5 +---- source/shared_lib/include/util/properties.h | 7 +++++++ .../shared_lib/sources/graphics/gl/model_renderer_gl.cpp | 5 +++-- source/shared_lib/sources/util/properties.cpp | 1 + 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/source/glest_game/types/faction_type.cpp b/source/glest_game/types/faction_type.cpp index 4bdc03967..676a42778 100644 --- a/source/glest_game/types/faction_type.cpp +++ b/source/glest_game/types/faction_type.cpp @@ -467,7 +467,6 @@ namespace Glest { for (int i = 0; i < (int) scriptsNode->getChildCount(); ++i) { const XmlNode *scriptNode = scriptsNode->getChild(i); - scripts.push_back(Script(getFunctionName(scriptNode), scriptNode->getText())); } } diff --git a/source/glest_game/world/scenario.cpp b/source/glest_game/world/scenario.cpp index 7e35cae0e..5efe7599a 100644 --- a/source/glest_game/world/scenario.cpp +++ b/source/glest_game/world/scenario.cpp @@ -102,10 +102,7 @@ namespace Glest { for (int i = 0; i < (int) scriptsNode->getChildCount(); ++i) { const XmlNode *scriptNode = scriptsNode->getChild(i); - - scripts.push_back(Script - (getFunctionName(scriptNode), - scriptNode->getText())); + scripts.push_back(Script(getFunctionName(scriptNode), scriptNode->getText())); } } //Exception handling (conversions and so on); diff --git a/source/shared_lib/include/util/properties.h b/source/shared_lib/include/util/properties.h index 6ddaf0690..a87cb3388 100644 --- a/source/shared_lib/include/util/properties.h +++ b/source/shared_lib/include/util/properties.h @@ -16,6 +16,7 @@ #include #include #include "leak_dumper.h" +#include "platform_common.h" using std::map; using std::vector; @@ -60,6 +61,7 @@ namespace Shared { public: static void setApplicationPath(string value) { + Shared::PlatformCommon::replaceAll(value, "\\", "/"); applicationPath = value; } static string getApplicationPath() { @@ -67,6 +69,7 @@ namespace Shared { } static void setApplicationDataPath(string value) { + Shared::PlatformCommon::replaceAll(value, "\\", "/"); applicationDataPath = value; } static string getApplicationDataPath() { @@ -74,6 +77,7 @@ namespace Shared { } static void setGameVersion(string value) { + Shared::PlatformCommon::replaceAll(value, "\\", "/"); gameVersion = value; } static string getGameVersion() { @@ -81,18 +85,21 @@ namespace Shared { } static void setTechtreePath(string value) { + Shared::PlatformCommon::replaceAll(value, "\\", "/"); techtreePath = value; } static string getTechtreePath() { return techtreePath; } static void setScenarioPath(string value) { + Shared::PlatformCommon::replaceAll(value, "\\", "/"); scenarioPath = value; } static string getScenarioPath() { return scenarioPath; } static void setTutorialPath(string value) { + Shared::PlatformCommon::replaceAll(value, "\\", "/"); tutorialPath = value; } static string getTutorialPath() { diff --git a/source/shared_lib/sources/graphics/gl/model_renderer_gl.cpp b/source/shared_lib/sources/graphics/gl/model_renderer_gl.cpp index fe866bfe9..38565554e 100644 --- a/source/shared_lib/sources/graphics/gl/model_renderer_gl.cpp +++ b/source/shared_lib/sources/graphics/gl/model_renderer_gl.cpp @@ -17,7 +17,9 @@ #include "interpolation.h" #include "leak_dumper.h" +#ifndef FLT_EPSILON #define FLT_EPSILON 1.192092896e-07F +#endif using namespace Shared::Platform; @@ -28,8 +30,7 @@ namespace Shared { void MeshCallback::execute(const Mesh *mesh, float alpha) { alpha *= mesh->getOpacity(); - //team color - uint8 factionOpacity = mesh->getFactionColorOpacity(); + uint8 factionOpacity = mesh->getFactionColorOpacity(); //team color float color[4]; color[0] = 1.0f; // Red color[1] = 1.0f; // Green diff --git a/source/shared_lib/sources/util/properties.cpp b/source/shared_lib/sources/util/properties.cpp index d2f797ba0..d95fc9fae 100644 --- a/source/shared_lib/sources/util/properties.cpp +++ b/source/shared_lib/sources/util/properties.cpp @@ -234,6 +234,7 @@ namespace Shared { //string appPath=""; //appPath.assign(&pMBBuffer[0]); // Now assign the char* to the string, and there you have it!!! :) std::string appPath = utf8_encode(szPath); + replaceAll(appPath, "\\", "/"); //string appPath = szPath; mapTagReplacementValues["$APPDATA"] = appPath;