summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 965a25f)
raw | patch | inline | side by side (parent: 965a25f)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 17 Jan 2022 20:15:58 +0000 (23:15 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 07:56:26 +0000 (10:56 +0300) |
13 files changed:
diff --git a/src/game/Doom2DF.lpr b/src/game/Doom2DF.lpr
index baaa8affc2ca527d388e37aaa82195c5c39e02e2..cad717dadf2be80ce54baa8b7420d80c93f469cd 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_gui in 'g_gui.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_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',
+ 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',
+ {$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_textures in 'opengl/r_textures.pas',
r_weapons in 'opengl/r_weapons.pas',
r_window in 'opengl/r_window.pas',
+ g_gui in 'g_gui.pas',
+ g_menu in 'g_menu.pas',
+{$ENDIF}
{$IFDEF USE_FMOD}
fmod in '../lib/FMOD/fmod.pas',
fui_flexlay in '../flexui/fui_flexlay.pas',
fui_ctls in '../flexui/fui_ctls.pas',
{$ENDIF}
- {$I ../shared/vampimg.inc}
SysUtils, Classes;
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;
+{$ENDIF}
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
- result := sys_HandleInput();
+ {$IFDEF HEADLESS}
+ Result := False;
+ {$ELSE}
+ Result := sys_HandleInput();
+ {$ENDIF}
Time := GetTickCount64();
Time_Delta := Time-Time_Old;
gLerpFactor := 1.0
else
gLerpFactor := nmin(1.0, (Time - Time_Old) / 28.0);
+{$IFNDEF HEADLESS}
r_Game_Draw;
sys_Repaint;
+{$ENDIF}
Frame := Time
end
else
procedure ScreenResize (w, h: Integer);
begin
- r_Render_Resize(w, h);
- {$IFDEF ENABLE_HOLMES}
- fuiScrWdt := w;
- fuiScrHgt := h;
- {$ENDIF}
- {$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 *)
+ g_Menu_Reset;
+ {$ENDIF}
+ //g_Game_ClearLoading;
+ {$IFDEF ENABLE_HOLMES}
+ if assigned(oglInitCB) then oglInitCB;
+ {$ENDIF}
{$ENDIF}
end;
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);
- r_Render_Initialize;
- g_Touch_Init;
+ {$IFNDEF HEADLESS}
+ r_Render_Initialize;
+ g_Touch_Init;
+ {$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;
{$IFNDEF HEADLESS}
g_Menu_Init;
{$IFNDEF HEADLESS}
g_GUI_Destroy;
g_Menu_Free;
+ r_Render_Free;
{$ENDIF}
- r_Render_Free;
{$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;
diff --git a/src/game/g_console.pas b/src/game/g_console.pas
index fee51960c149868ffe4c969c24c04e7c1513af66..514c69e0ee27a53cd303a83c2e534e9ba4c2ae9f 100644 (file)
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
implementation
uses
+ {$IFNDEF HEADLESS}
+ g_gui, g_menu, g_touch,
+ {$ENDIF}
g_textures, e_input, g_game, g_gfx, g_player, g_items,
- SysUtils, g_basic, g_options, Math, g_touch, e_res,
- g_menu, g_gui, g_language, g_net, g_netmsg, e_log, conbuf, g_weapons,
+ SysUtils, g_basic, g_options, Math, e_res,
+ g_language, g_net, g_netmsg, e_log, conbuf, g_weapons,
Keyboard;
const
gChatShow := False;
gConsoleShow := not gConsoleShow;
InputReady := False;
- g_Touch_ShowKeyboard(gConsoleShow or gChatShow);
+ {$IFNDEF HEADLESS}
+ g_Touch_ShowKeyboard(gConsoleShow or gChatShow);
+ {$ENDIF}
end;
procedure g_Console_Chat_Switch (Team: Boolean = False);
InputReady := False;
Line := '';
CPos := 1;
- g_Touch_ShowKeyboard(gConsoleShow or gChatShow);
+ {$IFNDEF HEADLESS}
+ g_Touch_ShowKeyboard(gConsoleShow or gChatShow);
+ {$ENDIF}
end;
// poor man's floating literal parser; i'm sorry, but `StrToFloat()` sux cocks
'unbindall':
for i := 0 to e_MaxInputKeys - 1 do
g_Console_BindKey(i, '');
+{$IFNDEF HEADLESS}
'showkeyboard':
g_Touch_ShowKeyboard(True);
'hidekeyboard':
g_Touch_ShowKeyboard(False);
+{$ENDIF}
'togglemenu':
begin
if gConsoleShow then
end;
function BindsAllowed (key: Integer): Boolean;
+ var grab, active: Boolean;
begin
Result := False;
- if (not g_GUIGrabInput) and (key >= 0) and (key < e_MaxInputKeys) and ((gInputBinds[key].down <> nil) or (gInputBinds[key].up <> nil)) then
+ {$IFDEF HEADLESS}
+ grab := False;
+ active := False;
+ {$ELSE}
+ grab := g_GUIGrabInput;
+ active := g_ActiveWindow <> nil;
+ {$ENDIF}
+ if (not grab) and (key >= 0) and (key < e_MaxInputKeys) and ((gInputBinds[key].down <> nil) or (gInputBinds[key].up <> nil)) then
begin
if gChatShow then
Result := g_Console_MatchBind(key, 'togglemenu') or
g_Console_MatchBind(key, 'showkeyboard') or
g_Console_MatchBind(key, 'hidekeyboard')
- else if gConsoleShow or (g_ActiveWindow <> nil) or (gGameSettings.GameType = GT_NONE) then
+ else if gConsoleShow or active or (gGameSettings.GameType = GT_NONE) then
Result := g_Console_MatchBind(key, 'togglemenu') or
g_Console_MatchBind(key, 'toggleconsole') or
g_Console_MatchBind(key, 'showkeyboard') or
end;
procedure g_Console_ProcessBindRepeat (key: Integer);
- var i: Integer;
+ var i: Integer; active: Boolean;
begin
- if gConsoleShow or gChatShow or (g_ActiveWindow <> nil) then
+ {$IFDEF HEADLESS}
+ active := False;
+ {$ELSE}
+ active := g_ActiveWindow <> nil;
+ {$ENDIF}
+ if gConsoleShow or gChatShow or active then
begin
KeyPress(key); // key repeat in menus and shit
Exit;
diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 36c4899c44cd7485ad9aeac72398a200ebfa2db2..62866c03554938c018c564580e8e91b0f504162a 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
interface
-uses
- SysUtils, Classes,
- MAPDEF,
- g_base, g_basic, g_player, g_res_downloader,
- g_sound, g_gui, utils, md5, mempool, xprofiler,
- g_touch, g_weapons;
+ uses
+ {$IFNDEF HEADLESS}
+ g_gui, g_touch,
+ {$ENDIF}
+ SysUtils, Classes, MAPDEF,
+ g_base, g_basic, g_player, g_res_downloader,
+ g_sound, utils, md5, mempool, xprofiler,
+ g_weapons
+ ;
type
TGameSettings = record
procedure g_Game_NextLevel();
procedure g_Game_Pause(Enable: Boolean);
procedure g_Game_HolmesPause(Enable: Boolean);
-procedure g_Game_InGameMenu(Show: Boolean);
+{$IFNDEF HEADLESS}
+ procedure g_Game_InGameMenu(Show: Boolean);
+{$ENDIF}
function g_Game_IsWatchedPlayer(UID: Word): Boolean;
function g_Game_IsWatchedTeam(Team: Byte): Boolean;
procedure g_Game_Message(Msg: String; Time: Word);
procedure SortGameStat(var stat: TPlayerStatArray);
procedure KeyPress (K: Word);
-procedure CharPress (C: AnsiChar);
+
+{$IFNDEF HEADLESS}
+ procedure CharPress (C: AnsiChar);
+{$ENDIF}
{ procedure SetWinPause(Enable: Boolean); }
GM_COOP = 4;
GM_SINGLE = 5;
- MESSAGE_DIKEY = WM_USER + 1;
-
EXIT_QUIT = 1;
EXIT_SIMPLE = 2;
EXIT_RESTART = 3;
g_holmes,
{$ENDIF}
{$IFNDEF HEADLESS}
- r_render,
+ r_render, g_menu, r_playermodel, g_system,
{$ENDIF}
- e_res, g_window, g_menu,
+ e_res, g_window,
e_input, e_log, g_console, g_items, g_map, g_panel,
g_playermodel, g_gfx, g_options, Math,
g_triggers, g_monsters, e_sound, CONFIG,
g_language, g_net, g_phys,
ENet, e_msg, g_netmsg, g_netmaster,
- sfs, wadreader, g_system, r_playermodel;
+ sfs, wadreader;
var
charbuff: packed array [0..15] of AnsiChar = (
{$ENDIF}
end;
+{$IFNDEF HEADLESS}
procedure CharPress (C: AnsiChar);
var
Msg: g_gui.TMessage;
Cheat();
end;
end;
+{$ENDIF}
// ////////////////////////////////////////////////////////////////////////// //
MessageText := '';
EndingGameCounter := 0;
+
+{$IFNDEF HEADLESS}
g_ActiveWindow := nil;
+{$ENDIF}
gLMSRespawn := LMS_RESPAWN_NONE;
gLMSRespawnTime := 0;
EXIT_SIMPLE: // Выход через меню или конец теста
begin
g_Game_Free();
-
if gMapOnce then
- begin // Это был тест
- g_Game_Quit();
- end
+ begin // Это был тест
+ g_Game_Quit();
+ end
else
- begin // Выход в главное меню
- gMusic.SetByName('MUSIC_MENU');
- gMusic.Play();
- if gState <> STATE_SLIST then
- begin
- g_GUI_ShowWindow('MainMenu');
- gState := STATE_MENU;
- end else
+ begin // Выход в главное меню
+{$IFDEF HEADLESS}
+ gState := STATE_MENU; // ???
+{$ELSE}
+ gMusic.SetByName('MUSIC_MENU');
+ gMusic.Play();
+ if gState <> STATE_SLIST then
+ begin
+ g_GUI_ShowWindow('MainMenu');
+ gState := STATE_MENU;
+ end else
+ begin
+ // Обновляем список серверов
+ slReturnPressed := True;
+ if g_Net_Slist_Fetch(slCurrent) then
begin
- // Обновляем список серверов
- slReturnPressed := True;
- if g_Net_Slist_Fetch(slCurrent) then
- begin
- if slCurrent = nil then
- slWaitStr := _lc[I_NET_SLIST_NOSERVERS];
- end
- else
- slWaitStr := _lc[I_NET_SLIST_ERROR];
- g_Serverlist_GenerateTable(slCurrent, slTable);
- end;
-
- g_Game_ExecuteEvent('ongameend');
+ if slCurrent = nil then
+ slWaitStr := _lc[I_NET_SLIST_NOSERVERS];
+ end
+ else
+ slWaitStr := _lc[I_NET_SLIST_ERROR];
+ g_Serverlist_GenerateTable(slCurrent, slTable);
end;
+{$ENDIF}
+ g_Game_ExecuteEvent('ongameend');
+ end;
end;
EXIT_RESTART: // Начать уровень сначала
end
end;
+{$IFNDEF HEADLESS}
// HACK: add dynlight here
if gwin_k8_enable_light_experiments then
begin
end;
if gwin_has_stencil and g_playerLight then g_AddDynLight(plr.GameX+32, plr.GameY+40, 128, 1, 1, 0, 0.6);
+{$ENDIF}
end;
// HACK: don't have a "key was pressed" function
end;
procedure g_Game_Update();
-var
- Msg: g_gui.TMessage;
- Time: Int64;
- a: Byte;
- w: Word;
- i, b: Integer;
+ var
+ {$IFNDEF HEADLESS}
+ Msg: g_gui.TMessage;
+ w: Word;
+ {$ENDIF}
+ Time: Int64;
+ a: Byte;
+ i, b: Integer;
function sendMonsPos (mon: TMonster): Boolean;
begin
e_KeyPressed(JOY2_ATTACK) or e_KeyPressed(JOY3_ATTACK)
)
and (not gJustChatted) and (not gConsoleShow) and (not gChatShow)
+{$IFNDEF HEADLESS}
and (g_ActiveWindow = nil)
+{$ENDIF}
)
or (g_Game_IsNet and ((gInterTime > gInterEndTime) or ((gInterReadyCount >= NetClientCount) and (NetClientCount > 0))))
)
begin
// Выход в главное меню:
g_Game_Free;
+{$IFNDEF HEADLESS}
g_GUI_ShowWindow('MainMenu');
gMusic.SetByName('MUSIC_MENU');
gMusic.Play();
+{$ENDIF}
gState := STATE_MENU;
end else
begin
e_KeyPressed(JOY2_ATTACK) or e_KeyPressed(JOY3_ATTACK)
)
and (not gJustChatted) and (not gConsoleShow) and (not gChatShow)
+{$IFNDEF HEADLESS}
and (g_ActiveWindow = nil)
+{$ENDIF}
)
then
begin
// Обрабатываем клавиши игроков:
if gPlayer1 <> nil then gPlayer1.ReleaseKeys();
if gPlayer2 <> nil then gPlayer2.ReleaseKeys();
+{$IFDEF HEADLESS}
+ if (not gConsoleShow) and (not gChatShow) then
+{$ELSE}
if (not gConsoleShow) and (not gChatShow) and (g_ActiveWindow = nil) then
+{$ENDIF}
begin
ProcessPlayerControls(gPlayer1, 0, P1MoveButton);
ProcessPlayerControls(gPlayer2, 1, P2MoveButton);
end; // if server
// Наблюдатель
- if (gPlayer1 = nil) and (gPlayer2 = nil) and
- (not gConsoleShow) and (not gChatShow) and (g_ActiveWindow = nil) then
+ if (gPlayer1 = nil) and (gPlayer2 = nil)
+ and (not gConsoleShow) and (not gChatShow)
+{$IFNDEF HEADLESS}
+ and (g_ActiveWindow = nil)
+{$ENDIF}
+ then
begin
if not gSpectKeyPress then
begin
end; // if gameOn ...
// Активно окно интерфейса - передаем клавиши ему:
+{$IFNDEF HEADLESS}
if g_ActiveWindow <> nil then
begin
w := e_GetFirstKeyPressed();
//e_WriteLog('Read language file', MSG_NOTIFY);
//g_Language_Load(DataDir + gLanguage + '.txt');
g_Language_Set(gLanguage);
-{$IFNDEF HEADLESS}
g_Menu_Reset();
-{$ENDIF}
gLanguageChange := False;
end;
end;
begin
KeyPress(IK_F10);
end;
+{$ENDIF} // NOT HEADLESS
Time := GetTickCount64() {div 1000};
g_Game_DeleteTestMap();
gExit := EXIT_QUIT;
- sys_RequestQuit;
+
+ {$IFNDEF HEADLESS}
+ sys_RequestQuit;
+ {$ENDIF}
end;
procedure g_Game_FreeData();
g_Player_ResetAll(Force or gLastMap, gGameSettings.GameType = GT_SINGLE);
gState := STATE_NONE;
- g_ActiveWindow := nil;
+ {$IFNDEF HEADLESS}
+ g_ActiveWindow := nil;
+ {$ENDIF}
gGameOn := True;
DisableCheats();
chstr := '';
if cmd = 'pause' then
begin
- if (g_ActiveWindow = nil) then
+ {$IFNDEF HEADLESS}
+ if (g_ActiveWindow = nil) then
+ g_Game_Pause(not gPauseMain);
+ {$ELSE}
g_Game_Pause(not gPauseMain);
+ {$ENDIF}
end
else if cmd = 'endgame' then
gExit := EXIT_SIMPLE
end;
{$ENDIF}
+{$IFNDEF HEADLESS}
procedure g_Game_InGameMenu(Show: Boolean);
begin
if (g_ActiveWindow = nil) and Show then
g_Game_Pause(False);
end;
end;
+{$ENDIF}
procedure g_Game_Pause (Enable: Boolean);
var
PBarWasHere := false;
end;
- g_ActiveWindow := nil;
- ProcessLoading(True);
+ {$IFNDEF HEADLESS}
+ g_ActiveWindow := nil;
+ {$ENDIF}
+
+ ProcessLoading(true);
end;
procedure g_Game_StepLoading(Value: Integer = -1);
diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas
index ff77e887a12aa774f74f770fc8c67d0bae94f0cb..5da0d5a561cac1763cb0c5f95d41f12b8b81d4f4 100644 (file)
--- a/src/game/g_gui.pas
+++ b/src/game/g_gui.pas
WM_CHAR = 102;
WM_USER = 110;
+ MESSAGE_DIKEY = WM_USER + 1;
+
type
TMessage = record
Msg: DWORD;
index a75db11bba78186bbde0367068d7540606c4fc8e..c392db9dcb22a5a9449d1343a1fd9ca46ecdb978 100644 (file)
--- a/src/game/g_language.pas
+++ b/src/game/g_language.pas
implementation
uses
- SysUtils, g_gui, g_basic, e_log, e_input;
+ SysUtils, {g_gui,} g_basic, e_log, e_input;
const
g_lang_default: Array [TStrings_Locale] of Array [1..3] of String = (
index b97e48dec90db625917302dfb22e9bd6687dc8b9..d31219cfe4c48be4bc7ca92c9862f6d819855f3d 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
implementation
uses
+ {$IFNDEF HEADLESS}
+ g_menu,
+ {$ENDIF}
e_log, g_sound, g_gfx, g_player, g_game,
g_weapons, g_triggers, g_items, g_options,
- g_console, g_map, Math, g_menu, wadreader,
+ g_console, g_map, Math, wadreader,
g_language, g_netmsg, idpool, utils, xstreams;
diff --git a/src/game/g_net.pas b/src/game/g_net.pas
index 96f67908e98ee03f8771204ba8b94688e2bb7d54..ab13a28c238117ce4ac28d930a91ec515caa51a1 100644 (file)
--- a/src/game/g_net.pas
+++ b/src/game/g_net.pas
SysUtils,
e_input, e_res, g_options,
g_nethandler, g_netmsg, g_netmaster, g_player, g_window, g_console,
- g_game, g_language, g_weapons, ctypes, g_system, g_map;
+ g_game, g_language, g_weapons, ctypes, g_map;
const
FILE_CHUNK_SIZE = 8192;
index 1484f6b23ba399ff1ea243c95ca5af4fc3696963..a95fa0a529707f1cd0c718e09822f3a1d0b5fd9a 100644 (file)
--- a/src/game/g_netmaster.pas
+++ b/src/game/g_netmaster.pas
implementation
uses
+ {$IFNDEF HEADLESS}
+ g_gui, g_menu, r_game, g_system,
+ {$ENDIF}
e_input, e_log, g_net, g_console,
- g_map, g_game, g_sound, g_gui, g_menu, g_options, g_language, g_basic, r_game,
- wadreader, g_system, utils, hashtable;
+ g_map, g_game, g_sound, g_options, g_language, g_basic,
+ wadreader, utils, hashtable;
// ////////////////////////////////////////////////////////////////////////// //
if gConsoleShow or gChatShow then
Exit;
- qm := sys_HandleInput(); // this updates kbd
+ {$IFDEF HEADLESS}
+ qm := True;
+ {$ELSE}
+ qm := sys_HandleInput(); // this updates kbd
+ {$ENDIF}
if qm or e_KeyPressed(IK_ESCAPE) or e_KeyPressed(VK_ESCAPE) or
e_KeyPressed(JOY0_JUMP) or e_KeyPressed(JOY1_JUMP) or
SL := nil;
ST := nil;
gState := STATE_MENU;
+{$IFNDEF HEADLESS}
g_GUI_ShowWindow('MainMenu');
g_GUI_ShowWindow('NetGameMenu');
g_GUI_ShowWindow('NetClientMenu');
g_Sound_PlayEx(WINDOW_CLOSESOUND);
+{$ENDIF}
Exit;
end;
begin
slWaitStr := _lc[I_NET_SLIST_WAIT];
+{$IFNDEF HEADLESS}
r_Game_Draw;
sys_Repaint;
+{$ENDIF}
if g_Net_Slist_Fetch(SL) then
begin
Srv := GetServerFromTable(slSelection, SL, ST);
if Srv.Password then
begin
+{$IFNDEF HEADLESS}
PromptIP := Srv.IP;
PromptPort := Srv.Port;
+{$ENDIF}
gState := STATE_MENU;
+{$IFNDEF HEADLESS}
g_GUI_ShowWindow('ClientPasswordMenu');
+{$ENDIF}
SL := nil;
ST := nil;
slReturnPressed := True;
diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas
index 2e6d0a45ee71974f5f8d43704f9d960904139224..bc7f7c98c52bf1f62494a22b1951117d472a537e 100644 (file)
--- a/src/game/g_netmsg.pas
+++ b/src/game/g_netmsg.pas
implementation
uses
+ {$IFNDEF HEADLESS}
+ g_gui,
+ {$ENDIF}
Math, ENet, e_input, e_log, g_base, g_basic,
g_textures, g_gfx, g_sound, g_console, g_options,
- g_game, g_player, g_map, g_panel, g_items, g_weapons, g_phys, g_gui,
+ g_game, g_player, g_map, g_panel, g_items, g_weapons, g_phys,
g_language, g_monsters, g_netmaster, utils, wadreader, MAPDEF;
const
kByte := 0;
Predict := NetPredictSelf; // and (not NetGotKeys);
+{$IFDEF HEADLESS}
+ if (not gConsoleShow) and (not gChatShow) then
+{$ELSE}
if (not gConsoleShow) and (not gChatShow) and (g_ActiveWindow = nil) then
+{$ENDIF}
begin
strafeDir := P1MoveButton shr 4;
P1MoveButton := P1MoveButton and $0F;
diff --git a/src/game/g_options.pas b/src/game/g_options.pas
index dc45df447807a0bf31c342d080e46b10d975cffe..aba27649cbc0eb14e6481865e16a59b8b3a9ca67 100644 (file)
--- a/src/game/g_options.pas
+++ b/src/game/g_options.pas
{$ENDIF}
e_log, e_input, g_console, g_sound, g_gfx, g_player, Math,
g_map, g_net, g_netmaster, SysUtils, CONFIG, g_game,
- g_items, wadreader, g_touch, envvars, g_system;
+ g_items, wadreader, envvars;
var
machine: Integer;
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index 2e9afdc5cdd6052544ad63fca213083fca35c678..56199cee6f859fcdfb6409f085597374bc9715db 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
g_holmes,
{$ENDIF}
{$IFNDEF HEADLESS}
- r_render,
+ r_render, g_menu,
{$ENDIF}
e_log, g_map, g_items, g_console, g_gfx, Math,
- g_options, g_triggers, g_menu, g_game, g_grid, e_res,
+ g_options, g_triggers, g_game, g_grid, e_res,
wadreader, g_monsters, CONFIG, g_language,
g_net, g_netmsg,
utils, xstreams;
index 142401547a3c6b77d9d01bacd8b1bb13f2b74fde..1d1fca781779cccd2b76e08cc34ab2af6a458046 100644 (file)
function g_PlayerModel_GetGibs (ModelID: Integer; var Gibs: TGibsArray): Boolean;
function g_PlayerModel_GetIndex (ModelName: String): Integer;
+procedure g_PlayerModel_LoadFake (ModelName, FileName: String);
+
(* --- private data --- *)
type
end;
end;
+ procedure g_PlayerModel_LoadFake (ModelName, FileName: String);
+ var id: Integer;
+ begin
+ SetLength(PlayerModelsArray, Length(PlayerModelsArray) + 1);
+ id := High(PlayerModelsArray);
+ PlayerModelsArray[id].Name := ModelName;
+ PlayerModelsArray[id].HaveWeapon := False;
+ PlayerModelsArray[id].FileName := FileName;
+ end;
+
function g_PlayerModel_Load(FileName: string): Boolean;
var
ID: DWORD;
diff --git a/src/game/g_window.pas b/src/game/g_window.pas
index 2cbc4a75bfc3414fea1b6e83e8ce634a9e8e25d9..6d08b18e0f771445863b5b397424334385bc8447 100644 (file)
--- a/src/game/g_window.pas
+++ b/src/game/g_window.pas
uses
{$IFNDEF HEADLESS}
- r_render,
+ r_render, g_system,
{$ENDIF}
- e_sound, g_system, g_net
+ e_sound, g_net
;
procedure ProcessLoading (forceUpdate: Boolean = False);
+ var update: Boolean;
begin
- if sys_HandleInput() = False then
+ {$IFDEF HEADLESS}
+ update := True;
+ {$ELSE}
+ update := sys_HandleInput() = False;
+ {$ENDIF}
+ if update then
begin
{$IFNDEF HEADLESS}
r_Render_DrawLoading(forceUpdate);