X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2FDoom2DF.lpr;h=3239be1e6fd0bd800cee48c3a34d2d362f708093;hb=e90ae210fd2bdfd94690ef29bb747e556ab07c40;hp=c86d7441e795240e6d4ec170060d2f34cc45f406;hpb=5bf9c81ca00b024398c0da073fca7d16339a6eaf;p=d2df-sdl.git diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr index c86d744..3239be1 100644 --- a/src/game/Doom2DF.lpr +++ b/src/game/Doom2DF.lpr @@ -141,6 +141,9 @@ function SDL_main(argc: CInt; argv: PPChar): CInt; cdecl; var f: Integer; noct: Boolean = false; +{$IFDEF ANDROID} + storage: String; +{$ENDIF} //tfo: Text; begin SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]); //k8: fuck off, that's why @@ -148,16 +151,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}