summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-11-20 13:29:10 +0300
committerAndrei Karas <akaras@inbox.ru>2012-11-20 22:21:59 +0300
commit6637f4af57cd60008388bfefda1c37376c9d7042 (patch)
treeeb31d1c197c86583e5f2a525ca020de625f32919 /src/gui
parentcadc0f8b6d0bd71f319c3e6576af05dcd0a7533f (diff)
downloadplus-6637f4af57cd60008388bfefda1c37376c9d7042.tar.gz
plus-6637f4af57cd60008388bfefda1c37376c9d7042.tar.bz2
plus-6637f4af57cd60008388bfefda1c37376c9d7042.tar.xz
plus-6637f4af57cd60008388bfefda1c37376c9d7042.zip
Add debug option to show draw calls per frame.
Also fix map draw and text in debug window with mobile OpenGL.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/debugwindow.cpp21
-rw-r--r--src/gui/debugwindow.h3
2 files changed, 23 insertions, 1 deletions
diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp
index 11a8ca3c0..6e11f83c5 100644
--- a/src/gui/debugwindow.cpp
+++ b/src/gui/debugwindow.cpp
@@ -155,6 +155,10 @@ MapDebugTab::MapDebugTab(const Widget2 *const widget) :
mXYLabel(new Label(this, strprintf("%s (?,?)", _("Player Position:")))),
mTexturesLabel(nullptr),
mUpdateTime(0),
+#ifdef DEBUG_DRAW_CALLS
+ mDrawCallsLabel(new Label(this, strprintf("%s %s",
+ _("Draw calls:"), "?"))),
+#endif
mFPSLabel(new Label(this, strprintf(_("%d FPS"), 0))),
mLPSLabel(new Label(this, strprintf(_("%d LPS"), 0)))
{
@@ -174,6 +178,9 @@ MapDebugTab::MapDebugTab(const Widget2 *const widget) :
case 2:
mFPSText = _("%d FPS (old OpenGL)");
break;
+ case 3:
+ mFPSText = _("%d FPS (mobile OpenGL)");
+ break;
};
#else
mFPSText = _("%d FPS (Software)");
@@ -189,10 +196,15 @@ MapDebugTab::MapDebugTab(const Widget2 *const widget) :
place(0, 7, mParticleCountLabel, 2);
place(0, 8, mMapActorCountLabel, 2);
#ifdef USE_OPENGL
+ int n = 9;
#ifdef DEBUG_OPENGL_LEAKS
mTexturesLabel = new Label(this, strprintf("%s %s",
_("Textures count:"), "?"));
- place(0, 9, mTexturesLabel, 2);
+ place(0, n, mTexturesLabel, 2);
+ n ++;
+#endif
+#ifdef DEBUG_DRAW_CALLS
+ place(0, n, mDrawCallsLabel, 2);
#endif
#endif
place.getCell().matchColWidth(0, 0);
@@ -245,6 +257,13 @@ void MapDebugTab::logic()
mTexturesLabel->setCaption(strprintf("%s %d",
_("Textures count:"), textures_count));
#endif
+#ifdef DEBUG_DRAW_CALLS
+ if (mainGraphics)
+ {
+ mDrawCallsLabel->setCaption(strprintf("%s %d",
+ _("Draw calls:"), mainGraphics->getDrawCalls()));
+ }
+#endif
#endif
}
}
diff --git a/src/gui/debugwindow.h b/src/gui/debugwindow.h
index 5828269c3..62d7aa34f 100644
--- a/src/gui/debugwindow.h
+++ b/src/gui/debugwindow.h
@@ -72,6 +72,9 @@ class MapDebugTab final : public DebugTab
Label *mXYLabel;
Label *mTexturesLabel;
int mUpdateTime;
+#ifdef DEBUG_DRAW_CALLS
+ Label *mDrawCallsLabel;
+#endif
Label *mFPSLabel;
Label *mLPSLabel;
std::string mFPSText;