From 5cd81033c3d23d7da8cd0f56a03806fed1b0daf5 Mon Sep 17 00:00:00 2001 From: "j4ck.fr0st" Date: Fri, 15 Jan 2010 16:11:06 +0000 Subject: [PATCH] Taking screenshots now creates an extra folder for each Game ID. Fixes Issue 1905 git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4842 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/Core.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index a5fc0a91dd..593f4743ef 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -519,10 +519,17 @@ static inline std::string GenerateScreenshotName() { int index = 1; std::string tempname, name; - tempname = FULL_SCREENSHOTS_DIR + GetStartupParameter().GetUniqueID(); + std::string gameId = GetStartupParameter().GetUniqueID(); + tempname = FULL_SCREENSHOTS_DIR + gameId + DIR_SEP_CHR; + + if (!File::CreateFullPath(tempname.c_str())) { + //fallback to old-style screenshots, without folder. + tempname = FULL_SCREENSHOTS_DIR; + } + //append gameId, tempname only contains the folder here. + tempname += gameId; name = StringFromFormat("%s-%d.png", tempname.c_str(), index); - while(File::Exists(name.c_str())) name = StringFromFormat("%s-%d.png", tempname.c_str(), ++index);