diff options
author | Filippos Karapetis | 2008-12-04 19:12:58 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-12-04 19:12:58 +0000 |
commit | 12f4c3b9b9da43ec6ccd708b549107226bd747ad (patch) | |
tree | b1808a5a811bca9315996d32a75a81139a170fe9 /engines | |
parent | b085afc451baa559439f1548cd691c0f25bb216f (diff) | |
download | scummvm-rg350-12f4c3b9b9da43ec6ccd708b549107226bd747ad.tar.gz scummvm-rg350-12f4c3b9b9da43ec6ccd708b549107226bd747ad.tar.bz2 scummvm-rg350-12f4c3b9b9da43ec6ccd708b549107226bd747ad.zip |
Removed more test code and performed some cleanup
svn-id: r35241
Diffstat (limited to 'engines')
-rw-r--r-- | engines/saga/render.cpp | 29 | ||||
-rw-r--r-- | engines/saga/render.h | 6 |
2 files changed, 23 insertions, 12 deletions
diff --git a/engines/saga/render.cpp b/engines/saga/render.cpp index 17ad13b11b..937969514c 100644 --- a/engines/saga/render.cpp +++ b/engines/saga/render.cpp @@ -50,8 +50,10 @@ Render::Render(SagaEngine *vm, OSystem *system) { _system = system; _initialized = false; +#ifdef SAGA_DEBUG // Initialize FPS timer callback _vm->_timer->installTimerProc(&fpsTimerCallback, 1000000, this); +#endif _backGroundSurface.create(_vm->getDisplayWidth(), _vm->getDisplayHeight(), 1); @@ -61,7 +63,10 @@ Render::Render(SagaEngine *vm, OSystem *system) { } Render::~Render(void) { +#ifdef SAGA_DEBUG _vm->_timer->removeTimerProc(&fpsTimerCallback); +#endif + _backGroundSurface.free(); _initialized = false; @@ -75,17 +80,19 @@ void Render::drawScene() { Surface *backBufferSurface; Point mousePoint; Point textPoint; - + int curMode = _vm->_interface->getMode(); assert(_initialized); +#ifdef SAGA_DEBUG _renderedFrameCount++; +#endif backBufferSurface = _vm->_gfx->getBackBuffer(); // Get mouse coordinates mousePoint = _vm->mousePos(); - if (!(_flags & (RF_DEMO_SUBST | RF_MAP) || _vm->_interface->getMode() == kPanelPlacard)) { + if (!(_flags & (RF_DEMO_SUBST | RF_MAP) || curMode == kPanelPlacard)) { if (_vm->_interface->getFadeMode() != kFadeOut) { // Display scene background if (!(_flags & RF_DISABLE_ACTORS) || _vm->getGameType() == GType_ITE) @@ -121,24 +128,24 @@ void Render::drawScene() { if (_flags & RF_MAP) _vm->_interface->mapPanelDrawCrossHair(); - if ((_vm->_interface->getMode() == kPanelOption) || - (_vm->_interface->getMode() == kPanelQuit) || - (_vm->_interface->getMode() == kPanelLoad) || - (_vm->_interface->getMode() == kPanelSave)) { + if ((curMode == kPanelOption) || + (curMode == kPanelQuit) || + (curMode == kPanelLoad) || + (curMode == kPanelSave)) { _vm->_interface->drawOption(); - if (_vm->_interface->getMode() == kPanelQuit) { + if (curMode == kPanelQuit) { _vm->_interface->drawQuit(); } - if (_vm->_interface->getMode() == kPanelLoad) { + if (curMode == kPanelLoad) { _vm->_interface->drawLoad(); } - if (_vm->_interface->getMode() == kPanelSave) { + if (curMode == kPanelSave) { _vm->_interface->drawSave(); } } - if (_vm->_interface->getMode() == kPanelProtect) { + if (curMode == kPanelProtect) { _vm->_interface->drawProtect(); } @@ -198,6 +205,7 @@ void Render::drawScene() { _system->updateScreen(); } +#ifdef SAGA_DEBUG void Render::fpsTimerCallback(void *refCon) { ((Render *)refCon)->fpsTimer(); } @@ -206,5 +214,6 @@ void Render::fpsTimer(void) { _fps = _renderedFrameCount; _renderedFrameCount = 0; } +#endif } // End of namespace Saga diff --git a/engines/saga/render.h b/engines/saga/render.h index caf68d4c51..bd7d147132 100644 --- a/engines/saga/render.h +++ b/engines/saga/render.h @@ -77,8 +77,12 @@ public: } private: +#ifdef SAGA_DEBUG static void fpsTimerCallback(void *refCon); void fpsTimer(void); + unsigned int _fps; + unsigned int _renderedFrameCount; +#endif SagaEngine *_vm; OSystem *_system; @@ -87,8 +91,6 @@ private: // Module data Surface _backGroundSurface; - unsigned int _fps; - unsigned int _renderedFrameCount; uint32 _flags; }; |