summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 335e018)
raw | patch | inline | side by side (parent: 335e018)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 29 Jan 2022 17:53:01 +0000 (20:53 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 29 Jan 2022 17:53:01 +0000 (20:53 +0300) |
diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr
index 28e3b6228ad0c23374b538de64b5130d14508934..e7999c553863f7840e31b71ff6b812be1d4ca624 100644 (file)
--- a/src/game/Doom2DF.lpr
+++ b/src/game/Doom2DF.lpr
{$ENDIF}
{$ENDIF}
-{$IFNDEF HEADLESS}
+{$IFDEF ENABLE_RENDER}
{$I ../shared/vampimg.inc}
r_animations in 'opengl/r_animations.pas',
r_console in 'opengl/r_console.pas',
if (NetMode = NET_SERVER) then g_Net_Host_Update()
else if (NetMode = NET_CLIENT) then g_Net_Client_Update();
// think
-{$IFNDEF HEADLESS}
+{$IFDEF ENABLE_RENDER}
r_Render_Update;
{$ENDIF}
g_Game_Update();
gLerpFactor := 1.0
else
gLerpFactor := nmin(1.0, (Time - Time_Old) / 28.0);
-{$IFNDEF HEADLESS}
+{$IFDEF ENABLE_RENDER}
r_Render_Draw;
sys_Repaint;
{$ENDIF}
procedure ScreenResize (w, h: Integer);
begin
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_RENDER}
r_Render_Resize(w, h);
{$IFDEF ENABLE_HOLMES}
fuiScrWdt := w;
g_Console_Initialize;
// TODO move load configs here
g_Language_Set(gLanguage);
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_RENDER}
r_Render_Initialize;
{$ENDIF}
DebugOptions;
{$IFDEF ENABLE_HOLMES}
InitHolmes;
{$ENDIF}
- {$IFDEF HEADLESS}
- g_PlayerModel_LoadFake('doomer', 'doomer.wad');
- {$ELSE}
+ {$IFDEF ENABLE_RENDER}
g_PlayerModel_LoadAll;
r_Render_Load;
+ {$ELSE}
+ g_PlayerModel_LoadFake('doomer', 'doomer.wad');
{$ENDIF}
g_Game_Init;
{$IFDEF ENABLE_MENU}
g_GUI_Destroy;
g_Menu_Free;
{$ENDIF}
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_RENDER}
r_Render_Free;
{$ENDIF}
{$IFDEF ENABLE_HOLMES}
g_Net_Slist_ShutdownAll;
g_Net_DeinitLowLevel;
(* g_Touch_Finalize; *)
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_RENDER}
r_Render_Finalize;
sys_Final;
{$ENDIF}
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 6812d516e78746f006bdd531fa270a63995378e8..69c12409394213a367cff2e2da5ad6d95ce50769 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
procedure g_Game_Announce_BodyKill(SpawnerUID: Word);
procedure g_Game_StartVote(Command, Initiator: string);
procedure g_Game_CheckVote;
-{$IFNDEF HEADLESS}
+{$IFDEF ENABLE_RENDER}
procedure g_TakeScreenShot(Filename: string = '');
{$ENDIF}
procedure g_FatalError(Text: String);
{$IFDEF ENABLE_CORPSES}
g_corpses,
{$ENDIF}
+ {$IFDEF ENABLE_RENDER}
+ r_render,
+ {$ENDIF}
{$IFNDEF HEADLESS}
- r_render, g_system,
+ g_system,
{$ENDIF}
e_res, g_window,
e_input, e_log, g_console, g_items, g_map, g_panel,
begin
//result := g_Map_Load(gGameSettings.WAD + ':\' + ResName);
result := g_Map_Load(NewWAD+':\'+ResName);
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_RENDER}
r_Render_LoadTextures;
{$ENDIF}
end;
end
else if cmd = 'screenshot' then
begin
- {$IFNDEF HEADLESS}
- g_TakeScreenShot()
+ {$IFDEF ENABLE_RENDER}
+ g_TakeScreenShot;
{$ENDIF}
end
else if cmd = 'weapon' then
g_Game_Free();
g_Game_Quit();
end;
-{$IFNDEF HEADLESS}
+{$IFDEF ENABLE_RENDER}
'r_reset':
r_Render_Apply;
{$ENDIF}
end;
end;
-{$IFNDEF HEADLESS}
+{$IFDEF ENABLE_RENDER}
procedure g_TakeScreenShot(Filename: string = '');
var t: TDateTime; dir, date, name: String;
begin
diff --git a/src/game/g_gfx.pas b/src/game/g_gfx.pas
index 224faeed37e415d8c1be49f2af769207f83f12f7..9cc665ccaadb5d2afe671d89739b86391f403d60 100644 (file)
--- a/src/game/g_gfx.pas
+++ b/src/game/g_gfx.pas
implementation
uses
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_RENDER}
r_render,
{$ENDIF}
g_map, g_panel, Math, utils,
procedure g_GFX_QueueEffect (AnimType, X, Y: Integer);
begin
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_RENDER}
r_Render_QueueEffect(AnimType, X, Y)
{$ENDIF}
end;
diff --git a/src/game/g_gibs.pas b/src/game/g_gibs.pas
index 804126414c3eb35090d7cda8ac5f2fdc19eac5f4..d190384c55cc9051d0d3cedbd65182572b3096fc 100644 (file)
--- a/src/game/g_gibs.pas
+++ b/src/game/g_gibs.pas
{$IFDEF ENABLE_GFX}
g_gfx,
{$ENDIF}
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_RENDER}
r_render,
{$ENDIF}
g_playermodel, g_options, g_game
Color := fColor;
alive := True;
g_Obj_Init(@Obj);
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_RENDER}
Obj.Rect := r_Render_GetGibRect(ModelID, GibID);
{$ELSE}
Obj.Rect.X := 16;
index 12d926f937c309fc94ff6c7b186cbe4be50491e9..e708c13227bfd843e38f60a4fb4a243c9e4946b4 100644 (file)
--- a/src/game/g_netmaster.pas
+++ b/src/game/g_netmaster.pas
{$IFDEF ENABLE_MENU}
g_gui, g_menu,
{$ENDIF}
+ {$IFDEF ENABLE_RENDER}
+ r_render,
+ {$ENDIF}
{$IFNDEF HEADLESS}
- r_render, g_system,
+ g_system,
{$ENDIF}
e_input, e_log, g_net, g_console,
g_map, g_game, g_sound, g_options, g_language, g_basic,
begin
slWaitStr := _lc[I_NET_SLIST_WAIT];
-{$IFNDEF HEADLESS}
- r_Render_Draw;
- sys_Repaint;
-{$ENDIF}
+ {$IFDEF ENABLE_RENDER}
+ r_Render_Draw;
+ {$ENDIF}
+ {$IFNDEF HEALESS}
+ sys_Repaint;
+ {$ENDIF}
if g_Net_Slist_Fetch(SL) then
begin
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index 991b0d8799b91c6528ec9c49bbf63ab2b39f8e36..4967d75cc5642ca8a583f5890b552dfb81f986ee 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
{$IFDEF ENABLE_MENU}
g_menu,
{$ENDIF}
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_RENDER}
r_render,
{$ENDIF}
{$IFDEF ENABLE_GFX}
diff --git a/src/game/g_window.pas b/src/game/g_window.pas
index fcf4b4226b3946a18c3ec4bbf0134f31c1c2096b..027f409b8a75938152c4c57ddc02820903ba4831 100644 (file)
--- a/src/game/g_window.pas
+++ b/src/game/g_window.pas
implementation
uses
+ {$IFDEF ENABLE_RENDER}
+ r_render,
+ {$ENDIF}
{$IFNDEF HEADLESS}
- r_render, g_system,
+ g_system,
{$ENDIF}
e_sound, g_net
;
{$ENDIF}
if update then
begin
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_RENDER}
r_Render_DrawLoading(forceUpdate);
{$ENDIF}
e_SoundUpdate();
index abfbfb322dfebceeb83d4f5c9b99fd7ee204e6fb..74e8d0354079582af6be99980952b11d6e8f5769 100644 (file)
{$IFDEF ENABLE_HOLMES}
sdlcarcass,
{$ENDIF}
- {$IFNDEF HEADLESS}
+ {$IFDEF ENABLE_RENDER}
r_render,
{$ENDIF}
{$IFDEF ENABLE_MENU}
x, y, i, finger: Integer;
function IntersectControl(ctl, xx, yy: Integer): Boolean;
- var x, y, w, h: Integer; founded: Boolean;
+ {$IFDEF ENABLE_RENDER}
+ var x, y, w, h: Integer; founded: Boolean;
+ {$ENDIF}
begin
- r_Render_GetKeyRect(ctl, x, y, w, h, founded);
- result := founded and (xx >= x) and (yy >= y) and (xx <= x + w) and (yy <= y + h);
+ {$IFDEF ENABLE_RENDER}
+ r_Render_GetKeyRect(ctl, x, y, w, h, founded);
+ Result := founded and (xx >= x) and (yy >= y) and (xx <= x + w) and (yy <= y + h);
+ {$ELSE}
+ Result := False
+ {$ENDIF}
end;
procedure KeyUp (finger, i: Integer);
diff --git a/src/shared/a_modes.inc b/src/shared/a_modes.inc
index 6789e6ee7ac17a5d783d10518add164132f5a4b3..d018fa0ddcc1f35ba5b88ab36e9fde8028a4c8de 100644 (file)
--- a/src/shared/a_modes.inc
+++ b/src/shared/a_modes.inc
{$UNDEF ENABLE_CORPSES}
{$DEFINE DISABLE_CORPSES}
{$ENDIF}
+ {$IFDEF ENABLE_RENDER}
+ {$WARNING Render in headless mode has no sense. Disabled.}
+ {$UNDEF ENABLE_RENDER}
+ {$DEFINE DISABLE_RENDER}
+ {$ENDIF}
{$ENDIF}
{$IF DEFINED(ENABLE_MENU) AND DEFINED(DISABLE_MENU)}
{$ENDIF}
{$ENDIF}
+{$IF DEFINED(ENABLE_RENDER) AND DEFINED(DISABLE_RENDER)}
+ {$ERROR Select ENABLE_RENDER or DISABLE_RENDER}
+{$ELSEIF NOT DEFINED(ENABLE_RENDER) AND NOT DEFINED(DISABLE_RENDER)}
+ // default ENABLE/DISABLE render
+ {$IFDEF HEADLESS}
+ {$DEFINE DISABLE_RENDER}
+ {$ELSE}
+ {$DEFINE ENABLE_RENDER}
+ {$ENDIF}
+{$ENDIF}
+
{$IF DEFINED(USE_SYSSTUB)}
{$IF DEFINED(USE_SDL) OR DEFINED(USE_SDL2)}
{$ERROR Only one system driver must be selected!}