explosions: cache rounded X,Y values
authorsheepluva
Tue, 29 Jun 2010 22:16:26 +0200
changeset 3590 66e1bc1ea3a9
parent 3589 115c76f94b4a
child 3591 c447d5218f6f
explosions: cache rounded X,Y values
hedgewars/VGSHandlers.inc
--- a/hedgewars/VGSHandlers.inc	Tue Jun 29 15:52:13 2010 -0400
+++ b/hedgewars/VGSHandlers.inc	Tue Jun 29 22:16:26 2010 +0200
@@ -498,11 +498,13 @@
 
 procedure doStepExplosion(Gear: PVisualGear; Steps: Longword);
 var i: LongWord;
+gX,gY: LongInt;
 begin
-
-for i:= 0 to 31 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtFire);
-for i:= 0 to 8 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtExplPart);
-for i:= 0 to 8 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtExplPart2);
+gX:= hwRound(Gear^.X);
+gY:= hwRound(Gear^.Y);
+for i:= 0 to 31 do AddVisualGear(gX, gY, vgtFire);
+for i:= 0 to  8 do AddVisualGear(gX, gY, vgtExplPart);
+for i:= 0 to  8 do AddVisualGear(gX, gY, vgtExplPart2);
 Gear^.doStep:= @doStepExplosionWork;
 if Steps > 1 then Gear^.doStep(Gear, Steps-1);
 end;