diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr
index 91fd3a6276cf4a7778f5322d5616a1107ea3124a..3239be1e6fd0bd800cee48c3a34d2d362f708093 100644 (file)
--- a/src/game/Doom2DF.lpr
+++ b/src/game/Doom2DF.lpr
conbuf in '../shared/conbuf.pas',
geom in '../shared/geom.pas',
math,
-{$IFDEF USE_NANOGL}
- nanoGL in '../lib/nanogl/nanoGL.pas',
-{$ELSE}
- GL,
- GLExt,
-{$ENDIF}
+
+{$INCLUDE ../nogl/noGLuses.inc}
+
{$IFDEF USE_MINIUPNPC}
miniupnpc in '../lib/miniupnpc/miniupnpc.pas',
{$ENDIF}
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
{$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}
for f := 1 to ParamCount do