diff options
author | Ludvig Strigeus | 2002-04-18 08:35:17 +0000 |
---|---|---|
committer | Ludvig Strigeus | 2002-04-18 08:35:17 +0000 |
commit | 6dfe2fc05ffc08051286f953e748f9800e8e9192 (patch) | |
tree | e8eb7cd3838f5a7c498e8e92c1aff57c2d2a1976 /simon | |
parent | e5009674bf3858720ae2987552ba358dd75969f6 (diff) | |
download | scummvm-rg350-6dfe2fc05ffc08051286f953e748f9800e8e9192.tar.gz scummvm-rg350-6dfe2fc05ffc08051286f953e748f9800e8e9192.tar.bz2 scummvm-rg350-6dfe2fc05ffc08051286f953e748f9800e8e9192.zip |
Now uses proper directory for savegames.
svn-id: r3993
Diffstat (limited to 'simon')
-rw-r--r-- | simon/simon.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
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; |