[Scummvm-cvs-logs] scummvm master -> 81125fd5d741fc0e032040634e64224d761fc37d

dreammaster dreammaster at scummvm.org
Mon Jul 20 03:12:56 CEST 2015


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:
81125fd5d7 SHERLOCK: RT: Add dirty rect call to transBlitFrom


Commit: 81125fd5d741fc0e032040634e64224d761fc37d
    https://github.com/scummvm/scummvm/commit/81125fd5d741fc0e032040634e64224d761fc37d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-19T21:11:51-04:00

Commit Message:
SHERLOCK: RT: Add dirty rect call to transBlitFrom

Changed paths:
    engines/sherlock/surface.cpp



diff --git a/engines/sherlock/surface.cpp b/engines/sherlock/surface.cpp
index 729b4e8..42194de 100644
--- a/engines/sherlock/surface.cpp
+++ b/engines/sherlock/surface.cpp
@@ -112,7 +112,7 @@ void Surface::transBlitFrom(const Surface &src, const Common::Point &pt,
 
 void Surface::transBlitFrom(const Graphics::Surface &src, const Common::Point &pt,
 		bool flipped, int overrideColor, int scaleVal) {
-	if (scaleVal == 256) {
+	if (scaleVal == SCALE_THRESHOLD) {
 		transBlitFromUnscaled(src, pt, flipped, overrideColor);
 		return;
 	}
@@ -120,8 +120,11 @@ void Surface::transBlitFrom(const Graphics::Surface &src, const Common::Point &p
 	int scaleX = SCALE_THRESHOLD * SCALE_THRESHOLD / scaleVal;
 	int scaleY = scaleX;
 	int scaleXCtr = 0, scaleYCtr = 0;
+	int destX, destY;
+	int xCtr, yCtr;
+	int maxX = pt.x;
 
-	for (int yCtr = 0, destY = pt.y; yCtr < src.h && destY < this->h(); ++yCtr) {
+	for (yCtr = 0, destY = pt.y; yCtr < src.h && destY < this->h(); ++yCtr) {
 		// Handle skipping lines if Y scaling
 		scaleYCtr += scaleY;
 		
@@ -134,7 +137,7 @@ void Surface::transBlitFrom(const Graphics::Surface &src, const Common::Point &p
 				byte *pDest = (byte *)getBasePtr(pt.x, destY);
 				scaleXCtr = 0;
 
-				for (int xCtr = 0, destX = pt.x; xCtr < src.w && destX < this->w(); ++xCtr) {
+				for (xCtr = 0, destX = pt.x; xCtr < src.w && destX < this->w(); ++xCtr) {
 					// Handle horizontal scaling
 					scaleXCtr += scaleX;
 
@@ -149,6 +152,7 @@ void Surface::transBlitFrom(const Graphics::Surface &src, const Common::Point &p
 						++destX;
 					}
 
+					maxX = MAX(maxX, destX);
 					pSrc = pSrc + (flipped ? -1 : 1);
 				}
 			}
@@ -156,6 +160,9 @@ void Surface::transBlitFrom(const Graphics::Surface &src, const Common::Point &p
 			++destY;
 		}
 	}
+
+	// Mark the affected area
+	addDirtyRect(Common::Rect(pt.x, pt.y, maxX, destY));
 }
 
 void Surface::transBlitFromUnscaled(const Graphics::Surface &src, const Common::Point &pt,






More information about the Scummvm-git-logs mailing list