From 06d0a19e95ee54eca46128844357c22907f7d106 Mon Sep 17 00:00:00 2001 From: orbea Date: Thu, 27 Dec 2018 12:57:55 -0800 Subject: [PATCH] Fix png file names for screenshots with contentless cores. For contentless cores like 2048 and the retropad RetroArch will save png files with the content field missing. -181227-133151.png Now RetroArch will save png files with the correct names for contentless cores. 2048-181227-133151.png RetroPad Remote-181227-133202.png Cores with content will have no change in behavior. Akumajou Dracula (J)-181227-133232.png And with cores that support content and no content such as 4DO both variations will work. 4DO-181227-144102.png LuciennesQuest-181227-144118.png Fixes https://github.com/libretro/RetroArch/issues/7828 --- tasks/task_screenshot.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index 2ea95618ac..d84167bf00 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -195,10 +195,14 @@ static bool screenshot_dump( calloc(1, sizeof(*state)); const char *screenshot_dir = settings->paths.directory_screenshot; char shotname[256]; + struct retro_system_info system_info; shotname[0] = '\0'; screenshot_path[0] = '\0'; + if (!core_get_system_info(&system_info)) + return false; + /* If fullpath is true, name_base already contains a static path + filename to save the screenshot to. */ if (fullpath) strlcpy(state->filename, name_base, sizeof(state->filename)); @@ -232,8 +236,14 @@ static bool screenshot_dump( else { if (settings->bools.auto_screenshot_filename) - fill_str_dated_filename(shotname, path_basename(name_base), - IMG_EXT, sizeof(shotname)); + { + if (path_is_empty(RARCH_PATH_CONTENT)) + fill_str_dated_filename(shotname, system_info.library_name, + IMG_EXT, sizeof(shotname)); + else + fill_str_dated_filename(shotname, path_basename(name_base), + IMG_EXT, sizeof(shotname)); + } else snprintf(shotname, sizeof(shotname), "%s.png", path_basename(name_base));