[Scummvm-git-logs] scummvm master -> 558a409c00a0cced6a16241ac89f826cf3ead96c

dreammaster dreammaster at scummvm.org
Sat Jul 8 22:27:13 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
558a409c00 TITANIC: Fix disappearing vision center on bar shelf


Commit: 558a409c00a0cced6a16241ac89f826cf3ead96c
    https://github.com/scummvm/scummvm/commit/558a409c00a0cced6a16241ac89f826cf3ead96c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-07-08T16:27:05-04:00

Commit Message:
TITANIC: Fix disappearing vision center on bar shelf

Changed paths:
    engines/titanic/game_manager.cpp
    engines/titanic/support/screen_manager.cpp
    engines/titanic/support/screen_manager.h


diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index b276405..d3d9ced 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -195,7 +195,7 @@ void CGameManager::update() {
 			_bounds.combine(textCursor->getCursorBounds());
 
 		// Set the screen's modified area bounds
-		screenManager->setSurfaceBounds(SURFACE_BACKBUFFER, _bounds);
+		screenManager->setSurfaceBounds(SURFACE_PRIMARY, _bounds);
 
 		// Handle redrawing the view if there is any changed area
 		if (!_bounds.isEmpty()) {
diff --git a/engines/titanic/support/screen_manager.cpp b/engines/titanic/support/screen_manager.cpp
index cc9054e..4e0f040 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 7140001..0b99c0e 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;





More information about the Scummvm-git-logs mailing list