diff --git a/src/game/g_main.pas b/src/game/g_main.pas
index def9f2914d20b342539c8021c605dc93e39c353f..af95f90039433fabd4834b40f6b977878b65234c 100644 (file)
--- a/src/game/g_main.pas
+++ b/src/game/g_main.pas
CacheDirs: SSArray;
ConfigDirs: SSArray;
ScreenshotDirs: SSArray;
CacheDirs: SSArray;
ConfigDirs: SSArray;
ScreenshotDirs: SSArray;
+ StatsDirs: SSArray;
MapDownloadDirs: SSArray;
WadDownloadDirs: SSArray;
MapDownloadDirs: SSArray;
WadDownloadDirs: SSArray;
+ GameWADName: string = 'GAME';
+
implementation
uses
implementation
uses
AddDir(MapDownloadDirs, e_CatPath(rwdir, 'maps/downloads'));
AddDir(WadDownloadDirs, e_CatPath(rwdir, 'wads/downloads'));
AddDir(ScreenshotDirs, e_CatPath(rwdir, 'screenshots'));
AddDir(MapDownloadDirs, e_CatPath(rwdir, 'maps/downloads'));
AddDir(WadDownloadDirs, e_CatPath(rwdir, 'wads/downloads'));
AddDir(ScreenshotDirs, e_CatPath(rwdir, 'screenshots'));
+ AddDir(StatsDirs, e_CatPath(rwdir, 'stats'));
(* RO *)
AddDir(DataDirs, e_CatPath(rwdir, 'data'));
AddDir(ModelDirs, e_CatPath(rwdir, 'data/models'));
(* RO *)
AddDir(DataDirs, e_CatPath(rwdir, 'data'));
AddDir(ModelDirs, e_CatPath(rwdir, 'data/models'));
AddDir(MapDirs, e_CatPath(rodir, 'maps'));
AddDir(WadDirs, e_CatPath(rodir, 'wads'));
end;
AddDir(MapDirs, e_CatPath(rodir, 'maps'));
AddDir(WadDirs, e_CatPath(rodir, 'wads'));
end;
+ '--game-wad':
+ begin
+ Inc(i);
+ GameWADName := ParamStr(i);
+ end;
+ '--config':
+ begin
+ Inc(i);
+ gConfigScript := ParamStr(i);
+ end;
end;
Inc(i)
end;
end;
Inc(i)
end;
// prefer bin dir if it writable and contains game.wad
if forceBinDir = false then
begin
// prefer bin dir if it writable and contains game.wad
if forceBinDir = false then
begin
- if findDiskWad(binPath + 'data' + '/' + 'GAME') <> '' then
+ if findDiskWad(binPath + 'data' + '/' + GameWADName) <> '' then
if e_CanCreateFilesAt(binPath) then
forceBinDir := true
end;
if e_CanCreateFilesAt(binPath) then
forceBinDir := true
end;
AddDef(MapDownloadDirs, rwdirs, 'maps/downloads');
AddDef(WadDownloadDirs, rwdirs, 'wads/downloads');
AddDef(ScreenshotDirs, rwdirs, 'screenshots');
AddDef(MapDownloadDirs, rwdirs, 'maps/downloads');
AddDef(WadDownloadDirs, rwdirs, 'wads/downloads');
AddDef(ScreenshotDirs, rwdirs, 'screenshots');
+ AddDef(StatsDirs, rwdirs, 'stats');
for i := 0 to High(MapDirs) do
AddDir(AllMapDirs, MapDirs[i]);
for i := 0 to High(MapDirs) do
AddDir(AllMapDirs, MapDirs[i]);
{$ENDIF}
end
end;
{$ENDIF}
end
end;
+
+ // HACK: ensure the screenshots folder also has a stats subfolder in it
+ rwdir := e_GetWriteableDir(ScreenshotDirs, false);
+ if rwdir <> '' then CreateDir(rwdir + '/stats');
end;
procedure InitPrep;
end;
procedure InitPrep;
{$ENDIF}
for i := 1 to ParamCount do
begin
{$ENDIF}
for i := 1 to ParamCount do
begin
- if (ParamStr(i) = '--con-stdout') then
- begin
- conbufDumpToStdOut := true;
- break
+ case ParamStr(i) of
+ '--con-stdout': conbufDumpToStdOut := true;
+ '--no-fbo': glRenderToFBO := false;
end
end;
end
end;
PrintDirs('CacheDirs', CacheDirs);
PrintDirs('ConfigDirs', ConfigDirs);
PrintDirs('ScreenshotDirs', ScreenshotDirs);
PrintDirs('CacheDirs', CacheDirs);
PrintDirs('ConfigDirs', ConfigDirs);
PrintDirs('ScreenshotDirs', ScreenshotDirs);
+ PrintDirs('StatsDirs', StatsDirs);
PrintDirs('MapDownloadDirs', MapDownloadDirs);
PrintDirs('WadDownloadDirs', WadDownloadDirs);
PrintDirs('MapDownloadDirs', MapDownloadDirs);
PrintDirs('WadDownloadDirs', WadDownloadDirs);
- GameWAD := e_FindWad(DataDirs, 'GAME');
+ GameWAD := e_FindWad(DataDirs, GameWADName);
if GameWad = '' then
begin
if GameWad = '' then
begin
- e_WriteLog('GAME.WAD not installed?', TMsgType.Fatal);
+ e_WriteLog('WAD ' + GameWADName + ' not found in data directories.', TMsgType.Fatal);
{$IF DEFINED(USE_SDL2) AND NOT DEFINED(HEADLESS)}
if forceBinDir = false then
{$IF DEFINED(USE_SDL2) AND NOT DEFINED(HEADLESS)}
if forceBinDir = false then
- SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, 'Doom 2D Forever', 'GAME.WAD not installed?', nil);
+ SDL_ShowSimpleMessageBox(
+ SDL_MESSAGEBOX_ERROR,
+ 'Doom 2D Forever',
+ PChar('WAD ' + GameWADName + ' not found in data directories.'),
+ nil
+ );
{$ENDIF}
e_DeinitLog;
Halt(1);
{$ENDIF}
e_DeinitLog;
Halt(1);
{$IFDEF ENABLE_HOLMES}
var flexloaded: Boolean;
{$ENDIF}
{$IFDEF ENABLE_HOLMES}
var flexloaded: Boolean;
{$ENDIF}
- var s: AnsiString;
begin
InitPath;
InitPrep;
begin
InitPath;
InitPrep;
g_Options_SetDefault;
g_Options_SetDefaultVideo;
g_Options_SetDefault;
g_Options_SetDefaultVideo;
- s := CONFIG_FILENAME;
- if e_FindResource(ConfigDirs, s) = true then
- g_Options_Read(s);
g_Console_SysInit;
g_Console_SysInit;
- if sys_SetDisplayMode(gScreenWidth, gScreenHeight, gBPP, gFullScreen) = False then
+ if sys_SetDisplayMode(gRC_Width, gRC_Height, gBPP, gRC_FullScreen, gRC_Maximized) = False then
raise Exception.Create('Failed to set videomode on startup.');
e_WriteLog(gLanguage, TMsgType.Notify);
raise Exception.Create('Failed to set videomode on startup.');
e_WriteLog(gLanguage, TMsgType.Notify);
procedure Update ();
begin
procedure Update ();
begin
+ // remember old mobj positions, prepare for update
+ g_Game_PreUpdate();
+ // server: receive client commands for new frame
+ // client: receive game state changes from server
+ if (NetMode = NET_SERVER) then g_Net_Host_Update()
+ else if (NetMode = NET_CLIENT) then g_Net_Client_Update();
+ // think
g_Game_Update();
g_Game_Update();
+ // server: send any accumulated outgoing data to clients
+ if NetMode = NET_SERVER then g_Net_Flush();
end;
end;