aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/surface.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-07-19 21:11:51 -0400
committerPaul Gilbert2015-07-19 21:11:51 -0400
commit81125fd5d741fc0e032040634e64224d761fc37d (patch)
tree6843e560b103599e1b09a613fbec1559b699040e /engines/sherlock/surface.cpp
parent097b52b66180712fd9e285dd62013bc9533b2be9 (diff)
downloadscummvm-rg350-81125fd5d741fc0e032040634e64224d761fc37d.tar.gz
scummvm-rg350-81125fd5d741fc0e032040634e64224d761fc37d.tar.bz2
scummvm-rg350-81125fd5d741fc0e032040634e64224d761fc37d.zip
SHERLOCK: RT: Add dirty rect call to transBlitFrom
Diffstat (limited to 'engines/sherlock/surface.cpp')
-rw-r--r--engines/sherlock/surface.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/engines/sherlock/surface.cpp b/engines/sherlock/surface.cpp
index 729b4e8c44..42194de7a3 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,