diff options
author | Joost Peters | 2008-09-04 08:34:02 +0000 |
---|---|---|
committer | Joost Peters | 2008-09-04 08:34:02 +0000 |
commit | 3930783928dbb868607787f53ff3790a7084afd4 (patch) | |
tree | d7899fdbe230bef13b59e6deb28aef65db68aa67 /backends/platform | |
parent | 912684de2da56b3018899ed7f9910766c2d35424 (diff) | |
download | scummvm-rg350-3930783928dbb868607787f53ff3790a7084afd4.tar.gz scummvm-rg350-3930783928dbb868607787f53ff3790a7084afd4.tar.bz2 scummvm-rg350-3930783928dbb868607787f53ff3790a7084afd4.zip |
move save directory detection/creation from main() to OSystem_PSP::initBackend()
svn-id: r34326
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/psp/osys_psp.cpp | 13 | ||||
-rw-r--r-- | backends/platform/psp/psp_main.cpp | 10 |
2 files changed, 13 insertions, 10 deletions
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp index 30a43e80c1..69be0abcb2 100644 --- a/backends/platform/psp/osys_psp.cpp +++ b/backends/platform/psp/osys_psp.cpp @@ -99,6 +99,19 @@ OSystem_PSP::~OSystem_PSP() { void OSystem_PSP::initBackend() { _savefile = new DefaultSaveFileManager("ms0:/scummvm_savegames"); + + const char *savePath = _savefile->getSavePath().c_str(); + + //check if the save directory exists + SceUID fd = sceIoDopen(savePath); + if (fd < 0) { + //No? then let's create it. + sceIoMkdir(savePath, 0777); + } else { + //it exists, so close it again. + sceIoDclose(fd); + } + _timer = new DefaultTimerManager(); setTimerCallback(&timer_handler, 10); diff --git a/backends/platform/psp/psp_main.cpp b/backends/platform/psp/psp_main.cpp index d2ed59efbe..94ef63488d 100644 --- a/backends/platform/psp/psp_main.cpp +++ b/backends/platform/psp/psp_main.cpp @@ -122,16 +122,6 @@ int main(void) { SetupCallbacks(); - //check if the save directory exists - SceUID fd = sceIoDopen(SCUMMVM_SAVEPATH); - if (fd < 0) { - //No? then let's create it. - sceIoMkdir(SCUMMVM_SAVEPATH, 0777); - } else { - //it exists, so close it again. - sceIoDclose(fd); - } - static char *argv[] = { "scummvm", NULL }; static int argc = sizeof(argv)/sizeof(char *)-1; |