Merge pull request #7829 from orbea/screenshot

Fix png file names for screenshots with contentless cores.
This commit is contained in:
Twinaphex 2018-12-28 00:35:18 +01:00 committed by GitHub
commit d8468c5d8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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));