hedgewars/uWorld.pas
changeset 6 9c1f00e7b43e
parent 5 0dafbd19a04c
child 13 7a5db822fd3f
equal deleted inserted replaced
5:0dafbd19a04c 6:9c1f00e7b43e
    46 
    46 
    47 {$IFDEF COUNTTICKS}
    47 {$IFDEF COUNTTICKS}
    48 var cntTicks: LongWord;
    48 var cntTicks: LongWord;
    49 {$ENDIF}
    49 {$ENDIF}
    50 var FollowGear: PGear = nil;
    50 var FollowGear: PGear = nil;
       
    51     WindBarWidth: integer = 0;
    51 
    52 
    52 implementation
    53 implementation
    53 uses uStore, uMisc, uConsts, uTeams, uIO;
    54 uses uStore, uMisc, uConsts, uTeams, uIO;
    54 const RealTicks: Longword = 0;
    55 const RealTicks: Longword = 0;
    55       Frames: Longword = 0;
    56       Frames: Longword = 0;
   199 // Lag alert
   200 // Lag alert
   200 if isInLag then DrawSprite(sprLag, 32, 32  + cConsoleYAdd, (RealTicks shr 7) mod 7, Surface);
   201 if isInLag then DrawSprite(sprLag, 32, 32  + cConsoleYAdd, (RealTicks shr 7) mod 7, Surface);
   201 
   202 
   202 // Wind bar
   203 // Wind bar
   203 DrawGear(sWindBar, cScreenWidth - 180, cScreenHeight - 30, Surface);
   204 DrawGear(sWindBar, cScreenWidth - 180, cScreenHeight - 30, Surface);
   204 if cWindSpeed > 0 then
   205 if WindBarWidth > 0 then
   205    begin
   206    begin
   206    t:= round(72 * cWindSpeed / cMaxWindSpeed);
       
   207    with StuffPoz[sWindR] do
   207    with StuffPoz[sWindR] do
   208         begin
   208         begin
       
   209         {$WARNINGS OFF}
   209         r.x:= x + 8 - (RealTicks shr 6) mod 8;
   210         r.x:= x + 8 - (RealTicks shr 6) mod 8;
       
   211         {$WARNINGS ON}
   210         r.y:= y;
   212         r.y:= y;
   211         r.w:= t;
   213         r.w:= WindBarWidth;
   212         r.h:= 13;
   214         r.h:= 13;
   213         end;
   215         end;
   214    DrawSpriteFromRect(r, cScreenWidth - 103, cScreenHeight - 28, 13, 0, Surface);
   216    DrawSpriteFromRect(r, cScreenWidth - 103, cScreenHeight - 28, 13, 0, Surface);
   215    end else
   217    end else
   216    begin
   218  if WindBarWidth < 0 then
   217    t:= - round(72 * cWindSpeed / cMaxWindSpeed);
   219    begin
   218    with StuffPoz[sWindL] do
   220    with StuffPoz[sWindL] do
   219         begin
   221         begin
   220         r.x:= x + (RealTicks shr 6) mod 8;
   222         {$WARNINGS OFF}
       
   223         r.x:= x + (WindBarWidth + RealTicks shr 6) mod 8;
       
   224         {$WARNINGS ON}
   221         r.y:= y;
   225         r.y:= y;
   222         r.w:= t;
   226         r.w:= - WindBarWidth;
   223         r.h:= 13;
   227         r.h:= 13;
   224         end;
   228         end;
   225    DrawSpriteFromRect(r, cScreenWidth - 106 - t, cScreenHeight - 28, 13, 0, Surface);
   229    DrawSpriteFromRect(r, cScreenWidth - 106 + WindBarWidth, cScreenHeight - 28, 13, 0, Surface);
   226    end;
   230    end;
   227 
   231 
   228 // Cursor
   232 // Cursor
   229 if isCursorVisible then DrawSprite(sprArrow, CursorPoint.X, CursorPoint.Y, (RealTicks shr 6) mod 8, Surface);
   233 if isCursorVisible then DrawSprite(sprArrow, CursorPoint.X, CursorPoint.Y, (RealTicks shr 6) mod 8, Surface);
   230 
   234