X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2FDoom2DF.lpr;h=27b90a5055c008fb42df86589ec8480f44ed549a;hp=c86d7441e795240e6d4ec170060d2f34cc45f406;hb=2f2f9c997a76f5394c4deb2fa7d54b99a6186c87;hpb=c97b4f7894fd3d797ecea3de574b58499c43aa85 diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr index c86d744..27b90a5 100644 --- a/src/game/Doom2DF.lpr +++ b/src/game/Doom2DF.lpr @@ -141,6 +141,7 @@ function SDL_main(argc: CInt; argv: PPChar): CInt; cdecl; var f: Integer; noct: Boolean = false; + storage: String; //tfo: Text; begin SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]); //k8: fuck off, that's why @@ -148,16 +149,23 @@ begin {$IFDEF ANDROID} {$I-} e_SetSafeSlowLog(true); - Chdir(SDL_AndroidGetExternalStoragePath()); + if SDL_AndroidGetExternalStorageState() <> 0 then + begin + storage := SDL_AndroidGetExternalStoragePath(); + Chdir(storage); + e_WriteLog('Use external storage: ' + storage, TMsgType.Notify) + end + else + begin + storage := SDL_AndroidGetInternalStoragePath(); + Chdir(storage); + e_WriteLog('Use internal storage: ' + storage, TMsgType.Notify) + end; if IOresult <> 0 then begin - Chdir(SDL_AndroidGetInternalStoragePath()); - if IOresult <> 0 then - begin - e_WriteLog('Fuck! Cant chdir to any game directory :(', TMsgType.Fatal); - result := 1; - exit; - end; + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, PChar('Invalid path'), PChar('Can''t chdir to ' + storage), nil); + result := 1; + exit end; SetEnvVar('TIMIDITY_CFG', 'timidity.cfg'); {$ENDIF ANDROID}