From 9ac98d0fc90c332c66621554cbc024cd70f38026 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sun, 9 Jul 2017 10:00:55 +0200 Subject: MOHAWK: Myst: Always update the screen during the gameloop --- engines/mohawk/cursors.cpp | 4 ---- engines/mohawk/myst.cpp | 10 ++-------- engines/mohawk/myst.h | 1 - 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp index ebc556137a..cef24e14e5 100644 --- a/engines/mohawk/cursors.cpp +++ b/engines/mohawk/cursors.cpp @@ -93,12 +93,10 @@ MystCursorManager::~MystCursorManager() { void MystCursorManager::showCursor() { CursorMan.showMouse(true); - _vm->_needsUpdate = true; } void MystCursorManager::hideCursor() { CursorMan.showMouse(false); - _vm->_needsUpdate = true; } void MystCursorManager::setCursor(uint16 id) { @@ -139,8 +137,6 @@ void MystCursorManager::setCursor(uint16 id) { Graphics::PixelFormat pixelFormat = g_system->getScreenFormat(); CursorMan.replaceCursor(surface->getPixels(), surface->w, surface->h, hotspotX, hotspotY, pixelFormat.RGBToColor(255, 255, 255), false, &pixelFormat); } - - _vm->_needsUpdate = true; } void MystCursorManager::setDefaultCursor() { diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 3d45e389d0..3e1ca0eb53 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -70,7 +70,6 @@ MohawkEngine_Myst::MohawkEngine_Myst(OSystem *syst, const MohawkGameDescription _mainCursor = kDefaultMystCursor; _showResourceRects = false; _curCard = 0; - _needsUpdate = false; _canSafelySaveLoad = false; _curResource = -1; _hoverResource = nullptr; @@ -264,13 +263,12 @@ Common::Error MohawkEngine_Myst::run() { Common::Event event; while (!shouldQuit()) { // Update any background videos - _needsUpdate = _video->updateMovies(); + _video->updateMovies(); _scriptParser->runPersistentScripts(); while (pollEvent(event)) { switch (event.type) { case Common::EVENT_MOUSEMOVE: { - _needsUpdate = true; bool mouseClicked = _system->getEventManager()->getButtonState() & 1; // Keep the same resource when dragging @@ -349,10 +347,7 @@ Common::Error MohawkEngine_Myst::run() { } } - if (_needsUpdate) { - _system->updateScreen(); - _needsUpdate = false; - } + _system->updateScreen(); // Cut down on CPU usage _system->delayMillis(10); @@ -643,7 +638,6 @@ void MohawkEngine_Myst::changeToCard(uint16 card, TransitionType transition) { } else { _gfx->copyBackBufferToScreen(Common::Rect(544, 333)); _system->updateScreen(); - _needsUpdate = false; } } diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index 588880aaaf..d1b74d7912 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -193,7 +193,6 @@ public: MystSoundBlock readSoundBlock(Common::ReadStream *stream) const; void applySoundBlock(const MystSoundBlock &block); - bool _needsUpdate; bool _needsPageDrop; bool _needsShowMap; bool _needsShowDemoMenu; -- cgit v1.2.3