diff --git a/src/debugfps.cpp b/src/debugfps.cpp index 6b6b8856..1550354b 100644 --- a/src/debugfps.cpp +++ b/src/debugfps.cpp @@ -26,6 +26,7 @@ class DebugFpsData friend class DebugFps; private: + int x, y; int fontid; }; @@ -33,11 +34,13 @@ private: * Public DebugFps class */ -DebugFps::DebugFps() +DebugFps::DebugFps(int x, int y) { data = new DebugFpsData(); data->fontid = Forge::Register("gfx/font/ascii.png"); + data->x = x; + data->y = y; drawgroup = DRAWGROUP_HUD; } @@ -49,30 +52,33 @@ void DebugFps::TickDraw(float deltams) char buf[1024]; Font *font = Forge::GetFont(data->fontid); + int x = data->x; + int y = data->y; + sprintf(buf, "%2.2f fps (%i)", 1e3f / Profiler::GetAvg(Profiler::STAT_TICK_FRAME), Ticker::GetFrameNum()); - font->PrintBold(10, 10, buf); + font->PrintBold(x, y, buf); sprintf(buf, "Game % 7.2f % 7.2f", Profiler::GetAvg(Profiler::STAT_TICK_GAME), Profiler::GetMax(Profiler::STAT_TICK_GAME)); - font->PrintBold(10, 34, buf); + font->PrintBold(x, y + 24, buf); sprintf(buf, "Draw % 7.2f % 7.2f", Profiler::GetAvg(Profiler::STAT_TICK_DRAW), Profiler::GetMax(Profiler::STAT_TICK_DRAW)); - font->PrintBold(10, 50, buf); + font->PrintBold(x, y + 40, buf); sprintf(buf, "Blit % 7.2f % 7.2f", Profiler::GetAvg(Profiler::STAT_TICK_BLIT), Profiler::GetMax(Profiler::STAT_TICK_BLIT)); - font->PrintBold(10, 66, buf); + font->PrintBold(x, y + 56, buf); sprintf(buf, "Frame % 7.2f % 7.2f", Profiler::GetAvg(Profiler::STAT_TICK_FRAME), Profiler::GetMax(Profiler::STAT_TICK_FRAME)); - font->PrintBold(10, 82, buf); + font->PrintBold(x, y + 72, buf); } DebugFps::~DebugFps() diff --git a/src/debugfps.h b/src/debugfps.h index 63cff7c9..67b17072 100644 --- a/src/debugfps.h +++ b/src/debugfps.h @@ -23,7 +23,7 @@ class DebugFpsData; class DebugFps : public Entity { public: - DebugFps(); + DebugFps(int x, int y); virtual ~DebugFps(); protected: diff --git a/win32/monsterz.vcxproj b/win32/monsterz.vcxproj index 72be1587..dbbac1a5 100644 --- a/win32/monsterz.vcxproj +++ b/win32/monsterz.vcxproj @@ -13,6 +13,7 @@ + @@ -41,6 +42,7 @@ + @@ -136,4 +138,4 @@ - + \ No newline at end of file