hedgewars/VGSHandlers.inc
branchhedgeroid
changeset 5385 a864a0aeed96
parent 5366 bfdd925e89a5
child 5491 3a82724de759
equal deleted inserted replaced
5383:cb217271f344 5385:a864a0aeed96
    44         begin
    44         begin
    45         dec(FrameTicks, vobSDFrameTicks);
    45         dec(FrameTicks, vobSDFrameTicks);
    46         inc(Frame);
    46         inc(Frame);
    47         if Frame = vobSDFramesCount then Frame:= 0
    47         if Frame = vobSDFramesCount then Frame:= 0
    48         end;
    48         end;
    49     X:= X + (cWindSpeedf * 600 + dX + tdX) * Steps;
    49     X:= X + (cWindSpeedf * 400 + dX + tdX) * Steps;
    50     if SuddenDeathDmg then
    50     if SuddenDeathDmg then
    51         Y:= Y + (dY + tdY + cGravityf * vobSDFallSpeed) * Steps
    51         Y:= Y + (dY + tdY + cGravityf * vobSDFallSpeed) * Steps
    52     else
    52     else
    53         Y:= Y + (dY + tdY + cGravityf * vobFallSpeed) * Steps;
    53         Y:= Y + (dY + tdY + cGravityf * vobFallSpeed) * Steps;
    54     Angle:= Angle + dAngle * Steps;
    54     Angle:= Angle + dAngle * Steps;
   605 
   605 
   606 inc(Gear^.Timer, Steps);
   606 inc(Gear^.Timer, Steps);
   607 (*
   607 (*
   608 FIXME - This block desyncs due to the way WorldDx is important for various things network related.
   608 FIXME - This block desyncs due to the way WorldDx is important for various things network related.
   609 One possible solution is, instead of using WorldDx, to use straight gl/SDL calls to jitter the screen a bit.
   609 One possible solution is, instead of using WorldDx, to use straight gl/SDL calls to jitter the screen a bit.
       
   610 
       
   611 // a comment by unC0Rr: instead of changing WorldDx shake cursor coordinates, that should be safe
       
   612 
   610 if (Gear^.Timer and 5) = 0 then
   613 if (Gear^.Timer and 5) = 0 then
   611     begin
   614     begin
   612     maxMovement := max(1, 13 - ((Gear^.Timer * 15) div 250));
   615     maxMovement := max(1, 13 - ((Gear^.Timer * 15) div 250));
   613     ShakeCamera(maxMovement);
   616     ShakeCamera(maxMovement);
   614     end;
   617     end;
   686                 if tmp < 0 then tmp := 0;
   689                 if tmp < 0 then tmp := 0;
   687                 Gear^.Tint:= (Gear^.Tint and $FFFFFF00) or Longword(tmp)
   690                 Gear^.Tint:= (Gear^.Tint and $FFFFFF00) or Longword(tmp)
   688                 end
   691                 end
   689             end
   692             end
   690 end;
   693 end;
       
   694 
       
   695 ////////////////////////////////////////////////////////////////////////////////
       
   696 procedure doStepSmoothWindBar(Gear: PVisualGear; Steps: Longword);
       
   697 begin
       
   698     inc(Gear^.Timer, Steps);
       
   699     
       
   700     while Gear^.Timer >= 10 do
       
   701         begin
       
   702         dec(Gear^.Timer, 10);
       
   703         if WindBarWidth < Gear^.Tag then inc(WindBarWidth)
       
   704         else if WindBarWidth > Gear^.Tag then dec(WindBarWidth);
       
   705         end;
       
   706         
       
   707 if WindBarWidth = Gear^.Tag then 
       
   708     DeleteVisualGear(Gear)
       
   709 end;
       
   710