diff options
author | krzys-h <krzys_h@interia.pl> | 2014-10-29 17:53:46 +0100 |
---|---|---|
committer | krzys-h <krzys_h@interia.pl> | 2014-10-29 17:53:46 +0100 |
commit | 6d2fd18b419ddc202fa14cb14c98e8f3d5ecf646 (patch) | |
tree | 9075499f6dd08609a229a55a1aa15104ac5b1955 /src/graphics/engine | |
parent | 61e06149c65fbc61c6d927f527195a9b4a8154dc (diff) | |
download | colobot-6d2fd18b419ddc202fa14cb14c98e8f3d5ecf646.tar.gz colobot-6d2fd18b419ddc202fa14cb14c98e8f3d5ecf646.tar.bz2 colobot-6d2fd18b419ddc202fa14cb14c98e8f3d5ecf646.zip |
Implemented mission timer
Diffstat (limited to 'src/graphics/engine')
-rw-r--r-- | src/graphics/engine/engine.cpp | 14 | ||||
-rw-r--r-- | src/graphics/engine/engine.h | 7 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index 03bff72..3c642ae 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -520,6 +520,11 @@ void CEngine::SetStatisticPos(Math::Vector pos) m_statisticPos = pos; } +void CEngine::SetTimerDisplay(const std::string& text) +{ + m_timerText = text; +} + /******************************************************* @@ -3510,6 +3515,7 @@ void CEngine::DrawInterface() DrawMouse(); DrawHighlight(); DrawStats(); + DrawTimer(); } void CEngine::UpdateGroundSpotTextures() @@ -4479,6 +4485,14 @@ void CEngine::DrawStats() m_text->DrawText(str.str(), FONT_COLOBOT, 12.0f, pos, 1.0f, TEXT_ALIGN_LEFT, 0, Color(1.0f, 1.0f, 1.0f, 1.0f)); } +void CEngine::DrawTimer() +{ + SetState(ENG_RSTATE_TEXT); + + Math::Point pos(0.98f, 0.98f-m_text->GetAscent(FONT_COLOBOT, 15.0f)); + m_text->DrawText(m_timerText, FONT_COLOBOT, 15.0f, pos, 1.0f, TEXT_ALIGN_RIGHT, 0, Color(1.0f, 1.0f, 1.0f, 1.0f)); +} + } // namespace Gfx diff --git a/src/graphics/engine/engine.h b/src/graphics/engine/engine.h index c8e86d1..6ca7d1b 100644 --- a/src/graphics/engine/engine.h +++ b/src/graphics/engine/engine.h @@ -780,6 +780,9 @@ public: //! Sets the coordinates to display in stats window void SetStatisticPos(Math::Vector pos); + + //! Sets text to display as mission timer + void SetTimerDisplay(const std::string& text); /* *************** Object management *************** */ @@ -1236,6 +1239,8 @@ protected: void DrawMouseSprite(Math::Point pos, Math::Point dim, int icon); //! Draw statistic texts void DrawStats(); + //! Draw mission timer + void DrawTimer(); //! Creates a new tier 2 object (texture) EngineBaseObjTexTier& AddLevel2(EngineBaseObject& p1, const std::string& tex1Name, const std::string& tex2Name); @@ -1442,6 +1447,8 @@ protected: bool m_debugLights; bool m_debugDumpLights; + + std::string m_timerText; }; |