diff --git a/src/game/g_game.pas b/src/game/g_game.pas
index f4486028795f4f80134a47d33b5de80b517f9f53..b0e9e01feb36fd0bf5cbfb7e46c6c67b5134d917 100644 (file)
--- a/src/game/g_game.pas
+++ b/src/game/g_game.pas
gPlayer2: TPlayer = nil;
gPlayerDrawn: TPlayer = nil;
gTime: LongWord;
gPlayer2: TPlayer = nil;
gPlayerDrawn: TPlayer = nil;
gTime: LongWord;
+ gLerpFactor: Single = 1.0;
gSwitchGameMode: Byte = GM_DM;
gHearPoint1, gHearPoint2: THearPoint;
gSoundEffectsDF: Boolean = False;
gSwitchGameMode: Byte = GM_DM;
gHearPoint1, gHearPoint2: THearPoint;
gSoundEffectsDF: Boolean = False;
end;
end;
end;
end;
+ // these are in separate PreUpdate functions because they can interact during Update()
+ // we don't care that much about corpses and gibs
+ g_Player_PreUpdate();
+ g_Monsters_PreUpdate();
+ g_Items_PreUpdate();
+ g_Weapon_PreUpdate();
+
// Îáíîâëÿåì âñå îñòàëüíîå:
g_Map_Update();
g_Items_Update();
// Îáíîâëÿåì âñå îñòàëüíîå:
g_Map_Update();
g_Items_Update();
procedure DrawPlayer(p: TPlayer);
var
procedure DrawPlayer(p: TPlayer);
var
- px, py, a, b, c, d, i: Integer;
+ px, py, a, b, c, d, i, fX, fY: Integer;
//R: TRect;
begin
if (p = nil) or (p.FDummy) then
//R: TRect;
begin
if (p = nil) or (p.FDummy) then
glPushMatrix();
glPushMatrix();
- px := p.GameX + PLAYER_RECT_CX;
- py := p.GameY + PLAYER_RECT_CY+p.Obj.slopeUpLeft;
+ p.Obj.lerp(gLerpFactor, fX, fY);
+ px := fX + PLAYER_RECT_CX;
+ py := fY + PLAYER_RECT_CY+p.Obj.slopeUpLeft;
if (g_dbg_scale = 1.0) and (not g_dbg_ignore_bounds) then
begin
if (g_dbg_scale = 1.0) and (not g_dbg_ignore_bounds) then
begin
p.IncCam := nclamp(p.IncCam, min(0, -120 - i), 0);
end;
p.IncCam := nclamp(p.IncCam, min(0, -120 - i), 0);
end;
- sY := sY - p.IncCam;
+ sY := sY - nlerp(p.IncCamOld, p.IncCam, gLerpFactor);
if (not g_dbg_ignore_bounds) then
begin
if (not g_dbg_ignore_bounds) then
begin
else if gPlayers[i].Team = TEAM_BLUE then Inc(nb)
end;
else if gPlayers[i].Team = TEAM_BLUE then Inc(nb)
end;
- if (n < 2) or ((gGameSettings.GameMode = GM_TDM) and ((nr = 0) or (nb = 0))) then
+ if (n < 1) or ((gGameSettings.GameMode = GM_TDM) and ((nr = 0) or (nb = 0))) then
begin
// wait a second until the fuckers finally decide to join
gLMSRespawn := LMS_RESPAWN_WARMUP;
begin
// wait a second until the fuckers finally decide to join
gLMSRespawn := LMS_RESPAWN_WARMUP;
if g_Game_IsServer then
begin
gGameSettings.WarmupTime := gsWarmupTime;
if g_Game_IsServer then
begin
gGameSettings.WarmupTime := gsWarmupTime;
+ // extend warmup if it's already going
+ if gLMSRespawn = LMS_RESPAWN_WARMUP then
+ begin
+ gLMSRespawnTime := gTime + gsWarmupTime * 1000;
+ if g_Game_IsNet then MH_SEND_GameEvent(NET_EV_LMS_WARMUP, gLMSRespawnTime - gTime);
+ end;
if g_Game_IsNet then MH_SEND_GameSettings;
end;
end;
if g_Game_IsNet then MH_SEND_GameSettings;
end;
end;
end;
'r_reset':
begin
end;
'r_reset':
begin
- sys_EnableVSync(gVSync);
gRC_Width := Max(1, gRC_Width);
gRC_Height := Max(1, gRC_Height);
gBPP := Max(1, gBPP);
gRC_Width := Max(1, gRC_Width);
gRC_Height := Max(1, gRC_Height);
gBPP := Max(1, gBPP);
e_LogWriteln('resolution changed')
else
e_LogWriteln('resolution not changed');
e_LogWriteln('resolution changed')
else
e_LogWriteln('resolution not changed');
+ sys_EnableVSync(gVSync);
end;
'g_language':
begin
end;
'g_language':
begin