diff -ur ScummVM-cvs20020729/scummvm/saveload.cpp ScummVM-cvs20020729+simon/scummvm/saveload.cpp
old
|
new
|
|
164 | 164 | return true; |
165 | 165 | } |
166 | 166 | |
167 | | void Scumm::makeSavegameName(char *out, int slot, bool compatible) |
| 167 | const char *Scumm::getSavegameDir() |
168 | 168 | { |
169 | | |
170 | 169 | const char *dir = NULL; |
171 | 170 | |
172 | 171 | #ifdef _WIN32_WCE |
… |
… |
|
190 | 189 | dir = ""; |
191 | 190 | #endif |
192 | 191 | |
| 192 | return dir; |
| 193 | } |
| 194 | |
| 195 | void Scumm::makeSavegameName(char *out, int slot, bool compatible) |
| 196 | { |
193 | 197 | // snprintf should be used here, but it's not portable enough |
194 | | sprintf(out, "%s%s.%c%.2d", dir, _exe_name, compatible ? 'c' : 's', slot); |
| 198 | sprintf(out, "%s%s.%c%.2d", getSavegameDir(), _exe_name, compatible ? 'c' : 's', slot); |
195 | 199 | } |
196 | 200 | |
197 | 201 | bool Scumm::getSavegameName(int slot, char *desc) |
diff -ur ScummVM-cvs20020729/scummvm/scumm.h ScummVM-cvs20020729+simon/scummvm/scumm.h
old
|
new
|
|
485 | 485 | void saveOrLoad(Serializer *s); |
486 | 486 | |
487 | 487 | bool getSavegameName(int slot, char *desc); |
| 488 | const char *getSavegameDir(); |
488 | 489 | void makeSavegameName(char *out, int slot, bool compatible); |
489 | 490 | void saveLoadResource(Serializer *ser, int type, int index); |
490 | 491 | |
diff -ur ScummVM-cvs20020729/scummvm/simon/simon.cpp ScummVM-cvs20020729+simon/scummvm/simon/simon.cpp
old
|
new
|
|
20 | 20 | */ |
21 | 21 | |
22 | 22 | #include "stdafx.h" |
| 23 | #include "scumm.h" |
23 | 24 | #include "simon.h" |
24 | 25 | #include <errno.h> |
25 | 26 | |
… |
… |
|
4436 | 4437 | char *SimonState::gen_savename(int slot) |
4437 | 4438 | { |
4438 | 4439 | static char buf[256]; |
4439 | | const char *dir; |
4440 | 4440 | |
4441 | | /* perhaps getenv should be added to OSystem */ |
4442 | | #ifndef _WIN32_WCE |
4443 | | dir = getenv("SCUMMVM_SAVEPATH"); |
4444 | | if (dir == NULL) |
4445 | | dir = ""; |
4446 | | #else |
4447 | | dir = _game_path; |
4448 | | #endif |
4449 | | |
4450 | | sprintf(buf, "%sSAVE.%.3d", dir, slot); |
| 4441 | // snprintf should be used here, but it's not portable enough |
| 4442 | sprintf(buf, "%sSAVE.%.3d", g_scumm->getSavegameDir(), slot); |
4451 | 4443 | return buf; |
4452 | 4444 | } |
4453 | 4445 | |