From 6dfe2fc05ffc08051286f953e748f9800e8e9192 Mon Sep 17 00:00:00 2001 From: Ludvig Strigeus Date: Thu, 18 Apr 2002 08:35:17 +0000 Subject: Now uses proper directory for savegames. svn-id: r3993 --- simon/simon.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'simon') diff --git a/simon/simon.cpp b/simon/simon.cpp index 67cd5a4c06..2d117a1a1e 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -8080,8 +8080,14 @@ bool SimonState::save_game(uint slot, const char *caption) { } char *SimonState::gen_savename(int slot) { - static char buf[128]; - sprintf(buf, "SAVE.%.3d", slot); + static char buf[256]; + const char *dir; + + /* perhaps getenv should be added to OSystem */ + dir = getenv("SCUMMVM_SAVEPATH"); + if (dir == NULL) dir = ""; + + sprintf(buf, "%sSAVE.%.3d", dir, slot); return buf; } @@ -8094,7 +8100,7 @@ bool SimonState::load_game(uint slot) { errno = 0; - f = fopen_maybe_lowercase(gen_savename(slot)); + f = fopen(gen_savename(slot), "rb"); if (f==NULL) return false; -- cgit v1.2.3