aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2013-08-04 02:29:13 +0200
committerJohannes Schickel2013-08-04 02:29:13 +0200
commit6485b291e9080acbd2e3d29a1bbaf7da9e79568d (patch)
tree0abf179fbf7ed1bbdc1e8ab613811ce5e5ae5ecd
parent8fc54d6d77d36c18c22272e2dc3d70414f195e0c (diff)
downloadscummvm-rg350-6485b291e9080acbd2e3d29a1bbaf7da9e79568d.tar.gz
scummvm-rg350-6485b291e9080acbd2e3d29a1bbaf7da9e79568d.tar.bz2
scummvm-rg350-6485b291e9080acbd2e3d29a1bbaf7da9e79568d.zip
SCUMM: Fix Loom (and some other graphics regressions).
These are regressions from c05cb7f3bbcf4d64d4a938e0eb42065d8f3d3038. 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.
-rw-r--r--engines/scumm/charset.cpp1
-rw-r--r--engines/scumm/debugger.cpp2
-rw-r--r--engines/scumm/gfx.cpp10
3 files changed, 7 insertions, 6 deletions
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 298fb149f4..dd79aff2da 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -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;
diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp
index 5e5719d6bc..872293f821 100644
--- a/engines/scumm/debugger.cpp
+++ b/engines/scumm/debugger.cpp
@@ -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;
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 57436dc03c..4c1fdaf673 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -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) {