hedgewars/uWorld.pas
changeset 79 29b477319854
parent 75 d2b737858ff7
child 80 3c3dc6a148ca
equal deleted inserted replaced
78:66bb79dd248d 79:29b477319854
    39       WorldDy: integer = -256;
    39       WorldDy: integer = -256;
    40 
    40 
    41 procedure InitWorld;
    41 procedure InitWorld;
    42 procedure DrawWorld(Lag: integer; Surface: PSDL_Surface);
    42 procedure DrawWorld(Lag: integer; Surface: PSDL_Surface);
    43 procedure AddCaption(s: shortstring; Color, Group: LongWord);
    43 procedure AddCaption(s: shortstring; Color, Group: LongWord);
    44 procedure MoveWorld;
    44 procedure MoveCamera;
    45 
    45 
    46 {$IFDEF COUNTTICKS}
    46 {$IFDEF COUNTTICKS}
    47 var cntTicks: LongWord;
    47 var cntTicks: LongWord;
    48 {$ENDIF}
    48 {$ENDIF}
    49 var FollowGear: PGear = nil;
    49 var FollowGear: PGear = nil;
   158 for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx + (RealTicks shr 6) +  64) and $FF), cWaterLine + WorldDy - 32, 0, Surface);
   158 for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx + (RealTicks shr 6) +  64) and $FF), cWaterLine + WorldDy - 32, 0, Surface);
   159 for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx - (RealTicks shr 6) + 128) and $FF), cWaterLine + WorldDy - 16, 0, Surface);
   159 for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx - (RealTicks shr 6) + 128) and $FF), cWaterLine + WorldDy - 16, 0, Surface);
   160 for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx + (RealTicks shr 6)      ) and $FF), cWaterLine + WorldDy     , 0, Surface);
   160 for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx + (RealTicks shr 6)      ) and $FF), cWaterLine + WorldDy     , 0, Surface);
   161 {$WARNINGS ON}
   161 {$WARNINGS ON}
   162 
   162 
       
   163 // Turn time
   163 if TurnTimeLeft <> 0 then
   164 if TurnTimeLeft <> 0 then
   164    begin
   165    begin
   165    i:= Succ(Pred(TurnTimeLeft) div 1000);
   166    i:= Succ(Pred(TurnTimeLeft) div 1000);
   166    if i>99 then t:= 112
   167    if i>99 then t:= 112
   167       else if i>9 then t:= 96
   168       else if i>9 then t:= 96
   173          DrawSprite(sprBigDigit, t, cScreenHeight - 48, i mod 10, Surface);
   174          DrawSprite(sprBigDigit, t, cScreenHeight - 48, i mod 10, Surface);
   174          i:= i div 10
   175          i:= i div 10
   175          end;
   176          end;
   176    DrawSprite(sprFrame, t - 4, cScreenHeight - 48, 0, Surface);
   177    DrawSprite(sprFrame, t - 4, cScreenHeight - 48, 0, Surface);
   177    end;
   178    end;
       
   179 
       
   180 // Attack bar
   178 if CurrentTeam <> nil then
   181 if CurrentTeam <> nil then
   179    case AttackBar of
   182    case AttackBar of
   180         1: begin
   183         1: begin
   181            r:= StuffPoz[sPowerBar];
   184            r:= StuffPoz[sPowerBar];
   182            {$WARNINGS OFF}
   185            {$WARNINGS OFF}
   319 Captions[m].StorePos:= k;
   322 Captions[m].StorePos:= k;
   320 Captions[m].Group:= Group;
   323 Captions[m].Group:= Group;
   321 Captions[m].EndTime:= RealTicks + 1200
   324 Captions[m].EndTime:= RealTicks + 1200
   322 end;
   325 end;
   323 
   326 
   324 procedure MoveWorld;
   327 procedure MoveCamera;
   325 const PrevSentPointTime: LongWord = 0;
   328 const PrevSentPointTime: LongWord = 0;
   326 var s: string[9];
   329 var s: string[9];
   327 begin
   330 begin
   328 if not (CurrentTeam.ExtDriven and isCursorVisible) then SDL_GetMouseState(@CursorPoint.X, @CursorPoint.Y);
   331 if not (CurrentTeam.ExtDriven and isCursorVisible) then SDL_GetMouseState(@CursorPoint.X, @CursorPoint.Y);
   329 if (FollowGear <> nil) then
   332 if (FollowGear <> nil) then