Skip to content

Commit

Permalink
Create the screenshots directory in SDLPoP's directory, even if the c…
Browse files Browse the repository at this point in the history
…urrent directory is something else.
  • Loading branch information
NagyD committed Nov 28, 2020
1 parent e7dfc88 commit 967c507
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/ChangeLog.txt
Expand Up @@ -583,3 +583,4 @@ DONE: A scrollbar appears in the pause menu if scrolling is possible.
It's not clickable yet, it just shows where you are in the list.
DONE: Added command-line parameter "playdemo": Make the demo level playable.
FIXED: Fixed the detection of Ctrl+L during the demo level.
FIXED: Create the screenshots directory in SDLPoP's directory, even if the current directory is something else.
4 changes: 3 additions & 1 deletion src/screenshot.c
Expand Up @@ -22,12 +22,14 @@ The authors of this program may be contacted at https://forum.princed.org

#ifdef USE_SCREENSHOT

const char screenshots_folder[] = "screenshots";
char screenshots_folder[POP_MAX_PATH] = "screenshots";
char screenshot_filename[POP_MAX_PATH] = "screenshot.png";
int screenshot_index = 0;

// Use incrementing numbers and a separate folder, like DOSBox.
void make_screenshot_filename() {
// Create the screenshots directory in SDLPoP's directory, even if the current directory is something else.
strncpy(screenshots_folder, locate_file("screenshots"), sizeof(screenshots_folder));
// Create the folder if it doesn't exist yet:
#if defined WIN32 || _WIN32 || WIN64 || _WIN64
mkdir (screenshots_folder);
Expand Down

0 comments on commit 967c507

Please sign in to comment.