# HG changeset patch # User nemo # Date 1566844023 14400 # Node ID c117e17b90bcc490fc52b439272047c73a68e737 # Parent b5e0a39856fd6f9a62021766bf68e4284163f5bd flag some of the renderstringtex which are taking up a ton of processing time with --stats-only and pas2c diff -r b5e0a39856fd -r c117e17b90bc hedgewars/uGears.pas --- a/hedgewars/uGears.pas Mon Aug 26 19:05:28 2019 +0300 +++ b/hedgewars/uGears.pas Mon Aug 26 14:27:03 2019 -0400 @@ -276,7 +276,7 @@ end; if curHandledGear^.Active then begin - if curHandledGear^.RenderTimer then + if (not cOnlyStats) and curHandledGear^.RenderTimer then begin // Mine timer if (curHandledGear^.Kind in [gtMine, gtSMine, gtAirMine]) then diff -r b5e0a39856fd -r c117e17b90bc hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Mon Aug 26 19:05:28 2019 +0300 +++ b/hedgewars/uGearsHandlersMess.pas Mon Aug 26 14:27:03 2019 -0400 @@ -2422,7 +2422,7 @@ doStepCase(Gear) else // health texture (FlightTime = health when the last texture was generated) - if (Gear^.Health <> Gear^.FlightTime) or (Gear^.Tex = nil) then + if (not cOnlyStats) and ((Gear^.Health <> Gear^.FlightTime) or (Gear^.Tex = nil)) then begin Gear^.FlightTime:= Gear^.Health; FreeAndNilTexture(Gear^.Tex); @@ -2500,7 +2500,7 @@ dec(Gear^.Health, Gear^.Damage); Gear^.Damage := 0; // health texture (FlightTime = health when the last texture was generated) - if (Gear^.Health <> Gear^.FlightTime) or (Gear^.Tex = nil) then + if (not cOnlyStats) and ((Gear^.Health <> Gear^.FlightTime) or (Gear^.Tex = nil)) then begin Gear^.FlightTime:= Gear^.Health; FreeAndNilTexture(Gear^.Tex); @@ -2523,12 +2523,14 @@ i:= 1 else i:= 0 + else if cOnlyStats then + i:= 0 // Always show health (default) else i:= 1; if i = 1 then begin - if (Gear^.Health <> Gear^.FlightTime) or (Gear^.Tex = nil) then + if (not cOnlyStats) and ((Gear^.Health <> Gear^.FlightTime) or (Gear^.Tex = nil)) then begin Gear^.FlightTime:= Gear^.Health; FreeAndNilTexture(Gear^.Tex); @@ -2537,7 +2539,7 @@ end else begin - if (Gear^.FlightTime <> $ffffffff) or (Gear^.Tex = nil) then + if (not cOnlyStats) and ((Gear^.FlightTime <> $ffffffff) or (Gear^.Tex = nil)) then begin Gear^.FlightTime:= $ffffffff; FreeAndNilTexture(Gear^.Tex); @@ -4615,7 +4617,7 @@ i:= Gear^.Health div 20; - if (i <> Gear^.Damage) and ((GameTicks and $3F) = 0) then + if (not cOnlyStats) and (i <> Gear^.Damage) and ((GameTicks and $3F) = 0) then begin Gear^.Damage:= i; FreeAndNilTexture(Gear^.Tex); @@ -5887,7 +5889,7 @@ else begin i:= Gear^.Health div 5; - if (i <> Gear^.Damage) and ((GameTicks and $3F) = 0) then + if (not cOnlyStats) and (i <> Gear^.Damage) and ((GameTicks and $3F) = 0) then begin Gear^.Damage:= i; FreeAndNilTexture(Gear^.Tex); @@ -5978,7 +5980,7 @@ else begin i:= Gear^.Health div 10; - if (i <> Gear^.Damage) and ((GameTicks and $3F) = 0) then + if (not cOnlyStats) and (i <> Gear^.Damage) and ((GameTicks and $3F) = 0) then begin Gear^.Damage:= i; FreeAndNilTexture(Gear^.Tex); @@ -6497,7 +6499,7 @@ t:LongInt; begin t:= Gear^.Health div 10; - if (t <> Gear^.Damage) and ((GameTicks and $3F) = 0) then + if (not cOnlyStats) and (t <> Gear^.Damage) and ((GameTicks and $3F) = 0) then begin Gear^.Damage:= t; FreeAndNilTexture(Gear^.Tex); diff -r b5e0a39856fd -r c117e17b90bc hedgewars/uRender.pas --- a/hedgewars/uRender.pas Mon Aug 26 19:05:28 2019 +0300 +++ b/hedgewars/uRender.pas Mon Aug 26 14:27:03 2019 -0400 @@ -2185,6 +2185,7 @@ procedure freeModule; begin + if cOnlyStats then exit; {$IFDEF GL2} glDeleteProgram(shaderMain); glDeleteProgram(shaderWater);