hedgewars/uWorld.pas
changeset 547 b81a055f2d06
parent 526 e3689572bb15
child 564 17fb45c670c1
equal deleted inserted replaced
546:0e7cc3fb05cd 547:b81a055f2d06
   151 procedure MoveCamera; forward;
   151 procedure MoveCamera; forward;
   152 
   152 
   153 procedure DrawWorld(Lag: LongInt; Surface: PSDL_Surface);
   153 procedure DrawWorld(Lag: LongInt; Surface: PSDL_Surface);
   154 var i, t: LongInt;
   154 var i, t: LongInt;
   155     r: TSDL_Rect;
   155     r: TSDL_Rect;
   156     team: PTeam;
       
   157     tdx, tdy: Double;
   156     tdx, tdy: Double;
   158     grp: TCapGroup;
   157     grp: TCapGroup;
   159     s: string[15];
   158     s: string[15];
   160 
   159 
   161     procedure DrawRepeated(spr: TSprite; Shift: LongInt);
   160     procedure DrawRepeated(spr: TSprite; Shift: LongInt);
   271                EndTime:= 0
   270                EndTime:= 0
   272                end
   271                end
   273             end;
   272             end;
   274 
   273 
   275 // Teams Healths
   274 // Teams Healths
   276 team:= TeamsList;
   275 for t:= 0 to Pred(TeamsCount) do
   277 while team <> nil do
   276    with TeamsArray[t]^ do
   278       begin
   277       begin
   279       r.x:= cScreenWidth div 2 - team^.NameTag^.w - 3;
   278       r.x:= cScreenWidth div 2 - NameTag^.w - 3;
   280       r.y:= team^.DrawHealthY;
   279       r.y:= DrawHealthY;
   281       r.w:= team^.NameTag^.w;
   280       r.w:= NameTag^.w;
   282       r.h:= team^.NameTag^.h;
   281       r.h:= NameTag^.h;
   283       SDL_UpperBlit(team^.NameTag, nil, Surface, @r);
   282       SDL_UpperBlit(NameTag, nil, Surface, @r);
   284       r:= team^.HealthRect;
   283       r:= HealthRect;
   285       r.w:= 2 + team^.TeamHealthBarWidth;
   284       r.w:= 2 + TeamHealthBarWidth;
   286       DrawFromStoreRect(cScreenWidth div 2,
   285       DrawFromStoreRect(cScreenWidth div 2,
   287                         Team^.DrawHealthY,
   286                         DrawHealthY,
   288                         @r, Surface);
   287                         @r, Surface);
   289       inc(r.x, cTeamHealthWidth + 2);
   288       inc(r.x, cTeamHealthWidth + 2);
   290       r.w:= 3;
   289       r.w:= 3;
   291       DrawFromStoreRect(cScreenWidth div 2 + team^.TeamHealthBarWidth + 2,
   290       DrawFromStoreRect(cScreenWidth div 2 + TeamHealthBarWidth + 2,
   292                         Team^.DrawHealthY,
   291                         DrawHealthY,
   293                         @r, Surface);
   292                         @r, Surface);
   294       team:= team^.Next
       
   295       end;
   293       end;
   296 
   294 
   297 // Lag alert
   295 // Lag alert
   298 if isInLag then DrawSprite(sprLag, 32, 32  + cConsoleYAdd, (hwFloatTicks shr 7) mod 12, Surface);
   296 if isInLag then DrawSprite(sprLag, 32, 32  + cConsoleYAdd, (hwFloatTicks shr 7) mod 12, Surface);
   299 
   297