hedgewars/uWorld.pas
changeset 770 0138f1b5a804
parent 764 7513452b1d51
child 775 23c253aae336
equal deleted inserted replaced
769:788efc1d649f 770:0138f1b5a804
   168       inc(i, w)
   168       inc(i, w)
   169     until i > cScreenWidth
   169     until i > cScreenWidth
   170     end;
   170     end;
   171 
   171 
   172 begin
   172 begin
       
   173 // Sky
   173 glClear(GL_COLOR_BUFFER_BIT);
   174 glClear(GL_COLOR_BUFFER_BIT);
   174 glEnable(GL_BLEND);
   175 glEnable(GL_BLEND);
   175 
   176 
   176 if not isPaused then MoveCamera;
   177 if not isPaused then MoveCamera;
   177 
   178 
   178 // Sky
       
   179 if WorldDy > 0 then
       
   180    begin
       
   181    if WorldDy > cScreenHeight then r.h:= cScreenHeight
       
   182                               else r.h:= WorldDy;
       
   183    r.x:= 0;
       
   184    r.y:= 0;
       
   185    r.w:= cScreenWidth;
       
   186 //   SDL_FillRect(Surface, @r, cSkyColor)
       
   187    end;
       
   188 // background
   179 // background
   189 DrawRepeated(sprSky, WorldDx * 3 div 8);
   180 DrawRepeated(sprSky, WorldDx * 3 div 8);
   190 DrawRepeated(sprHorizont, WorldDx * 3 div 5);
   181 DrawRepeated(sprHorizont, WorldDx * 3 div 5);
   191 
   182 
   192 // Waves
   183 // Waves
   221    begin
   212    begin
   222    i:= Succ(Pred(TurnTimeLeft) div 1000);
   213    i:= Succ(Pred(TurnTimeLeft) div 1000);
   223    if i>99 then t:= 112
   214    if i>99 then t:= 112
   224       else if i>9 then t:= 96
   215       else if i>9 then t:= 96
   225                   else t:= 80;
   216                   else t:= 80;
   226 //   DrawSprite(sprFrame, t, cScreenHeight - 48, 1, Surface);
   217    DrawSprite(sprFrame, t, cScreenHeight - 48, 1, Surface);
   227    while i > 0 do
   218    while i > 0 do
   228          begin
   219          begin
   229          dec(t, 32);
   220          dec(t, 32);
   230          DrawSprite(sprBigDigit, t, cScreenHeight - 48, i mod 10, Surface);
   221          DrawSprite(sprBigDigit, t, cScreenHeight - 48, i mod 10, Surface);
   231          i:= i div 10
   222          i:= i div 10
   232          end;
   223          end;
   233 //   DrawSprite(sprFrame, t - 4, cScreenHeight - 48, 0, Surface);
   224    DrawSprite(sprFrame, t - 4, cScreenHeight - 48, 0, Surface);
   234    end;
   225    end;
   235 
   226 
   236 // Attack bar
   227 // Attack bar
   237 if CurrentTeam <> nil then
   228 if CurrentTeam <> nil then
   238    case AttackBar of
   229    case AttackBar of
   321    r.h:= 13;
   312    r.h:= 13;
   322    DrawSpriteFromRect(sprWindL, r, cScreenWidth - 106 + WindBarWidth, cScreenHeight - 28, 13, 0, Surface);
   313    DrawSpriteFromRect(sprWindL, r, cScreenWidth - 106 + WindBarWidth, cScreenHeight - 28, 13, 0, Surface);
   323    end;
   314    end;
   324 
   315 
   325 // AmmoMenu
   316 // AmmoMenu
   326 //if (AMxCurr < cScreenWidth) or bShowAmmoMenu then ShowAmmoMenu(Surface);
   317 if (AMxCurr < cScreenWidth) or bShowAmmoMenu then ShowAmmoMenu(Surface);
   327 
   318 
   328 // Cursor
   319 // Cursor
   329 if isCursorVisible then
   320 if isCursorVisible then
   330    begin
   321    begin
   331    if not bShowAmmoMenu then
   322    if not bShowAmmoMenu then
   340                                     i, Surface);
   331                                     i, Surface);
   341          end;
   332          end;
   342    DrawSprite(sprArrow, CursorPoint.X, CursorPoint.Y, (RealTicks shr 6) mod 8, Surface)
   333    DrawSprite(sprArrow, CursorPoint.X, CursorPoint.Y, (RealTicks shr 6) mod 8, Surface)
   343    end;
   334    end;
   344 
   335 
   345 {$IFDEF COUNTTICKS}
       
   346 //DXOutText(10, 10, fnt16, inttostr(cntTicks), Surface);
       
   347 {$ENDIF}
       
   348 
       
   349 if isPaused then DrawCentered(cScreenWidth div 2, cScreenHeight div 2, PauseTexture);
   336 if isPaused then DrawCentered(cScreenWidth div 2, cScreenHeight div 2, PauseTexture);
   350 
   337 
   351 inc(Frames);
   338 inc(Frames);
   352 if cShowFPS then
   339 if cShowFPS then
   353    begin
   340    begin