aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2004-09-24 20:37:24 +0000
committerMax Horn2004-09-24 20:37:24 +0000
commitfbfa606e4f44c2b3df8fae8cf8a8ba127f883cac (patch)
tree8e6532ee1c34894ac4ad1b2a906ee1c5736f6e2b
parent924e66b0cc3f31fe54a5b26980b0b9e851620364 (diff)
downloadscummvm-rg350-fbfa606e4f44c2b3df8fae8cf8a8ba127f883cac.tar.gz
scummvm-rg350-fbfa606e4f44c2b3df8fae8cf8a8ba127f883cac.tar.bz2
scummvm-rg350-fbfa606e4f44c2b3df8fae8cf8a8ba127f883cac.zip
More V7_SMOOTH_SCROLLING_HACK related fixes
svn-id: r15250
-rw-r--r--scumm/akos.cpp5
-rw-r--r--scumm/base-costume.h2
-rw-r--r--scumm/bomp.cpp12
-rw-r--r--scumm/gfx.cpp4
-rw-r--r--scumm/object.cpp17
5 files changed, 19 insertions, 21 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp
index c9bcd0ff12..66396f1a86 100644
--- a/scumm/akos.cpp
+++ b/scumm/akos.cpp
@@ -973,9 +973,8 @@ byte AkosRenderer::codec5(int xmoveCur, int ymoveCur) {
bdd.srcwidth = _width;
bdd.srcheight = _height;
- bdd.out = _outptr;
- bdd.outwidth = _outwidth;
- bdd.outheight = _outheight;
+ bdd.dst = _vm->virtscr[kMainVirtScreen];
+ bdd.dst.pixels = _outptr;
bdd.dataptr = _srcptr;
bdd.scale_x = 255;
bdd.scale_y = 255;
diff --git a/scumm/base-costume.h b/scumm/base-costume.h
index 03ca48f90e..5a08b356f4 100644
--- a/scumm/base-costume.h
+++ b/scumm/base-costume.h
@@ -111,7 +111,7 @@ public:
_draw_top = _draw_bottom = 0;
_vm = scumm;
- _numStrips = _vm->gdi._numStrips;
+ _numStrips = -1;
_srcptr = 0;
_xmove = _ymove = 0;
_mirror = false;
diff --git a/scumm/bomp.cpp b/scumm/bomp.cpp
index 17ead8a804..b453d9025e 100644
--- a/scumm/bomp.cpp
+++ b/scumm/bomp.cpp
@@ -219,17 +219,17 @@ void ScummEngine::drawBomp(const BompDrawData &bd, bool mirror) {
}
clip.right = bd.srcwidth;
- if (clip.right > bd.outwidth - bd.x) {
- clip.right = bd.outwidth - bd.x;
+ if (clip.right > bd.dst.w - bd.x) {
+ clip.right = bd.dst.w - bd.x;
}
clip.bottom = bd.srcheight;
- if (clip.bottom > bd.outheight - bd.y) {
- clip.bottom = bd.outheight - bd.y;
+ if (clip.bottom > bd.dst.h - bd.y) {
+ clip.bottom = bd.dst.h - bd.y;
}
src = bd.dataptr;
- dst = bd.out + bd.y * bd.outwidth + bd.x + clip.left;
+ dst = (byte *)bd.dst.pixels + bd.y * bd.dst.pitch + (bd.x + clip.left);
const byte maskbit = revBitMask[(bd.x + clip.left) & 7];
@@ -319,7 +319,7 @@ void ScummEngine::drawBomp(const BompDrawData &bd, bool mirror) {
// Advance to the next line
pos_y++;
mask += gdi._numStrips;
- dst += bd.outwidth;
+ dst += bd.dst.pitch;
}
}
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index f7663d63bd..edb77bfaf2 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -1223,9 +1223,9 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int wi
if (bottom > vs->bdirty[sx])
vs->bdirty[sx] = bottom;
- backbuff_ptr = (byte *)vs->pixels + (y * _numStrips + x) * 8;
+ backbuff_ptr = (byte *)vs->pixels + y * vs->pitch + x * 8;
if (vs->hasTwoBuffers)
- bgbak_ptr = vs->backBuf + (y * _numStrips + x) * 8;
+ bgbak_ptr = vs->backBuf + y * vs->pitch + x * 8;
else
bgbak_ptr = backbuff_ptr;
diff --git a/scumm/object.cpp b/scumm/object.cpp
index 57802bd735..e18e245082 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -1192,7 +1192,7 @@ void ScummEngine::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id,
searchptr = roomptr;
assert(searchptr);
ResourceIterator obcds(searchptr, (_features & GF_SMALL_HEADER) != 0);
- for (i = 0;;) {
+ for (i = 0; i < numobj; i++) {
obcdptr = obcds.findNext(MKID('OBCD'));
if (obcdptr == NULL)
error("findObjectInRoom: Not enough code blocks in room %d", room);
@@ -1212,15 +1212,15 @@ void ScummEngine::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id,
fo->cdhd = cdhd;
break;
}
- if (++i == numobj)
- error("findObjectInRoom: Object %d not found in room %d", id, room);
}
+ if (i == numobj)
+ error("findObjectInRoom: Object %d not found in room %d", id, room);
}
roomptr = fo->roomptr;
if (findWhat & foImageHeader) {
ResourceIterator obims(roomptr, (_features & GF_SMALL_HEADER) != 0);
- for (i = 0;;) {
+ for (i = 0; i < numobj; i++) {
obimptr = obims.findNext(MKID('OBIM'));
if (obimptr == NULL)
error("findObjectInRoom: Not enough image blocks in room %d", room);
@@ -1241,9 +1241,9 @@ void ScummEngine::findObjectInRoom(FindObjectInRoom *fo, byte findWhat, uint id,
fo->imhd = imhd;
break;
}
- if (++i == numobj)
- error("findObjectInRoom: Object %d image not found in room %d", id, room);
}
+ if (i == numobj)
+ error("findObjectInRoom: Object %d image not found in room %d", id, room);
}
}
@@ -1495,9 +1495,8 @@ void ScummEngine::drawBlastObject(BlastObject *eo) {
bdd.srcheight = READ_LE_UINT16(&((const BompHeader *)bomp)->old.height);
}
- bdd.out = vs->getPixels(0, 0);
- bdd.outwidth = vs->w;
- bdd.outheight = vs->h;
+ bdd.dst = *vs;
+ bdd.dst.pixels = vs->getPixels(0, 0);
// Skip the bomp header
if (_version == 8) {
bdd.dataptr = bomp + 8;