aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-07-15 12:11:25 +0530
committerEugene Sandulenko2019-09-03 17:17:20 +0200
commit68b2e9adff5eb3dda5cb8bf788264b08a900e7cb (patch)
treef49e1068162c2f3490a95f46a8e5c83b725cce01
parent26210cfce662880ca5daeeab1f203e86cbbbae63 (diff)
downloadscummvm-rg350-68b2e9adff5eb3dda5cb8bf788264b08a900e7cb.tar.gz
scummvm-rg350-68b2e9adff5eb3dda5cb8bf788264b08a900e7cb.tar.bz2
scummvm-rg350-68b2e9adff5eb3dda5cb8bf788264b08a900e7cb.zip
HDB: Count FPS and print onto screen
-rw-r--r--engines/hdb/gfx.cpp5
-rw-r--r--engines/hdb/hdb.cpp7
-rw-r--r--engines/hdb/hdb.h3
3 files changed, 14 insertions, 1 deletions
diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp
index 56dc8fec7e..5719b8cea7 100644
--- a/engines/hdb/gfx.cpp
+++ b/engines/hdb/gfx.cpp
@@ -343,6 +343,11 @@ void Gfx::updateFade() {
g_system->copyRectToScreen(_globalSurface.getBasePtr(0, 0), _globalSurface.pitch, 0, 0, _globalSurface.w, _globalSurface.h);
g_system->updateScreen();
+ if (g_hdb->getDebug()) {
+ g_hdb->_frames.push_back(g_system->getMillis());
+ while (g_hdb->_frames[0] < g_system->getMillis() - 1000)
+ g_hdb->_frames.remove_at(0);
+ }
g_system->delayMillis(1000 / kGameFPS);
} while (_fadeInfo.active);
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index 27c4b33020..4bbff5b0ea 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -288,7 +288,7 @@ void HDBGame::paint() {
// Draw FPS on Screen in Debug Mode
if (_debugFlag == 1) {
- debug(9, "STUB: Requires StartTiming() and EndTiming()");
+ _gfx->drawDebugInfo(_debugLogo, _frames.size());
} else if (_debugFlag == 2) {
_debugLogo->drawMasked(kScreenWidth - 32, 0);
}
@@ -973,6 +973,11 @@ Common::Error HDBGame::run() {
paint();
g_system->updateScreen();
+ if (g_hdb->getDebug()) {
+ g_hdb->_frames.push_back(g_system->getMillis());
+ while (g_hdb->_frames[0] < g_system->getMillis() - 1000)
+ g_hdb->_frames.remove_at(0);
+ }
g_system->delayMillis(1000 / kGameFPS);
}
diff --git a/engines/hdb/hdb.h b/engines/hdb/hdb.h
index 6de28097d1..f1efd10bb4 100644
--- a/engines/hdb/hdb.h
+++ b/engines/hdb/hdb.h
@@ -298,6 +298,9 @@ public:
bool _progressActive;
int _progressCurrent, _progressXOffset, _progressMax;
+ // FPS Variables
+ Common::Array<uint32> _frames;
+
private:
uint32 _timePlayed;