summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dirs.cpp8
-rw-r--r--src/game.cpp5
2 files changed, 10 insertions, 3 deletions
diff --git a/src/dirs.cpp b/src/dirs.cpp
index 7dc53803b..f1c9e9550 100644
--- a/src/dirs.cpp
+++ b/src/dirs.cpp
@@ -537,6 +537,9 @@ void Dirs::initScreenshotDir()
}
else if (settings.screenshotDir.empty())
{
+#ifdef __native_client__
+ settings.screenshotDir = _nacl_dir + "/screenshots/";
+#else // __native_client__
settings.screenshotDir = decodeBase64String(
config.getStringValue("screenshotDirectory3"));
if (settings.screenshotDir.empty())
@@ -552,9 +555,9 @@ void Dirs::initScreenshotDir()
_("Error: %s doesn't exist and can't be created! "
"Exiting."), settings.screenshotDir.c_str()));
}
-#else
+#else // ANDROID
settings.screenshotDir = getPicturesDir();
-#endif
+#endif // ANDROID
if (config.getBoolValue("useScreenshotDirectorySuffix"))
{
const std::string configScreenshotSuffix =
@@ -569,6 +572,7 @@ void Dirs::initScreenshotDir()
config.setValue("screenshotDirectory3",
encodeBase64String(settings.screenshotDir));
}
+#endif // __native_client__
}
logger->log("screenshotDirectory: " + settings.screenshotDir);
}
diff --git a/src/game.cpp b/src/game.cpp
index a00caadfa..4fd84cfcb 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -562,7 +562,10 @@ bool Game::saveScreenshot(SDL_Surface *const screenshot)
const std::string fileNameStr = filename.str();
const bool success = ImageWriter::writePNG(screenshot, fileNameStr);
#ifdef __native_client__
- naclPostMessage("copy-from-persistent", fileNameStr);
+ std::string nacScreenshotlDir = fileNameStr;
+ cutFirst(nacScreenshotlDir, "/persistent");
+ naclPostMessage("copy-from-persistent", nacScreenshotlDir);
+ logger->log("nacl screenshot path: " + nacScreenshotlDir);
#endif
if (success)
{