diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-06-16 01:39:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-06-16 02:24:22 +0300 |
commit | 654285675ececa142877d86e6f730d040625fc6e (patch) | |
tree | c57e7d21a3b61acd2e1a179152dcb909ce1ececa /src/configuration.cpp | |
parent | 103aa3f43e457ebfcd32fe5ea4624539dd32978d (diff) | |
download | manaverse-654285675ececa142877d86e6f730d040625fc6e.tar.gz manaverse-654285675ececa142877d86e6f730d040625fc6e.tar.bz2 manaverse-654285675ececa142877d86e6f730d040625fc6e.tar.xz manaverse-654285675ececa142877d86e6f730d040625fc6e.zip |
Add dataPath to branding.
Diffstat (limited to 'src/configuration.cpp')
-rw-r--r-- | src/configuration.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/configuration.cpp b/src/configuration.cpp index abeb4b2af..7969c9341 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -30,6 +30,11 @@ #include <libxml/encoding.h> +#include <stdlib.h> +#ifdef WIN32 +#define realpath(N,R) _fullpath((R),(N),_MAX_PATH) +#endif + #include "debug.h" #ifdef DEBUG_CONFIG @@ -388,9 +393,17 @@ void Configuration::init(const std::string &filename, bool useResManager) XML::Document doc(filename, useResManager); if (useResManager) + { mConfigPath = "PhysFS://" + filename; + mDirectory = ""; + } else + { mConfigPath = filename; + char *realPath = realpath(getFileDir(filename).c_str(), NULL); + mDirectory = realPath; + free(realPath); + } if (!doc.rootNode()) { |