From 21fafa95769bc83240f940ac5188d166523cc6d9 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 1 Jan 2023 17:20:04 +0200 Subject: [PATCH] When deciding screenshot name: check also CD0: if DF0: exists but is empty. --- od-win32/screenshot.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/od-win32/screenshot.cpp b/od-win32/screenshot.cpp index aefe9d36..c05fb7d9 100644 --- a/od-win32/screenshot.cpp +++ b/od-win32/screenshot.cpp @@ -1106,6 +1106,15 @@ static void screenshot_prepare_multi(void) static int filenumber = 0; static int dirnumber = 1; +static void getscreenshotfilename(TCHAR *name) +{ + if (currprefs.floppyslots[0].dfxtype >= 0 && currprefs.floppyslots[0].df[0]) { + _tcscpy(name, currprefs.floppyslots[0].df); + } else if (currprefs.cdslots[0].inuse) { + _tcscpy(name, currprefs.cdslots[0].name); + } +} + /* Captures the Amiga display (GDI, D3D) surface and saves it to file as a 24bit bitmap. */ @@ -1185,12 +1194,8 @@ int screenshotf(int monid, const TCHAR *spath, int mode, int doprepare, int imag CreateDirectory(path, NULL); } - name[0] = 0; - if (currprefs.floppyslots[0].dfxtype >= 0) - _tcscpy (name, currprefs.floppyslots[0].df); - else if (currprefs.cdslots[0].inuse) - _tcscpy (name, currprefs.cdslots[0].name); + getscreenshotfilename(name); if (!name[0]) underline[0] = 0; namesplit (name); -- 2.47.3