summaryrefslogtreecommitdiffstats
path: root/src/app/gamedata.cpp
diff options
context:
space:
mode:
authorPiotr Dziwiński <piotrdz@gmail.com>2014-06-24 19:42:25 +0200
committerPiotr Dziwiński <piotrdz@gmail.com>2014-06-24 19:42:25 +0200
commitae13e0a62121d7fc8fa5ec5769ea5e7125443146 (patch)
treee2d5883e04bd01342f51d6457a130d663fc5eafd /src/app/gamedata.cpp
parent52cf9e2815688481f689e03e67c5fc983ed1351b (diff)
parentf5ba2a27d4422401317d814c60048121f9804429 (diff)
downloadcolobot-ae13e0a62121d7fc8fa5ec5769ea5e7125443146.tar.gz
colobot-ae13e0a62121d7fc8fa5ec5769ea5e7125443146.tar.bz2
colobot-ae13e0a62121d7fc8fa5ec5769ea5e7125443146.zip
Merge pull request #304 from MohamedWaheed/dev
Savefile screenshot implementation and screenshot loading bug fix
Diffstat (limited to 'src/app/gamedata.cpp')
-rw-r--r--src/app/gamedata.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/app/gamedata.cpp b/src/app/gamedata.cpp
index 1bf3f36..05c0242 100644
--- a/src/app/gamedata.cpp
+++ b/src/app/gamedata.cpp
@@ -78,16 +78,22 @@ std::string CGameData::GetFilePath(DataDir dir, const std::string& subpath)
for(std::vector<std::string>::reverse_iterator rit = m_dataDirs.rbegin(); rit != m_dataDirs.rend(); ++rit) {
std::stringstream str;
- str << *rit;
- str << "/";
- str << m_standardDataDirs[index];
- if (dir == DIR_HELP)
- {
+
+ if ( subpath.find("save") == std::string::npos ){ // if its NOT a path to a savefile screenshot
+ str << *rit;
+ str << "/";
+ str << m_standardDataDirs[index];
+
+ if (dir == DIR_HELP)
+ {
+ str << "/";
+ str << CApplication::GetInstancePointer()->GetLanguageChar();
+ }
str << "/";
- str << CApplication::GetInstancePointer()->GetLanguageChar();
}
- str << "/";
+
str << subpath;
+
boost::filesystem::path path(str.str());
if(boost::filesystem::exists(path))
{
@@ -95,18 +101,9 @@ std::string CGameData::GetFilePath(DataDir dir, const std::string& subpath)
}
}
- std::stringstream str;
- str << m_dataDirs[0];
- str << "/";
- str << m_standardDataDirs[index];
- if (dir == DIR_HELP)
- {
- str << "/";
- str << CApplication::GetInstancePointer()->GetLanguageChar();
- }
- str << "/";
- str << subpath;
- return str.str();
+ GetLogger()->Error("file subpath error\n");
+
+ return "";
}
std::string CGameData::GetDataPath(const std::string &subpath)