hedgewars/uVisualGears.pas
changeset 4422 5e8cfef25ccb
parent 4420 6be946bcd17a
child 4443 d393b9ccd328
equal deleted inserted replaced
4421:58c6918acde4 4422:5e8cfef25ccb
    95             @doStepBulletHit,
    95             @doStepBulletHit,
    96             @doStepCircle
    96             @doStepCircle
    97         );
    97         );
    98 
    98 
    99 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0; Critical: Boolean = false): PVisualGear;
    99 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0; Critical: Boolean = false): PVisualGear;
       
   100 const VGCounter: Longword = 0;
   100 var gear: PVisualGear;
   101 var gear: PVisualGear;
   101     t: Longword;
   102     t: Longword;
   102     sp: real;
   103     sp: real;
   103 begin
   104 begin
   104 if (GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet)) then // we are scrolling now
   105 if (GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet)) then // we are scrolling now
   122     begin
   123     begin
   123       AddVisualGear:= nil;
   124       AddVisualGear:= nil;
   124       exit
   125       exit
   125     end;
   126     end;
   126 
   127 
       
   128 inc(VGCounter);
   127 New(gear);
   129 New(gear);
   128 FillChar(gear^, sizeof(TVisualGear), 0);
   130 FillChar(gear^, sizeof(TVisualGear), 0);
   129 gear^.X:= real(X);
   131 gear^.X:= real(X);
   130 gear^.Y:= real(Y);
   132 gear^.Y:= real(Y);
   131 gear^.Kind := Kind;
   133 gear^.Kind := Kind;
   132 gear^.doStep:= doStepHandlers[Kind];
   134 gear^.doStep:= doStepHandlers[Kind];
   133 gear^.State:= 0;
   135 gear^.State:= 0;
   134 gear^.Tint:= $FFFFFFFF;
   136 gear^.Tint:= $FFFFFFFF;
       
   137 gear^.uid:= VGCounter;
   135 
   138 
   136 with gear^ do
   139 with gear^ do
   137     case Kind of
   140     case Kind of
   138     vgtFlake: begin
   141     vgtFlake: begin
   139                 Timer:= 0;
   142                 Timer:= 0;