From 18009115903b1614aa6a4665f8946f7d1cea2e0d Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Sun, 5 Jan 2025 13:38:34 +0100 Subject: [PATCH] bugfix: ensure screenshot is generated even when using Quick Save State - When using the shortcuts for Quick Save state (END + SHIFT + numpad key), no screenshot was generated. --- src/osdep/gui/gui_handling.h | 1 - src/osdep/target.h | 1 + src/savestate.cpp | 4 ++++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osdep/gui/gui_handling.h b/src/osdep/gui/gui_handling.h index e497825fa..1898351b4 100644 --- a/src/osdep/gui/gui_handling.h +++ b/src/osdep/gui/gui_handling.h @@ -410,7 +410,6 @@ extern void new_harddrive(int entry); extern void inithdcontroller(int ctype, int ctype_unit, int devtype, bool media); -extern std::string screenshot_filename; extern int current_state_num; extern int delay_savestate_frame; extern int last_x; diff --git a/src/osdep/target.h b/src/osdep/target.h index 3b3bc6d22..0cde7d67c 100644 --- a/src/osdep/target.h +++ b/src/osdep/target.h @@ -40,6 +40,7 @@ extern int mouseactive; extern int minimized; extern int monitor_off; extern bool joystick_refresh_needed; +extern std::string screenshot_filename; extern void logging_init(); diff --git a/src/savestate.cpp b/src/savestate.cpp index a6fa74511..ae8a8c553 100644 --- a/src/savestate.cpp +++ b/src/savestate.cpp @@ -1348,6 +1348,10 @@ void savestate_quick(int slot, int save) savestate_flags |= SAVESTATE_NODIALOGS; savestate_flags |= SAVESTATE_ALWAYSUSEPATH; save_state (savestate_fname, _T("")); +#ifdef AMIBERRY + if (create_screenshot()) + save_thumb(screenshot_filename); +#endif } else { if (!zfile_exists (savestate_fname)) { write_log (_T("staterestore, file '%s' not found\n"), savestate_fname);