hedgewars/VGSHandlers.inc
changeset 4421 58c6918acde4
parent 4420 6be946bcd17a
child 4452 258945553b18
equal deleted inserted replaced
4420:6be946bcd17a 4421:58c6918acde4
   629 end;
   629 end;
   630 
   630 
   631 ////////////////////////////////////////////////////////////////////////////////
   631 ////////////////////////////////////////////////////////////////////////////////
   632 procedure doStepCircle(Gear: PVisualGear; Steps: Longword);
   632 procedure doStepCircle(Gear: PVisualGear; Steps: Longword);
   633 var tmp: byte;
   633 var tmp: byte;
       
   634     i: LongWord;
   634 begin
   635 begin
   635 with Gear^ do
   636 with Gear^ do
   636     if Frame <> 0 then
   637     if Frame <> 0 then
   637         begin
   638         for i:= 1 to Steps do
   638         inc(FrameTicks, Steps);
       
   639         if (FrameTicks mod Frame) = 0 then
       
   640             begin
   639             begin
   641             tmp:= Gear^.Tint and $FF;
   640             inc(FrameTicks);
   642             if tdY >= 0 then inc(tmp)
   641             if (FrameTicks mod Frame) = 0 then
   643             else dec(tmp);
   642                 begin
   644             if tmp < round(dX) then tdY:= 1;
   643                 tmp:= Gear^.Tint and $FF;
   645             if tmp > round(dY) then tdY:= -1;
   644                 if tdY >= 0 then inc(tmp)
   646             Gear^.Tint:= (Gear^.Tint and $FFFFFF00) or tmp
   645                 else dec(tmp);
       
   646                 if tmp < round(dX) then tdY:= 1;
       
   647                 if tmp > round(dY) then tdY:= -1;
       
   648                 Gear^.Tint:= (Gear^.Tint and $FFFFFF00) or tmp
       
   649                 end
   647             end
   650             end
   648         end
   651 end;
   649 end;