# HG changeset patch # User unc0rr # Date 1463311777 -10800 # Node ID 4600dcb9db4f0f53a106064a2014554ffef7dba7 # Parent d8844d4c67de8d6f6965e138c9ce9308cb2edfde - Use IntToStr() in preference to Str() - Remove senseless Str() call in uRandom.GetNext diff -r d8844d4c67de -r 4600dcb9db4f hedgewars/uGearsHedgehog.pas --- a/hedgewars/uGearsHedgehog.pas Sun May 15 13:18:34 2016 +0200 +++ b/hedgewars/uGearsHedgehog.pas Sun May 15 14:29:37 2016 +0300 @@ -732,8 +732,7 @@ PlaySound(sndShotgunReload); inc(HH^.Health, Gear^.Health); HH^.Hedgehog^.Effects[hePoisoned] := 0; - str(Gear^.Health, s); - s:= '+' + s; + s:= '+' + IntToStr(Gear^.Health); AddCaption(ansistring(s), HH^.Hedgehog^.Team^.Clan^.Color, capgrpAmmoinfo); RenderHealth(HH^.Hedgehog^); RecountTeamHealth(HH^.Hedgehog^.Team); diff -r d8844d4c67de -r 4600dcb9db4f hedgewars/uGearsUtils.pas --- a/hedgewars/uGearsUtils.pas Sun May 15 13:18:34 2016 +0200 +++ b/hedgewars/uGearsUtils.pas Sun May 15 14:29:37 2016 +0300 @@ -274,8 +274,7 @@ // was considering pulsing on attack, Tiy thinks it should be permanent while in play //CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State or gstVampiric; inc(CurrentHedgehog^.Gear^.Health,vampDmg); - str(vampDmg, s); - s:= '+' + s; + s:= '+' + IntToStr(vampDmg); AddCaption(ansistring(s), CurrentHedgehog^.Team^.Clan^.Color, capgrpAmmoinfo); RenderHealth(CurrentHedgehog^); RecountTeamHealth(CurrentHedgehog^.Team); diff -r d8844d4c67de -r 4600dcb9db4f hedgewars/uRandom.pas --- a/hedgewars/uRandom.pas Sun May 15 13:18:34 2016 +0200 +++ b/hedgewars/uRandom.pas Sun May 15 14:29:37 2016 +0300 @@ -49,16 +49,14 @@ end; function GetNext: Longword; inline; -var s : string; begin -n:= (n + 1) and $3F; -cirbuf[n]:= + n:= (n + 1) and $3F; + cirbuf[n]:= (cirbuf[(n + 40) and $3F] + {n - 24 mod 64} cirbuf[(n + 9) and $3F]) {n - 55 mod 64} and $7FFFFFFF; {mod 2^31} - GetNext:= cirbuf[n]; - str(GetNext, s); + GetNext:= cirbuf[n]; end; procedure SetRandomSeed(Seed: shortstring; dropAdditionalPart: boolean); diff -r d8844d4c67de -r 4600dcb9db4f hedgewars/uStore.pas --- a/hedgewars/uStore.pas Sun May 15 13:18:34 2016 +0200 +++ b/hedgewars/uStore.pas Sun May 15 14:29:37 2016 +0300 @@ -578,7 +578,7 @@ procedure RenderHealth(var Hedgehog: THedgehog); var s: shortstring; begin -str(Hedgehog.Gear^.Health, s); +s:= IntToStr(Hedgehog.Gear^.Health); FreeAndNilTexture(Hedgehog.HealthTagTex); Hedgehog.HealthTagTex:= RenderStringTex(ansistring(s), Hedgehog.Team^.Clan^.Color, fnt16) end; diff -r d8844d4c67de -r 4600dcb9db4f hedgewars/uVisualGearsHandlers.pas --- a/hedgewars/uVisualGearsHandlers.pas Sun May 15 13:18:34 2016 +0200 +++ b/hedgewars/uVisualGearsHandlers.pas Sun May 15 14:29:37 2016 +0300 @@ -75,7 +75,7 @@ procedure initModule; implementation -uses uCollisions, uVariables, Math, uConsts, uVisualGearsList, uFloat, uSound, uRenderUtils, uWorld; +uses uCollisions, uVariables, Math, uConsts, uVisualGearsList, uFloat, uSound, uRenderUtils, uWorld, uUtils; procedure doStepFlake(Gear: PVisualGear; Steps: Longword); var sign: real; @@ -697,9 +697,8 @@ procedure doStepHealthTag(Gear: PVisualGear; Steps: Longword); var s: shortstring; begin -s:= ''; +s:= IntToStr(Gear^.State); -str(Gear^.State, s); if Gear^.Hedgehog <> nil then Gear^.Tex:= RenderStringTex(ansistring(s), Gear^.Hedgehog^.Team^.Clan^.Color, fnt16) else