aboutsummaryrefslogtreecommitdiff
path: root/scumm/gfx.cpp
diff options
context:
space:
mode:
authorMax Horn2004-01-08 03:24:41 +0000
committerMax Horn2004-01-08 03:24:41 +0000
commit6222d6e643ed1a2c73ae9037bcd6b677c917f420 (patch)
tree5104eace4510c5c633fe69ae84fe95a1f05b333f /scumm/gfx.cpp
parentab2192761d77b1acfc7da2038d65c151ab048a70 (diff)
downloadscummvm-rg350-6222d6e643ed1a2c73ae9037bcd6b677c917f420.tar.gz
scummvm-rg350-6222d6e643ed1a2c73ae9037bcd6b677c917f420.tar.bz2
scummvm-rg350-6222d6e643ed1a2c73ae9037bcd6b677c917f420.zip
more cleanup
svn-id: r12234
Diffstat (limited to 'scumm/gfx.cpp')
-rw-r--r--scumm/gfx.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 38555aa8ee..5044ad9f0e 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -570,25 +570,19 @@ void ScummEngine::restoreBG(Common::Rect rect, byte backColor) {
if ((vs = findVirtScreen(rect.top)) == NULL)
return;
+ if (rect.left > vs->width)
+ return;
+
topline = vs->topline;
rect.top -= topline;
rect.bottom -= topline;
- if (rect.left < 0)
- rect.left = 0;
- if (rect.right < 0)
- rect.right = 0;
- if (rect.left > vs->width)
- return;
- if (rect.right > vs->width)
- rect.right = vs->width;
- if (rect.bottom >= vs->height)
- rect.bottom = vs->height;
+ rect.clip(vs->width, vs->height);
- markRectAsDirty(vs->number, rect.left, rect.right, rect.top, rect.bottom, USAGE_BIT_RESTORED);
+ markRectAsDirty(vs->number, rect, USAGE_BIT_RESTORED);
- int offset = (rect.top) * vs->width + vs->xstart + rect.left;
+ int offset = rect.top * vs->width + vs->xstart + rect.left;
backbuff = vs->screenPtr + offset;
height = rect.height();
@@ -716,7 +710,7 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
else if (y2 > vs->height)
y2 = vs->height;
- markRectAsDirty(vs->number, x, x2, y, y2, 0);
+ markRectAsDirty(vs->number, x, x2, y, y2);
backbuff = vs->screenPtr + vs->xstart + y * vs->width + x;