hedgewars/uWorld.pas
changeset 292 0ca921ca7557
parent 284 22ce72bd637f
child 295 8834f3cb620e
equal deleted inserted replaced
291:afa378f1e961 292:0ca921ca7557
   205    SDL_FillRect(Surface, @r, cWaterColor)
   205    SDL_FillRect(Surface, @r, cWaterColor)
   206    end;
   206    end;
   207 
   207 
   208 DrawGears(Surface);
   208 DrawGears(Surface);
   209 
   209 
   210 if CurrentTeam <> nil then
       
   211    begin
       
   212    team:= TeamsList;
       
   213    while team<>nil do
       
   214       begin
       
   215       for i:= 0 to 7 do
       
   216           with team.Hedgehogs[i] do
       
   217                if Gear<>nil then
       
   218                   if Gear.State = 0 then
       
   219                      begin
       
   220                      t:= round(Gear.Y) - cHHRadius - 10 + WorldDy;
       
   221                      dec(t, HealthTag.h + 2);
       
   222                      DrawCentered(round(Gear.X) + WorldDx, t, HealthTag, Surface);
       
   223                      dec(t, NameTag.h + 2);
       
   224                      DrawCentered(round(Gear.X) + WorldDx, t, NameTag, Surface);
       
   225                      dec(t, Team.NameTag.h + 2);
       
   226                      DrawCentered(round(Gear.X) + WorldDx, t, Team.NameTag, Surface)
       
   227                      end else // Current hedgehog
       
   228                      begin
       
   229                      if bShowFinger
       
   230                         and ((Gear.State and gstHHDriven) <> 0) then DrawSprite(sprFinger, round(Gear.X) - 16 + WorldDx, round(Gear.Y) - 64 + WorldDy, RealTicks div 32 mod 16, Surface);
       
   231                      if (Gear.State and (gstMoving or gstDrowning or gstFalling)) = 0 then
       
   232                         if (Gear.State and gstHHThinking) <> 0 then
       
   233                            DrawGear(sQuestion, Round(Gear.X) - 10 + WorldDx, Round(Gear.Y) - cHHRadius - 34 + WorldDy, Surface)
       
   234                         else
       
   235                         if ShowCrosshair and ((Gear.State and gstAttacked) = 0) then
       
   236                            DrawSurfSprite(Round(Gear.X + hwSign(Gear.dX) * Sin(Gear.Angle*pi/cMaxAngle)*60) + WorldDx - 11,
       
   237                                           Round(Gear.Y - Cos(Gear.Angle*pi/cMaxAngle)*60) + WorldDy - 12,
       
   238                                           24, (18 + hwSign(Gear.dX) * integer(((Gear.Angle * 72 div cMaxAngle) + 1) div 2) mod 18) mod 18,
       
   239                                           Team.CrosshairSurf, Surface);
       
   240                      end;
       
   241       team:= team.Next
       
   242       end;
       
   243    end;
       
   244 
       
   245 
       
   246 // Waves
   210 // Waves
   247 {$WARNINGS OFF}
   211 {$WARNINGS OFF}
   248 for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx + (RealTicks shr 6) +  64) and $FF), cWaterLine + WorldDy - 32, 0, Surface);
   212 for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx + (RealTicks shr 6) +  64) and $FF), cWaterLine + WorldDy - 32, 0, Surface);
   249 for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx - (RealTicks shr 6) + 128) and $FF), cWaterLine + WorldDy - 16, 0, Surface);
   213 for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx - (RealTicks shr 6) + 128) and $FF), cWaterLine + WorldDy - 16, 0, Surface);
   250 for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx + (RealTicks shr 6)      ) and $FF), cWaterLine + WorldDy     , 0, Surface);
   214 for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * 256  + ((WorldDx + (RealTicks shr 6)      ) and $FF), cWaterLine + WorldDy     , 0, Surface);