diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index 41099da27c9b46b9d15508da7328bf67a10d23db..77fd80ac499b78f21c870be4cb5a75d167fca1e2 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
procedure g_Game_ClearLoading();
procedure g_Game_SetDebugMode();
procedure DrawLoadingStat();
-procedure DrawMenuBackground(tex: AnsiString; ID: DWord);
+procedure DrawMenuBackground(tex: AnsiString);
{ procedure SetWinPause(Enable: Boolean); }
STD_PLAYER_MODEL = 'Doomer';
+{$IFDEF HEADLESS}
+ DEFAULT_PLAYERS = 0;
+{$ELSE}
+ DEFAULT_PLAYERS = 1;
+{$ENDIF}
+
var
gStdFont: DWORD;
gGameSettings: TGameSettings;
begin
s := g_ExtractWadName(MegaWAD.endpic);
if s = '' then s := MapsDir+WAD else s := GameDir+'/wads/';
+ TEXTUREFILTER := GL_LINEAR;
g_Texture_CreateWADEx('TEXTURE_endpic', s+MegaWAD.endpic);
+ TEXTUREFILTER := GL_NEAREST;
end;
MegaWAD.endmus := cfg.ReadStr('megawad', 'endmus', 'Standart.wad:D2DMUS\ÊÎÍÅÖ');
if MegaWAD.endmus <> '' then
end;
end;
-procedure DrawMenuBackground(tex: AnsiString; ID: DWord);
+procedure DrawMenuBackground(tex: AnsiString);
var
w, h: Word;
+ ID: DWord;
begin
if g_Texture_Get(tex, ID) then
w := round(w * 1.333 * (gScreenHeight / h))
else
w := trunc(w * (gScreenHeight / h));
- e_DrawSize(ID, (gScreenWidth - w) div 2, 0, 0, False, False, w, gScreenHeight);
- end
+ e_DrawSize(ID, (gScreenWidth - w) div 2, 0, 0, False, False, w, gScreenHeight);
+ end
else e_Clear(GL_COLOR_BUFFER_BIT, 0, 0, 0);
end;
if plView1 <> nil then
begin
gHearPoint1.Active := True;
- gHearPoint1.Coords.X := plView1.GameX;
- gHearPoint1.Coords.Y := plView1.GameY;
+ gHearPoint1.Coords.X := plView1.GameX + PLAYER_RECT.Width;
+ gHearPoint1.Coords.Y := plView1.GameY + PLAYER_RECT.Height DIV 2;
end else
gHearPoint1.Active := False;
if plView2 <> nil then
begin
gHearPoint2.Active := True;
- gHearPoint2.Coords.X := plView2.GameX;
- gHearPoint2.Coords.Y := plView2.GameY;
+ gHearPoint2.Coords.X := plView2.GameX + PLAYER_RECT.Width;
+ gHearPoint2.Coords.Y := plView2.GameY + PLAYER_RECT.Height DIV 2;
end else
gHearPoint2.Active := False;
begin
if (gState = STATE_MENU) then
begin
- if (g_ActiveWindow = nil) or (g_ActiveWindow.BackTexture = '') then DrawMenuBackground('MENU_BACKGROUND', ID);
+ if (g_ActiveWindow = nil) or (g_ActiveWindow.BackTexture = '') then DrawMenuBackground('MENU_BACKGROUND');
// F3 at menu will show game loading dialog
if e_KeyPressed(IK_F3) then g_Menu_Show_LoadMenu(true);
if (g_ActiveWindow <> nil) then
else
back := 'INTER';
- DrawMenuBackground(back, ID);
+ DrawMenuBackground(back);
DrawCustomStat();
begin
back := 'INTER';
- DrawMenuBackground(back, ID);
+ DrawMenuBackground(back);
DrawSingleStat();
if gState = STATE_ENDPIC then
begin
ID := DWORD(-1);
- if not g_Texture_Get('TEXTURE_endpic', ID) then
- g_Texture_Get(_lc[I_TEXTURE_ENDPIC], ID);
-
- if ID <> DWORD(-1) then
- e_DrawSize(ID, 0, 0, 0, False, False, gScreenWidth, gScreenHeight)
- else
- e_Clear(GL_COLOR_BUFFER_BIT, 0, 0, 0);
+ if g_Texture_Get('TEXTURE_endpic', ID) then DrawMenuBackground('TEXTURE_endpic')
+ else DrawMenuBackground(_lc[I_TEXTURE_ENDPIC]);
if g_ActiveWindow <> nil then
begin
// e_DrawSize(ID, 0, 0, 0, False, False, gScreenWidth, gScreenHeight);
// //e_DrawFillQuad(0, 0, gScreenWidth-1, gScreenHeight-1, 48, 48, 48, 180);
// end;
- DrawMenuBackground('MENU_BACKGROUND', ID);
+ DrawMenuBackground('MENU_BACKGROUND');
e_DarkenQuadWH(0, 0, gScreenWidth, gScreenHeight, 150);
g_Serverlist_Draw(slCurrent, slTable);
end;
if not InMsg.Init(Ptr, NetEvent.packet^.dataLength, True) then
continue;
+ InMsg.ReadLongWord(); // skip size
MID := InMsg.ReadByte();
if (MID = NET_MSG_INFO) and (State = 0) then
e_StopChannels();
end;
-procedure g_Game_UpdateTriggerSounds();
-var
- i: Integer;
+procedure g_Game_UpdateTriggerSounds;
+ var i: Integer;
begin
if gTriggers <> nil then
for i := 0 to High(gTriggers) do
with gTriggers[i] do
- if (TriggerType = TRIGGER_SOUND) and
- (Sound <> nil) and
- (tgcLocal) and
- Sound.IsPlaying() then
- begin
- if ((gPlayer1 <> nil) and g_CollidePoint(gPlayer1.GameX, gPlayer1.GameY, X, Y, Width, Height)) or
- ((gPlayer2 <> nil) and g_CollidePoint(gPlayer2.GameX, gPlayer2.GameY, X, Y, Width, Height)) then
- begin
- Sound.SetPan(0.5 - tgcPan/255.0);
- Sound.SetVolume(tgcVolume/255.0);
- end
- else
- Sound.SetCoords(X+(Width div 2), Y+(Height div 2), tgcVolume/255.0);
- end;
+ if (TriggerType = TRIGGER_SOUND) and (Sound <> nil) and tgcLocal and Sound.IsPlaying() then
+ Sound.SetCoordsRect(X, Y, Width, Height, tgcVolume / 255.0)
end;
function g_Game_IsWatchedPlayer(UID: Word): Boolean;
// Number of players:
s := Find_Param_Value(pars, '-pl');
if (s = '') then
- n := 1
+ n := DEFAULT_PLAYERS
else
- n := StrToIntDef(s, 1);
+ n := StrToIntDef(s, DEFAULT_PLAYERS);
// Start:
s := Find_Param_Value(pars, '-port');