hedgewars/uWorld.pas
changeset 14964 bcecb3349948
parent 14914 9ab78e08a34c
child 14965 cf21a45a62bd
equal deleted inserted replaced
14963:2d5f1dc637da 14964:bcecb3349948
  1582 
  1582 
  1583 // Team bars
  1583 // Team bars
  1584 if (UIDisplay = uiAll) and (isNotHiddenByCinematic) then
  1584 if (UIDisplay = uiAll) and (isNotHiddenByCinematic) then
  1585     RenderTeamsHealth;
  1585     RenderTeamsHealth;
  1586 
  1586 
       
  1587 // Current hedgehog health in top left corner
       
  1588 if ((UIDisplay = uiAll) or (UIDisplay = uiNoTeams)) and (isNotHiddenByCinematic) and
       
  1589         ((GameFlags and gfInvulnerable) = 0) and
       
  1590         (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and
       
  1591         (CurrentHedgehog^.HealthTagTex <> nil) and
       
  1592         ((CurrentHedgehog^.Gear^.State and gstHHDriven) <> 0) then
       
  1593     begin
       
  1594     t:= 10;
       
  1595     i:= t;
       
  1596 {$IFDEF USE_TOUCH_INTERFACE}
       
  1597     i:= t + pauseButton.frame.y + pauseButton.frame.h;
       
  1598 {$ENDIF}
       
  1599     DrawTexture(cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - 16, i, CurrentHedgehog^.HealthTagTex);
       
  1600     DrawSprite(sprHealthHud, (cScreenWidth div 2 - CurrentHedgehog^.HealthTagTex^.w - 36), i, 0);
       
  1601     inc(t, CurrentHedgehog^.HealthTagTex^.h);
       
  1602     cDemoClockFPSOffsetY:= t;
       
  1603     end
       
  1604 else
       
  1605     cDemoClockFPSOffsetY:= 0;
       
  1606 
  1587 // Wind bar
  1607 // Wind bar
  1588 if (UIDisplay <> uiNone) and (isNotHiddenByCinematic) then
  1608 if (UIDisplay <> uiNone) and (isNotHiddenByCinematic) then
  1589     begin
  1609     begin
  1590 {$IFDEF USE_TOUCH_INTERFACE}
  1610 {$IFDEF USE_TOUCH_INTERFACE}
  1591     offsetX:= cScreenHeight - 13;
  1611     offsetX:= cScreenHeight - 13;
  1732 if isCursorVisible and bShowAmmoMenu then
  1752 if isCursorVisible and bShowAmmoMenu then
  1733     DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8);
  1753     DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8);
  1734 
  1754 
  1735 // FPS and demo replay time
  1755 // FPS and demo replay time
  1736 {$IFDEF USE_TOUCH_INTERFACE}
  1756 {$IFDEF USE_TOUCH_INTERFACE}
  1737 offsetX:= pauseButton.frame.y + pauseButton.frame.h + 12;
  1757 offsetY:= cDemoClockFPSOffsetY + 10 + pauseButton.frame.y + pauseButton.frame.h;
  1738 {$ELSE}
  1758 {$ELSE}
  1739 offsetX:= 10;
  1759 offsetY:= cDemoClockFPSOffsetY + 10;
  1740 {$ENDIF}
  1760 {$ENDIF}
  1741 offsetY:= cOffsetY;
  1761 offsetX:= cOffsetY;
  1742 if (RM = rmDefault) or (RM = rmRightEye) then
  1762 if (RM = rmDefault) or (RM = rmRightEye) then
  1743     begin
  1763     begin
  1744     inc(Frames);
  1764     inc(Frames);
  1745 
  1765 
  1746     if cShowFPS or (GameType = gmtDemo) then
  1766     if cShowFPS or (GameType = gmtDemo) then
  1767         FreeAndNilTexture(timeTexture);
  1787         FreeAndNilTexture(timeTexture);
  1768         timeTexture:= Surface2Tex(tmpSurface, false);
  1788         timeTexture:= Surface2Tex(tmpSurface, false);
  1769         SDL_FreeSurface(tmpSurface)
  1789         SDL_FreeSurface(tmpSurface)
  1770         end;
  1790         end;
  1771 
  1791 
  1772     if timeTexture <> nil then
  1792     if (timeTexture <> nil) and (UIDisplay <> uiNone) then
  1773         DrawTexture((cScreenWidth shr 1) - 20 - timeTexture^.w - offsetY, offsetX + timeTexture^.h+5, timeTexture);
  1793         DrawTexture((cScreenWidth shr 1) - 20 - timeTexture^.w - offsetX, offsetY, timeTexture);
  1774 
  1794 
  1775     // FPS counter
  1795     // FPS counter
  1776     if cShowFPS then
  1796     if cShowFPS and (UIDisplay <> uiNone) then
  1777         begin
  1797         begin
  1778         if CountTicks >= 1000 then
  1798         if CountTicks >= 1000 then
  1779             begin
  1799             begin
  1780             FPS:= Frames;
  1800             FPS:= Frames;
  1781             Frames:= 0;
  1801             Frames:= 0;
  1786             FreeAndNilTexture(fpsTexture);
  1806             FreeAndNilTexture(fpsTexture);
  1787             fpsTexture:= Surface2Tex(tmpSurface, false);
  1807             fpsTexture:= Surface2Tex(tmpSurface, false);
  1788             SDL_FreeSurface(tmpSurface)
  1808             SDL_FreeSurface(tmpSurface)
  1789             end;
  1809             end;
  1790         if fpsTexture <> nil then
  1810         if fpsTexture <> nil then
  1791             DrawTexture((cScreenWidth shr 1) - 20 - fpsTexture^.w - offsetY, offsetX, fpsTexture);
  1811             begin
       
  1812             if timeTexture <> nil then
       
  1813                 i:= fpsTexture^.h + 5
       
  1814             else
       
  1815                 i:= 0;
       
  1816             DrawTexture((cScreenWidth shr 1) - 60 - offsetX, offsetY + i, fpsTexture);
       
  1817             end;
  1792         end;
  1818         end;
  1793 end;
  1819 end;
  1794 
  1820 
  1795 // Quit Y/N question
  1821 // Quit Y/N question
  1796 if GameState = gsConfirm then
  1822 if GameState = gsConfirm then