aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;