diff options
author | Paul Gilbert | 2017-07-08 16:27:05 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-07-08 16:27:05 -0400 |
commit | 558a409c00a0cced6a16241ac89f826cf3ead96c (patch) | |
tree | ff6ad418cddffdd988fadf71152c0a048bc97ff8 /engines/titanic/support | |
parent | 1fb36247701df47329972934a1a0820649481fcb (diff) | |
download | scummvm-rg350-558a409c00a0cced6a16241ac89f826cf3ead96c.tar.gz scummvm-rg350-558a409c00a0cced6a16241ac89f826cf3ead96c.tar.bz2 scummvm-rg350-558a409c00a0cced6a16241ac89f826cf3ead96c.zip |
TITANIC: Fix disappearing vision center on bar shelf
Diffstat (limited to 'engines/titanic/support')
-rw-r--r-- | engines/titanic/support/screen_manager.cpp | 16 | ||||
-rw-r--r-- | engines/titanic/support/screen_manager.h | 1 |
2 files changed, 15 insertions, 2 deletions
diff --git a/engines/titanic/support/screen_manager.cpp b/engines/titanic/support/screen_manager.cpp index cc9054e688..4e0f0406a0 100644 --- a/engines/titanic/support/screen_manager.cpp +++ b/engines/titanic/support/screen_manager.cpp @@ -65,6 +65,8 @@ CScreenManager *CScreenManager::setCurrent() { void CScreenManager::setSurfaceBounds(SurfaceNum surfaceNum, const Rect &r) { if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size()) _backSurfaces[surfaceNum]._bounds = r; + else if (surfaceNum == SURFACE_PRIMARY) + _frontSurfaceBounds = r; } int CScreenManager::setFontNumber(int fontNumber) { @@ -169,6 +171,13 @@ void OSScreenManager::fillRect(SurfaceNum surfaceNum, Rect *rect, byte r, byte g tempRect = surfaceRect; } + // Constrain the fill area to the set modification area of the surface + Rect surfaceBounds = (surfaceNum == SURFACE_PRIMARY) ? _frontSurfaceBounds : + _backSurfaces[surfaceNum]._bounds; + if (!surfaceBounds.isEmpty()) + tempRect.constrain(surfaceBounds); + + // If there is any area defined, clear it if (tempRect.isValidRect()) surface->fillRect(&tempRect, r, g, b); } @@ -189,12 +198,15 @@ void OSScreenManager::blitFrom(SurfaceNum surfaceNum, CVideoSurface *src, Rect *bounds = &srcBounds; Rect rect2; - if (surfaceNum >= 0 && !_backSurfaces[surfaceNum]._bounds.isEmpty()) { + Rect surfaceBounds = (surfaceNum == SURFACE_PRIMARY) ? _frontSurfaceBounds : + _backSurfaces[surfaceNum]._bounds; + + if (!surfaceBounds.isEmpty()) { // Perform clipping to the bounds of the back surface rect2 = srcBounds; rect2.translate(-srcBounds.left, -srcBounds.top); rect2.translate(destPoint.x, destPoint.y); - rect2.constrain(_backSurfaces[surfaceNum]._bounds); + rect2.constrain(surfaceBounds); rect2.translate(-destPoint.x, -destPoint.y); rect2.translate(srcBounds.left, srcBounds.top); diff --git a/engines/titanic/support/screen_manager.h b/engines/titanic/support/screen_manager.h index 7140001bd4..0b99c0e65c 100644 --- a/engines/titanic/support/screen_manager.h +++ b/engines/titanic/support/screen_manager.h @@ -64,6 +64,7 @@ public: static CScreenManager *setCurrent(); public: Common::Array<VideoSurfaceEntry> _backSurfaces; + Rect _frontSurfaceBounds; CVideoSurface *_frontRenderSurface; CMouseCursor *_mouseCursor; CTextCursor *_textCursor; |