summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b86d1d4)
raw | patch | inline | side by side (parent: b86d1d4)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 29 Jan 2022 17:53:01 +0000 (20:53 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 08:07:56 +0000 (11:07 +0300) |
diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr
index 47ffeb22c64427a0808af286a7c9e6e4b3767e1c..44d23d13850c5a187ea118a7e1b8790f93cec346 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 38b4088c815e398146bc4a2b23228b3b67c1e955..602fa4207f83800a25267accedefe238d58b35af 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 = 'weapnext') or (cmd = 'weapprev') 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 5dbe785c3865c3691e785aa0de01412fdefd582c..29e60e73f9862c57bf127c44824b5e66316a2636 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 HEADLESS}
+ 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 200435be89796d52fbc028565d55d80e0a2b6a4c..ea2aea5d3dba7f8568d18fa7f17e894a745dc984 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 6d08b18e0f771445863b5b397424334385bc8447..ab211a961557b09ee4cdb772a5b2a8124201dfe2 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 97e346e9005950ed3a9d98fe5b1e9abf34ace1fe..08cb80e48bbeef63a21439d8bb17c1337f81c6c0 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 79363197743fbe020179b47f30cf8d25ed6ed2fa..9596f5bab7fb31a3642d6bfc1080bf46c482839b 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!}