summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c8c9b94)
raw | patch | inline | side by side (parent: c8c9b94)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 21 Oct 2019 21:09:28 +0000 (00:09 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 21 Oct 2019 21:09:28 +0000 (00:09 +0300) |
src/game/g_main.pas | patch | blob | history |
diff --git a/src/game/g_main.pas b/src/game/g_main.pas
index 94606737be95baed9247cbfe82d29f4ca792af2a..ee0d96eb590390aa86bbd215c864b6a33f251fab 100644 (file)
--- a/src/game/g_main.pas
+++ b/src/game/g_main.pas
var home: AnsiString;
{$ENDIF}
begin
- {$IFDEF USE_SDL2}
- AddDir(result, SDL_GetBasePath());
- AddDir(result, SDL_GetPrefPath('', 'doom2df'));
- {$ENDIF}
- {$IFDEF UNIX}
- AddDir(result, '/usr/share/doom2df');
- AddDir(result, '/usr/local/share/doom2df');
- home := GetEnvironmentVariable('HOME');
- if home <> '' then
- AddDir(result, e_CatPath(home, '.doom2df'));
- {$ENDIF}
- {$IF DEFINED(ANDROID) AND DEFINED(USE_SDL2)}
- AddDir(result, SDL_AndroidGetInternalStoragePath());
- if SDL_AndroidGetExternalStorageState() <> 0 then
- AddDir(result, SDL_AndroidGetExternalStoragePath());
- {$ENDIF}
+ if forceCurrentDir = false then
+ begin
+ {$IFDEF USE_SDL2}
+ AddDir(result, SDL_GetBasePath());
+ AddDir(result, SDL_GetPrefPath('', 'doom2df'));
+ {$ENDIF}
+ {$IFDEF UNIX}
+ AddDir(result, '/usr/share/doom2df');
+ AddDir(result, '/usr/local/share/doom2df');
+ home := GetEnvironmentVariable('HOME');
+ if home <> '' then
+ AddDir(result, e_CatPath(home, '.doom2df'));
+ {$ENDIF}
+ {$IF DEFINED(ANDROID) AND DEFINED(USE_SDL2)}
+ AddDir(result, SDL_AndroidGetInternalStoragePath());
+ if SDL_AndroidGetExternalStorageState() <> 0 then
+ AddDir(result, SDL_AndroidGetExternalStoragePath());
+ {$ENDIF}
+ end;
AddDir(result, '.');
end;
var home: AnsiString;
{$ENDIF}
begin
- {$IF DEFINED(USE_SDL2)}
- AddDir(result, SDL_GetPrefPath('', 'doom2df'));
- {$ENDIF}
- {$IFDEF UNIX}
- home := GetEnvironmentVariable('HOME');
- if home <> '' then
- AddDir(result, e_CatPath(home, '.doom2df'));
- {$ENDIF}
- {$IF DEFINED(ANDROID) AND DEFINED(USE_SDL2)}
- if SDL_AndroidGetExternalStorageState() <> 0 then
- AddDir(result, SDL_AndroidGetExternalStoragePath());
- {$ENDIF}
+ if forceCurrentDir = false then
+ begin
+ {$IF DEFINED(USE_SDL2)}
+ AddDir(result, SDL_GetPrefPath('', 'doom2df'));
+ {$ENDIF}
+ {$IFDEF UNIX}
+ home := GetEnvironmentVariable('HOME');
+ if home <> '' then
+ AddDir(result, e_CatPath(home, '.doom2df'));
+ {$ENDIF}
+ {$IF DEFINED(ANDROID) AND DEFINED(USE_SDL2)}
+ if SDL_AndroidGetExternalStorageState() <> 0 then
+ AddDir(result, SDL_AndroidGetExternalStoragePath());
+ {$ENDIF}
+ end;
AddDir(result, '.');
end;
for i := 1 to ParamCount do
begin
+ // use it only if you ketmar
if (ParamStr(i) = '--cwd') then
begin
forceCurrentDir := true;
begin
e_WriteLog('GAME.WAD not installed?', TMsgType.Fatal);
{$IF DEFINED(USE_SDL2) AND NOT DEFINED(HEADLESS)}
- SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, 'Doom 2D Forever', 'GAME.WAD not installed?', nil);
+ if forceCurrentDir = false then
+ SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, 'Doom 2D Forever', 'GAME.WAD not installed?', nil);
{$ENDIF}
+ e_DeinitLog;
Halt(1);
end;