[Scummvm-cvs-logs] SF.net SVN: scummvm:[54631] scummvm/trunk/engines/mohawk/graphics.cpp

bgk at users.sourceforge.net bgk at users.sourceforge.net
Mon Nov 29 21:59:30 CET 2010


Revision: 54631
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54631&view=rev
Author:   bgk
Date:     2010-11-29 20:59:30 +0000 (Mon, 29 Nov 2010)

Log Message:
-----------
MOHAWK: Complete drawing the animated rect if running the animation steps didn't draw the whole rect.

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/graphics.cpp

Modified: scummvm/trunk/engines/mohawk/graphics.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/graphics.cpp	2010-11-29 20:59:17 UTC (rev 54630)
+++ scummvm/trunk/engines/mohawk/graphics.cpp	2010-11-29 20:59:30 UTC (rev 54631)
@@ -318,6 +318,13 @@
 				_dirtyRects.push_back(area);
 				updateScreen();
 			}
+			if (area.right < rect.right) {
+				area.left = area.right;
+				area.right = rect.right;
+
+				_dirtyRects.push_back(area);
+				updateScreen();
+			}
 		}
 		break;
 	case 1:	{
@@ -334,6 +341,13 @@
 				_dirtyRects.push_back(area);
 				updateScreen();
 			}
+			if (area.left > rect.left) {
+				area.right = area.left;
+				area.left = rect.left;
+
+				_dirtyRects.push_back(area);
+				updateScreen();
+			}
 		}
 		break;
 	case 5:	{
@@ -350,6 +364,13 @@
 				_dirtyRects.push_back(area);
 				updateScreen();
 			}
+			if (area.top < rect.bottom) {
+				area.top = area.bottom;
+				area.bottom = rect.bottom;
+
+				_dirtyRects.push_back(area);
+				updateScreen();
+			}
 		}
 		break;
 	case 6:	{
@@ -366,6 +387,13 @@
 				_dirtyRects.push_back(area);
 				updateScreen();
 			}
+			if (area.bottom > rect.top) {
+				area.bottom = area.top;
+				area.top = rect.top;
+
+				_dirtyRects.push_back(area);
+				updateScreen();
+			}
 		}
 		break;
 	default:
@@ -383,16 +411,12 @@
 	if (rect.left < 0 || rect.top < 0 || rect.right > 544 || rect.bottom > 333 || !rect.isValidRect() || rect.width() == 0 || rect.height() == 0)
 		return;
 
-	Graphics::Surface *screen = _vm->_system->lockScreen();
-
 	if (state == kRectEnabled)
-		screen->frameRect(rect, _pixelFormat.RGBToColor(0, 255, 0));
+		_mainScreen->frameRect(rect, _pixelFormat.RGBToColor(0, 255, 0));
 	else if (state == kRectUnreachable)
-		screen->frameRect(rect, _pixelFormat.RGBToColor(0, 0, 255));
+		_mainScreen->frameRect(rect, _pixelFormat.RGBToColor(0, 0, 255));
 	else
-		screen->frameRect(rect, _pixelFormat.RGBToColor(255, 0, 0));
-
-	_vm->_system->unlockScreen();
+		_mainScreen->frameRect(rect, _pixelFormat.RGBToColor(255, 0, 0));
 }
 
 RivenGraphics::RivenGraphics(MohawkEngine_Riven* vm) : GraphicsManager(), _vm(vm) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list