From 25bff46fe6672f79ec81ede2e87cabf1156e84cd Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 3 Oct 2013 22:00:21 +0200 Subject: WINTERMUTE: Update full screen on ScreenChanged This fixes the screen not updating after e.g., scaler changes. Bug #3594245. --- engines/wintermute/base/gfx/osystem/base_render_osystem.cpp | 11 +++++++++-- engines/wintermute/base/gfx/osystem/base_render_osystem.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp index b53aef802d..f6ace34ce4 100644 --- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp @@ -62,6 +62,8 @@ BaseRenderOSystem::BaseRenderOSystem(BaseGame *inGame) : BaseRenderer(inGame) { if (ConfMan.hasKey("dirty_rects")) { _disableDirtyRects = !ConfMan.getBool("dirty_rects"); } + + _lastScreenChangeID = g_system->getScreenChangeID(); } ////////////////////////////////////////////////////////////////////////// @@ -183,8 +185,13 @@ bool BaseRenderOSystem::flip() { } } } - if (_needsFlip || _disableDirtyRects) { - if (_disableDirtyRects) { + + int oldScreenChangeID = _lastScreenChangeID; + _lastScreenChangeID = g_system->getScreenChangeID(); + bool screenChanged = _lastScreenChangeID != oldScreenChangeID; + + if (_needsFlip || _disableDirtyRects || screenChanged) { + if (_disableDirtyRects || screenChanged) { g_system->copyRectToScreen((byte *)_renderSurface->getPixels(), _renderSurface->pitch, 0, 0, _renderSurface->w, _renderSurface->h); } // g_system->copyRectToScreen((byte *)_renderSurface->getPixels(), _renderSurface->pitch, _dirtyRect->left, _dirtyRect->top, _dirtyRect->width(), _dirtyRect->height()); diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.h b/engines/wintermute/base/gfx/osystem/base_render_osystem.h index fa0b2afc40..8996c8b2e8 100644 --- a/engines/wintermute/base/gfx/osystem/base_render_osystem.h +++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.h @@ -146,6 +146,7 @@ private: uint32 _clearColor; bool _skipThisFrame; + int _lastScreenChangeID; // previous value of OSystem::getScreenChangeID() }; } // End of namespace Wintermute -- cgit v1.2.3