hedgewars/VGSHandlers.inc
changeset 5357 ec36f3d53f3c
parent 5236 ab044774e29d
child 5366 bfdd925e89a5
equal deleted inserted replaced
5354:e121d0d6823b 5357:ec36f3d53f3c
   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