MOHAWK: Myst: Always update the screen during the gameloop

This commit is contained in:
Bastien Bouclet 2017-07-09 10:00:55 +02:00
parent a1be6d4209
commit 9ac98d0fc9
3 changed files with 2 additions and 13 deletions

View File

@ -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() {

View File

@ -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;
}
}

View File

@ -193,7 +193,6 @@ public:
MystSoundBlock readSoundBlock(Common::ReadStream *stream) const;
void applySoundBlock(const MystSoundBlock &block);
bool _needsUpdate;
bool _needsPageDrop;
bool _needsShowMap;
bool _needsShowDemoMenu;