Fix AKOS clipping issues at the left/right border of the screen (smooth scrolling regression)

svn-id: r15926
This commit is contained in:
Max Horn 2004-11-28 02:05:04 +00:00
parent 232ef35298
commit cc11a1249a
3 changed files with 11 additions and 8 deletions

View File

@ -518,8 +518,8 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) {
height = _height;
scaleytab = &v1.scaletable[v1.scaleYindex];
maskbit = revBitMask[(v1.x + _vm->virtscr[0].xstart) & 7];
mask = _vm->getMaskBuffer(v1.x, v1.y, _zbuf);
maskbit = revBitMask[v1.x & 7];
mask = _vm->getMaskBuffer(v1.x - (_vm->virtscr[0].xstart & 7), v1.y, _zbuf);
if (len)
goto StartPos;
@ -573,14 +573,14 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) {
v1.x += v1.scaleXstep;
if (v1.x < 0 || v1.x >= _out.w)
return;
maskbit = revBitMask[(v1.x + _vm->virtscr[0].xstart) & 7];
maskbit = revBitMask[v1.x & 7];
v1.destptr += v1.scaleXstep;
skip_column = false;
} else
skip_column = true;
v1.scaleXindex += v1.scaleXstep;
dst = v1.destptr;
mask = _vm->getMaskBuffer(v1.x, v1.y, _zbuf);
mask = _vm->getMaskBuffer(v1.x - (_vm->virtscr[0].xstart & 7), v1.y, _zbuf);
}
StartPos:;
} while (--len);
@ -978,8 +978,7 @@ byte AkosRenderer::codec5(int xmoveCur, int ymoveCur) {
bdd.srcwidth = _width;
bdd.srcheight = _height;
bdd.dst = _vm->virtscr[kMainVirtScreen];
bdd.dst.pixels = _out.pixels;
bdd.dst = _out;
bdd.dataptr = _srcptr;
bdd.scale_x = 255;
bdd.scale_y = 255;

View File

@ -34,6 +34,10 @@ byte BaseCostumeRenderer::drawCostume(const VirtScreen &vs, int numStrips, const
_out.pixels = vs.getBackPixels(0, 0);
else
_out.pixels = vs.getPixels(0, 0);
_actorX += _vm->virtscr[0].xstart & 7;
_out.w = _out.pitch;
_out.pixels = (byte *)_out.pixels - (_vm->virtscr[0].xstart & 7);
_numStrips = numStrips;

View File

@ -235,11 +235,11 @@ void ScummEngine::drawBomp(const BompDrawData &bd, bool mirror) {
src = bd.dataptr;
dst = (byte *)bd.dst.pixels + bd.y * bd.dst.pitch + (bd.x + clip.left);
const byte maskbit = revBitMask[(bd.x + clip.left + virtscr[0].xstart) & 7];
const byte maskbit = revBitMask[(bd.x + clip.left) & 7];
// Mask against any additionally imposed mask
if (bd.maskPtr) {
mask = bd.maskPtr + (bd.y * gdi._numStrips) + ((bd.x + clip.left + (virtscr[0].xstart&7)) / 8);
mask = bd.maskPtr + (bd.y * gdi._numStrips) + ((bd.x + clip.left) / 8);
}
// Setup vertical scaling