summaryrefslogtreecommitdiffstats
path: root/src/graphics/engine/engine.cpp
diff options
context:
space:
mode:
authorkrzys-h <krzys_h@interia.pl>2014-01-11 17:51:13 +0100
committerkrzys-h <krzys_h@interia.pl>2014-10-29 16:08:55 +0100
commitd91569e165083a7c12b1c672713a9725d80c261c (patch)
treecdd8629522f413c724cb5e9cb7266378277e5315 /src/graphics/engine/engine.cpp
parent7af762329b7b9bc93a4333cbde90fb1efa69e3a0 (diff)
downloadcolobot-d91569e165083a7c12b1c672713a9725d80c261c.tar.gz
colobot-d91569e165083a7c12b1c672713a9725d80c261c.tar.bz2
colobot-d91569e165083a7c12b1c672713a9725d80c261c.zip
Showing coordinates in stats menu (F12/showstat); removed "showpos" cheat
Issue #277 Conflicts: src/object/cheat.cpp src/object/robotmain.cpp src/object/robotmain.h
Diffstat (limited to 'src/graphics/engine/engine.cpp')
-rw-r--r--src/graphics/engine/engine.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index ae6f238..03bff72 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -515,6 +515,11 @@ int CEngine::GetStatisticTriangle()
return m_statisticTriangle;
}
+void CEngine::SetStatisticPos(Math::Vector pos)
+{
+ m_statisticPos = pos;
+}
+
/*******************************************************
@@ -4335,7 +4340,7 @@ void CEngine::DrawStats()
float height = m_text->GetAscent(FONT_COLOBOT, 12.0f);
float width = 0.2f;
- Math::Point pos(0.04f, 0.04f + 17 * height);
+ Math::Point pos(0.04f, 0.04f + 20 * height);
SetState(ENG_RSTATE_OPAQUE_COLOR);
@@ -4343,9 +4348,9 @@ void CEngine::DrawStats()
VertexCol vertex[4] =
{
- VertexCol(Math::Vector(pos.x , pos.y - 17 * height, 0.0f), black),
+ VertexCol(Math::Vector(pos.x , pos.y - 20 * height, 0.0f), black),
VertexCol(Math::Vector(pos.x , pos.y + height, 0.0f), black),
- VertexCol(Math::Vector(pos.x + width, pos.y - 17 * height, 0.0f), black),
+ VertexCol(Math::Vector(pos.x + width, pos.y - 20 * height, 0.0f), black),
VertexCol(Math::Vector(pos.x + width, pos.y + height, 0.0f), black)
};
@@ -4458,6 +4463,20 @@ void CEngine::DrawStats()
pos.y -= height;
m_text->DrawText(m_fpsText, FONT_COLOBOT, 12.0f, pos, 1.0f, TEXT_ALIGN_LEFT, 0, Color(1.0f, 1.0f, 1.0f, 1.0f));
+
+
+ pos.y -= height;
+ pos.y -= height;
+
+ str.str("");
+ str << "Position x: " << std::fixed << std::setprecision(2) << m_statisticPos.x/g_unit;
+ 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));
+
+ pos.y -= height;
+
+ str.str("");
+ str << "Position y: " << std::fixed << std::setprecision(2) << m_statisticPos.z/g_unit;
+ 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));
}