SCUMM: Fix Loom (and some other graphics regressions).
These are regressions from c05cb7f3bb
. They were
caused by VirtualScreen::getPixels differing from Surface::getBasePtr and I
accidently used the former in some cases in the conversion.
I also fixed a bug in debugger.cpp which exchanged x and y.
This commit is contained in:
parent
8fc54d6d77
commit
6485b291e9
3 changed files with 7 additions and 6 deletions
|
@ -1242,6 +1242,7 @@ void CharsetRendererNut::printChar(int chr, bool ignoreCharsetMask) {
|
|||
if (ignoreCharsetMask) {
|
||||
VirtScreen *vs = &_vm->_virtscr[kMainVirtScreen];
|
||||
s = *vs;
|
||||
s.setPixels(vs->getPixels(0, 0));
|
||||
} else {
|
||||
s = _vm->_textSurface;
|
||||
drawTop -= _vm->_screenTop;
|
||||
|
|
|
@ -641,7 +641,7 @@ static void hlineColor(ScummEngine *scumm, int x1, int x2, int y, byte color) {
|
|||
x2 = right - 1;
|
||||
|
||||
|
||||
ptr = (byte *)vs->getBasePtr(y, x1);
|
||||
ptr = (byte *)vs->getBasePtr(x1, y);
|
||||
|
||||
while (x1++ <= x2) {
|
||||
*ptr++ = color;
|
||||
|
|
|
@ -422,7 +422,7 @@ void ScummEngine::initVirtScreen(VirtScreenNumber slot, int top, int width, int
|
|||
|
||||
_res->createResource(rtBuffer, slot + 1, size);
|
||||
vs->setPixels(getResourceAddress(rtBuffer, slot + 1));
|
||||
memset(vs->getPixels(0, 0), 0, size); // reset background
|
||||
memset(vs->getBasePtr(0, 0), 0, size); // reset background
|
||||
|
||||
if (twobufs) {
|
||||
vs->backBuf = _res->createResource(rtBuffer, slot + 5, size);
|
||||
|
@ -1590,7 +1590,7 @@ void GdiV2::prepareDrawBitmap(const byte *ptr, VirtScreen *vs,
|
|||
if (vs->hasTwoBuffers)
|
||||
dst = vs->backBuf + y * vs->pitch + x * 8;
|
||||
else
|
||||
dst = (byte *)vs->getPixels(x * 8, y);
|
||||
dst = (byte *)vs->getBasePtr(x * 8, y);
|
||||
|
||||
mask_ptr = getMaskBuffer(x, y, 1);
|
||||
|
||||
|
@ -1827,7 +1827,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
|
|||
if (vs->hasTwoBuffers)
|
||||
dstPtr = vs->backBuf + y * vs->pitch + (x * 8 * vs->format.bytesPerPixel);
|
||||
else
|
||||
dstPtr = (byte *)vs->getPixels(x * 8, y);
|
||||
dstPtr = (byte *)vs->getBasePtr(x * 8, y);
|
||||
|
||||
transpStrip = drawStrip(dstPtr, vs, x, y, width, height, stripnr, smap_ptr);
|
||||
|
||||
|
@ -1836,7 +1836,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
|
|||
transpStrip = true;
|
||||
|
||||
if (vs->hasTwoBuffers) {
|
||||
byte *frontBuf = (byte *)vs->getPixels(x * 8, y);
|
||||
byte *frontBuf = (byte *)vs->getBasePtr(x * 8, y);
|
||||
if (lightsOn)
|
||||
copy8Col(frontBuf, vs->pitch, dstPtr, height, vs->format.bytesPerPixel);
|
||||
else
|
||||
|
@ -2262,7 +2262,7 @@ void Gdi::resetBackground(int top, int bottom, int strip) {
|
|||
vs->bdirty[strip] = bottom;
|
||||
|
||||
bgbak_ptr = (byte *)vs->backBuf + top * vs->pitch + (strip + vs->xstart/8) * 8 * vs->format.bytesPerPixel;
|
||||
backbuff_ptr = (byte *)vs->getPixels((strip + vs->xstart/8) * 8, top);
|
||||
backbuff_ptr = (byte *)vs->getBasePtr((strip + vs->xstart/8) * 8, top);
|
||||
|
||||
numLinesToProcess = bottom - top;
|
||||
if (numLinesToProcess) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue