From: fgsfds Date: Sat, 26 Aug 2017 14:27:19 +0000 (+0300) Subject: don't do particles in headless; draw time in scoreboard X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=674a902ed6e62076ad4bafc2b8f74d181f6bf287;p=d2df-sdl.git don't do particles in headless; draw time in scoreboard --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 24f6324..b198947 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -982,6 +982,17 @@ begin gExit := 0; end; +procedure drawTime(X, Y: Integer); inline; +begin + e_TextureFontPrint(x, y, + Format('%d:%.2d:%.2d', [ + gTime div 1000 div 3600, + (gTime div 1000 div 60) mod 60, + gTime div 1000 mod 60 + ]), + gStdFont); +end; + procedure DrawStat(); var pc, x, y, w, h: Integer; @@ -1011,6 +1022,8 @@ begin e_DrawFillQuad(x, y, x+w-1, y+h-1, 64, 64, 64, 32); e_DrawQuad(x, y, x+w-1, y+h-1, 255, 127, 0); + drawTime(x+w-78, y+8); + wad := g_ExtractWadNameNoPath(gMapInfo.Map); map := g_ExtractFileName(gMapInfo.Map); mapstr := wad + ':\' + map + ' - ' + gMapInfo.Name; @@ -3300,9 +3313,7 @@ begin end; if gGameOn and gShowTime and (gGameSettings.GameType in [GT_CUSTOM, GT_SERVER, GT_CLIENT]) then - e_TextureFontPrint(gScreenWidth-72, 0, - Format('%d:%.2d:%.2d', [gTime div 1000 div 3600, (gTime div 1000 div 60) mod 60, gTime div 1000 mod 60]), - gStdFont); + drawTime(gScreenWidth-72, gScreenHeight-16); if gGameOn then drawProfilers(); end; diff --git a/src/game/g_gfx.pas b/src/game/g_gfx.pas index e74ddcc..b137db3 100644 --- a/src/game/g_gfx.pas +++ b/src/game/g_gfx.pas @@ -327,6 +327,9 @@ end; procedure g_GFX_Init(); begin //CreateCollideMap(); +{$IFDEF HEADLESS} + gpart_dbg_enabled := False; +{$ENDIF} end; @@ -1048,6 +1051,7 @@ var DevY1, DevY2: Byte; l: Integer; begin + if not gpart_dbg_enabled then Exit; l := Length(Particles); if l = 0 then exit; if Count > l then Count := l; @@ -1107,6 +1111,7 @@ var CRnd: Byte; CC: SmallInt; begin + if not gpart_dbg_enabled then Exit; if Kind = BLOOD_SPARKS then begin g_GFX_SparkVel(fX, fY, 2 + Random(2), -VX div 2, -VY div 2, DevX, DevY); @@ -1203,6 +1208,7 @@ var BaseVelX, BaseVelY: Single; l: Integer; begin + if not gpart_dbg_enabled then Exit; l := Length(Particles); if l = 0 then Exit; @@ -1262,6 +1268,7 @@ var DevY1, DevY2: Byte; l: Integer; begin + if not gpart_dbg_enabled then Exit; l := Length(Particles); if l = 0 then Exit; @@ -1342,6 +1349,7 @@ var a: Integer; l: Integer; begin + if not gpart_dbg_enabled then Exit; l := Length(Particles); if l = 0 then Exit; @@ -1430,6 +1438,7 @@ var DevY1, DevY2: Byte; l, liquidx: Integer; begin + if not gpart_dbg_enabled then Exit; l := Length(Particles); if l = 0 then Exit; @@ -1534,6 +1543,7 @@ procedure g_GFX_OnceAnim(X, Y: Integer; Anim: TAnimation; AnimType: Byte = 0); var find_id: DWORD; begin + if not gpart_dbg_enabled then Exit; if Anim = nil then Exit;