mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-02 19:12:47 +02:00
Android: Ensure that the target folder for screenshots exists before attempting to save.
This commit is contained in:
parent
8ca620db7f
commit
7935c1c57a
@ -636,7 +636,7 @@ EState GetState()
|
||||
return CORE_UNINITIALIZED;
|
||||
}
|
||||
|
||||
static std::string GenerateScreenshotName()
|
||||
static std::string GenerateScreenshotFolderPath()
|
||||
{
|
||||
const std::string& gameId = SConfig::GetInstance().GetUniqueID();
|
||||
std::string path = File::GetUserPath(D_SCREENSHOTS_IDX) + gameId + DIR_SEP_CHR;
|
||||
@ -647,8 +647,15 @@ static std::string GenerateScreenshotName()
|
||||
path = File::GetUserPath(D_SCREENSHOTS_IDX);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
static std::string GenerateScreenshotName()
|
||||
{
|
||||
std::string path = GenerateScreenshotFolderPath();
|
||||
|
||||
//append gameId, path only contains the folder here.
|
||||
path += gameId;
|
||||
path += SConfig::GetInstance().GetUniqueID();
|
||||
|
||||
std::string name;
|
||||
for (int i = 1; File::Exists(name = StringFromFormat("%s-%d.png", path.c_str(), i)); ++i)
|
||||
@ -671,15 +678,13 @@ void SaveScreenShot()
|
||||
SetState(CORE_RUN);
|
||||
}
|
||||
|
||||
void SaveScreenShot(std::string name)
|
||||
void SaveScreenShot(const std::string name)
|
||||
{
|
||||
const bool bPaused = (GetState() == CORE_PAUSE);
|
||||
|
||||
SetState(CORE_PAUSE);
|
||||
|
||||
const std::string& gameId = SConfig::GetInstance().GetUniqueID();
|
||||
|
||||
std::string filePath = File::GetUserPath(D_SCREENSHOTS_IDX) + gameId + DIR_SEP_CHR + name + ".png";
|
||||
std::string filePath = GenerateScreenshotFolderPath() + name + ".png";
|
||||
|
||||
g_video_backend->Video_Screenshot(filePath);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user