move save directory detection/creation from main() to OSystem_PSP::initBackend()
svn-id: r34326
This commit is contained in:
parent
912684de2d
commit
3930783928
2 changed files with 13 additions and 10 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue