aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2004-09-27 23:53:03 +0000
committerMax Horn2004-09-27 23:53:03 +0000
commit1610325c4ca72aa2ab593629a68e29005463e35e (patch)
treece55a63eaf6ba6c9a3217239b2619dd8dd6c93ad
parent92c17aecd43405c6a82f69691f730bd7d900f67a (diff)
downloadscummvm-rg350-1610325c4ca72aa2ab593629a68e29005463e35e.tar.gz
scummvm-rg350-1610325c4ca72aa2ab593629a68e29005463e35e.tar.bz2
scummvm-rg350-1610325c4ca72aa2ab593629a68e29005463e35e.zip
Hm, there seems to be no point in subtractig 1 from height/width of these rects (in fact it might cut off too much in a few corner cases, now?); so i am changing it to match the way rects are used in the rest of the SCUMM engine
svn-id: r15316
-rw-r--r--scumm/gfx.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index ca22dc143e..57c36b7bd6 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -1456,20 +1456,20 @@ void Gdi::drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y,
}
static bool calcClipRects(int dst_w, int dst_h, int src_x, int src_y, int src_w, int src_h, const Common::Rect *rect, Common::Rect &srcRect, Common::Rect &dstRect) {
- srcRect = Common::Rect(0, 0, src_w - 1, src_h - 1);
- dstRect = Common::Rect(src_x, src_y, src_x + src_w - 1, src_y + src_h - 1);
+ srcRect = Common::Rect(0, 0, src_w, src_h);
+ dstRect = Common::Rect(src_x, src_y, src_x + src_w, src_y + src_h);
Common::Rect r3;
if (rect) {
r3 = *rect;
- Common::Rect r4(0, 0, dst_w - 1, dst_h - 1);
+ Common::Rect r4(0, 0, dst_w, dst_h);
if (r3.intersects(r4)) {
r3.clip(r4);
} else {
return false;
}
} else {
- r3 = Common::Rect(0, 0, dst_w - 1, dst_h - 1);
+ r3 = Common::Rect(0, 0, dst_w, dst_h);
}
dstRect.clip(r3);
srcRect = dstRect;
@@ -1502,17 +1502,17 @@ void Gdi::decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRe
while (h--) {
dataPtr += READ_LE_UINT16(dataPtr) + 2;
}
- h = srcRect.bottom - srcRect.top + 1;
+ h = srcRect.bottom - srcRect.top;
if (h <= 0)
return;
- w = srcRect.right - srcRect.left + 1;
+ w = srcRect.right - srcRect.left;
if (w <= 0)
return;
while (h--) {
xoff = srcRect.left;
off = READ_LE_UINT16(dataPtr);
- w = srcRect.right - srcRect.left + 1;
+ w = srcRect.right - srcRect.left;
dstPtrNext = dstPitch + dstPtr;
dataPtrNext = off + 2 + dataPtr;
dataPtr += 2;
@@ -1614,17 +1614,17 @@ void Gdi::decompressAuxImage(uint8 *dst1, uint8 *dst2, int dstPitch, const Commo
while (h--) {
dataPtr += READ_LE_UINT16(dataPtr) + 2;
}
- h = srcRect.bottom - srcRect.top + 1;
+ h = srcRect.bottom - srcRect.top;
if (h <= 0)
return;
- w = srcRect.right - srcRect.left + 1;
+ w = srcRect.right - srcRect.left;
if (w <= 0)
return;
while (h--) {
xoff = srcRect.left;
off = READ_LE_UINT16(dataPtr);
- w = srcRect.right - srcRect.left + 1;
+ w = srcRect.right - srcRect.left;
dst1PtrNext = dstPitch + dst1Ptr;
dst2PtrNext = dstPitch + dst2Ptr;
dataPtrNext = off + 2 + dataPtr;