hedgewars/VGSHandlers.inc
changeset 4452 258945553b18
parent 4421 58c6918acde4
child 4473 b6487d2c15ad
equal deleted inserted replaced
4451:1c342980b4aa 4452:258945553b18
   628       dec(Gear^.FrameTicks, Steps);
   628       dec(Gear^.FrameTicks, Steps);
   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: LongInt;
   634     i: LongWord;
   634     i: LongWord;
   635 begin
   635 begin
   636 with Gear^ do
   636 with Gear^ do
   637     if Frame <> 0 then
   637     if Frame <> 0 then
   638         for i:= 1 to Steps do
   638         for i:= 1 to Steps do
   643                 tmp:= Gear^.Tint and $FF;
   643                 tmp:= Gear^.Tint and $FF;
   644                 if tdY >= 0 then inc(tmp)
   644                 if tdY >= 0 then inc(tmp)
   645                 else dec(tmp);
   645                 else dec(tmp);
   646                 if tmp < round(dX) then tdY:= 1;
   646                 if tmp < round(dX) then tdY:= 1;
   647                 if tmp > round(dY) then tdY:= -1;
   647                 if tmp > round(dY) then tdY:= -1;
       
   648 		if tmp > 255 then tmp := 255;
       
   649 		if tmp < 0 then tmp := 0;
   648                 Gear^.Tint:= (Gear^.Tint and $FFFFFF00) or tmp
   650                 Gear^.Tint:= (Gear^.Tint and $FFFFFF00) or tmp
   649                 end
   651                 end
   650             end
   652             end
   651 end;
   653 end;