diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr
index 80bd7746acb5896668c4fbd526058d30d4343b80..4131108e19b11ac7d89c6547fa12c116aaff096f 100644 (file)
--- a/src/game/Doom2DF.lpr
+++ b/src/game/Doom2DF.lpr
g_grid in 'g_grid.pas',
g_game in 'g_game.pas',
g_gfx in 'g_gfx.pas',
g_grid in 'g_grid.pas',
g_game in 'g_game.pas',
g_gfx in 'g_gfx.pas',
- g_gui in 'g_gui.pas',
g_items in 'g_items.pas',
g_map in 'g_map.pas',
g_items in 'g_items.pas',
g_map in 'g_map.pas',
- g_menu in 'g_menu.pas',
g_monsters in 'g_monsters.pas',
g_options in 'g_options.pas',
g_phys in 'g_phys.pas',
g_monsters in 'g_monsters.pas',
g_options in 'g_options.pas',
g_phys in 'g_phys.pas',
g_triggers in 'g_triggers.pas',
g_weapons in 'g_weapons.pas',
g_window in 'g_window.pas',
g_triggers in 'g_triggers.pas',
g_weapons in 'g_weapons.pas',
g_window in 'g_window.pas',
-{$IFDEF USE_SYSSTUB}
- g_system in 'stub/g_system.pas',
- g_touch in 'stub/g_touch.pas',
-{$ENDIF}
-{$IFDEF USE_SDL}
- g_system in 'sdl/g_system.pas',
- g_touch in 'sdl/g_touch.pas',
-{$ENDIF}
-{$IFDEF USE_SDL2}
- g_system in 'sdl2/g_system.pas',
- g_touch in 'sdl2/g_touch.pas',
+{$IFNDEF HEADLESS}
+ {$IFDEF USE_SYSSTUB}
+ g_system in 'stub/g_system.pas',
+ {$ENDIF}
+ {$IFDEF USE_SDL}
+ g_system in 'sdl/g_system.pas',
+ {$ENDIF}
+ {$IFDEF USE_SDL2}
+ g_system in 'sdl2/g_system.pas',
+ {$ENDIF}
{$ENDIF}
{$ENDIF}
+{$IFNDEF HEADLESS}
+ {$I ../shared/vampimg.inc}
r_animations in 'opengl/r_animations.pas',
r_console in 'opengl/r_console.pas',
r_game in 'opengl/r_game.pas',
r_animations in 'opengl/r_animations.pas',
r_console in 'opengl/r_console.pas',
r_game in 'opengl/r_game.pas',
r_textures in 'opengl/r_textures.pas',
r_weapons in 'opengl/r_weapons.pas',
r_window in 'opengl/r_window.pas',
r_textures in 'opengl/r_textures.pas',
r_weapons in 'opengl/r_weapons.pas',
r_window in 'opengl/r_window.pas',
+ {$IFDEF ENABLE_TOUCH}
+ r_touch in 'opengl/r_touch.pas',
+ {$ENDIF}
+ {$IFDEF ENABLE_MENU}
+ g_gui in 'g_gui.pas',
+ g_menu in 'g_menu.pas',
+ {$ENDIF}
+{$ENDIF}
{$IFDEF USE_FMOD}
fmod in '../lib/FMOD/fmod.pas',
{$IFDEF USE_FMOD}
fmod in '../lib/FMOD/fmod.pas',
fui_flexlay in '../flexui/fui_flexlay.pas',
fui_ctls in '../flexui/fui_ctls.pas',
{$ENDIF}
fui_flexlay in '../flexui/fui_flexlay.pas',
fui_ctls in '../flexui/fui_ctls.pas',
{$ENDIF}
- {$I ../shared/vampimg.inc}
SysUtils, Classes;
SysUtils, Classes;
if (NetMode = NET_SERVER) then g_Net_Host_Update()
else if (NetMode = NET_CLIENT) then g_Net_Client_Update();
// think
if (NetMode = NET_SERVER) then g_Net_Host_Update()
else if (NetMode = NET_CLIENT) then g_Net_Client_Update();
// think
+{$IFNDEF HEADLESS}
r_Render_Update;
r_Render_Update;
+{$ENDIF}
g_Game_Update();
// server: send any accumulated outgoing data to clients
if NetMode = NET_SERVER then g_Net_Flush();
g_Game_Update();
// server: send any accumulated outgoing data to clients
if NetMode = NET_SERVER then g_Net_Flush();
Time, Time_Delta: Int64;
Frame: Int64;
begin
Time, Time_Delta: Int64;
Frame: Int64;
begin
- result := sys_HandleInput();
+ {$IFDEF HEADLESS}
+ Result := False;
+ {$ELSE}
+ Result := sys_HandleInput();
+ {$ENDIF}
Time := GetTickCount64();
Time_Delta := Time-Time_Old;
Time := GetTickCount64();
Time_Delta := Time-Time_Old;
gLerpFactor := 1.0
else
gLerpFactor := nmin(1.0, (Time - Time_Old) / 28.0);
gLerpFactor := 1.0
else
gLerpFactor := nmin(1.0, (Time - Time_Old) / 28.0);
- r_Game_Draw;
+{$IFNDEF HEADLESS}
+ r_Render_Draw;
sys_Repaint;
sys_Repaint;
+{$ENDIF}
Frame := Time
end
else
Frame := Time
end
else
procedure ScreenResize (w, h: Integer);
begin
procedure ScreenResize (w, h: Integer);
begin
- r_Render_Resize(w, h);
- {$IFDEF ENABLE_HOLMES}
- fuiScrWdt := w;
- fuiScrHgt := h;
- {$ENDIF}
- g_Game_SetupScreenSize;
- {$IFNDEF ANDROID}
- (* This will fix menu reset on keyboard showing *)
- g_Menu_Reset;
- {$ENDIF}
- //g_Game_ClearLoading;
- {$IFDEF ENABLE_HOLMES}
- if assigned(oglInitCB) then oglInitCB;
+ {$IFNDEF HEADLESS}
+ r_Render_Resize(w, h);
+ {$IFDEF ENABLE_HOLMES}
+ fuiScrWdt := w;
+ fuiScrHgt := h;
+ {$ENDIF}
+ {$IFNDEF ANDROID}
+ (* This will fix menu reset on keyboard showing *)
+ {$IFDEF ENABLE_MENU}
+ g_Menu_Reset;
+ {$ENDIF}
+ {$ENDIF}
+ //g_Game_ClearLoading;
+ {$IFDEF ENABLE_HOLMES}
+ if assigned(oglInitCB) then oglInitCB;
+ {$ENDIF}
{$ENDIF}
end;
{$ENDIF}
end;
InitPrep;
e_Input_Initialize;
InitSound;
InitPrep;
e_Input_Initialize;
InitSound;
- sys_Init;
- sys_CharPress := @CharPress; (* install hook *)
- sys_ScreenResize := @ScreenResize; (* install hook *)
+ {$IFNDEF HEADLESS}
+ sys_Init;
+ sys_CharPress := @CharPress; (* install hook *)
+ sys_ScreenResize := @ScreenResize; (* install hook *)
+ {$ENDIF}
g_Options_SetDefault;
g_Options_SetDefaultVideo;
g_Console_Initialize;
// TODO move load configs here
g_Language_Set(gLanguage);
g_Options_SetDefault;
g_Options_SetDefaultVideo;
g_Console_Initialize;
// TODO move load configs here
g_Language_Set(gLanguage);
- r_Render_Initialize;
- g_Touch_Init;
+ {$IFNDEF HEADLESS}
+ r_Render_Initialize;
+ {$ENDIF}
DebugOptions;
g_Net_InitLowLevel;
// TODO init serverlist
{$IFDEF ENABLE_HOLMES}
InitHolmes;
{$ENDIF}
DebugOptions;
g_Net_InitLowLevel;
// TODO init serverlist
{$IFDEF ENABLE_HOLMES}
InitHolmes;
{$ENDIF}
- g_PlayerModel_LoadAll;
- r_Render_Load;
+ {$IFDEF HEADLESS}
+ g_PlayerModel_LoadFake('doomer', 'doomer.wad');
+ {$ELSE}
+ g_PlayerModel_LoadAll;
+ r_Render_Load;
+ {$ENDIF}
g_Game_Init;
g_Game_Init;
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_MENU}
g_Menu_Init;
g_GUI_Init;
{$ENDIF}
g_Game_Process_Params;
// TODO reload GAME textures
g_Console_Init; // welcome message
g_Menu_Init;
g_GUI_Init;
{$ENDIF}
g_Game_Process_Params;
// TODO reload GAME textures
g_Console_Init; // welcome message
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_MENU}
if (not gGameOn) and gAskLanguage then
g_Menu_AskLanguage;
{$ENDIF}
Time_Old := GetTickCount64();
while not ProcessMessage() do begin end;
g_Console_WriteGameConfig;
if (not gGameOn) and gAskLanguage then
g_Menu_AskLanguage;
{$ENDIF}
Time_Old := GetTickCount64();
while not ProcessMessage() do begin end;
g_Console_WriteGameConfig;
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_MENU}
g_GUI_Destroy;
g_Menu_Free;
{$ENDIF}
g_GUI_Destroy;
g_Menu_Free;
{$ENDIF}
- r_Render_Free;
+ {$IFNDEF HEADLESS}
+ r_Render_Free;
+ {$ENDIF}
{$IFDEF ENABLE_HOLMES}
FreeHolmes;
{$ENDIF}
g_Net_Slist_ShutdownAll;
g_Net_DeinitLowLevel;
(* g_Touch_Finalize; *)
{$IFDEF ENABLE_HOLMES}
FreeHolmes;
{$ENDIF}
g_Net_Slist_ShutdownAll;
g_Net_DeinitLowLevel;
(* g_Touch_Finalize; *)
- r_Render_Finalize;
- sys_Final;
+ {$IFNDEF HEADLESS}
+ r_Render_Finalize;
+ sys_Final;
+ {$ENDIF}
g_Console_Finalize;
e_ReleaseSoundSystem;
e_Input_Finalize;
g_Console_Finalize;
e_ReleaseSoundSystem;
e_Input_Finalize;