aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2002-11-19 16:33:33 +0000
committerMax Horn2002-11-19 16:33:33 +0000
commit5627fb7c0b84ee0a8f7e068ef4543709ad842a66 (patch)
treea51fd5150a1d7c0baf9b386d4caffad385f75fb9
parent83fb208b9ed30b879e3f5bf83b7e6b9e3a018d24 (diff)
downloadscummvm-rg350-5627fb7c0b84ee0a8f7e068ef4543709ad842a66.tar.gz
scummvm-rg350-5627fb7c0b84ee0a8f7e068ef4543709ad842a66.tar.bz2
scummvm-rg350-5627fb7c0b84ee0a8f7e068ef4543709ad842a66.zip
cleanup
svn-id: r5622
-rw-r--r--scumm/gfx.cpp38
-rw-r--r--scumm/string.cpp3
2 files changed, 9 insertions, 32 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 6f83178c88..a8c99c28fd 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -280,7 +280,6 @@ void Scumm::setCursor(int cursor)
void Scumm::setCameraAt(int pos_x, int pos_y)
{
-
if (_features & GF_AFTER_V7) {
ScummPoint old;
@@ -390,31 +389,15 @@ void Scumm::initBGBuffers(int height)
// for GF_SMALL_HEADER already.
gdi._numZBuffer = 2;
} else if (_features & GF_SMALL_HEADER) {
-
-//#define DEBUG_ZPLANE_CODE
-
- ptr = findResourceData(MKID('SMAP'), room);
-#ifdef DEBUG_ZPLANE_CODE
- printf("Trying to determine room zplanes:\n");
- hexdump(ptr-6, 0x20);
-#endif
-
int off;
- gdi._numZBuffer = 0;
+ ptr = findResourceData(MKID('SMAP'), room);
off = READ_LE_UINT32(ptr);
+ gdi._numZBuffer = 0;
for (i = 0; off && (i < 4); i++) {
-#ifdef DEBUG_ZPLANE_CODE
- printf("Plane %d\n", i);
- hexdump(ptr, 0x20);
-#endif
-
gdi._numZBuffer++;
ptr += off;
off = READ_LE_UINT16(ptr);
}
-#ifdef DEBUG_ZPLANE_CODE
- printf("Real plane count = %d\n", gdi._numZBuffer);
-#endif
} else {
ptr = findResource(MKID('RMIH'), findResource(MKID('RMIM'), room));
gdi._numZBuffer = READ_LE_UINT16(ptr + 8) + 1;
@@ -1798,7 +1781,7 @@ void Scumm::restoreBG(int left, int top, int right, int bottom)
right += _lastXstart - vs->xstart;
}
- right++;
+ right++; // FIXME - why do we increment right here?!? (add comment)
if (left < 0)
left = 0;
if (right < 0)
@@ -1812,10 +1795,9 @@ void Scumm::restoreBG(int left, int top, int right, int bottom)
updateDirtyRect(vs->number, left, right, top - topline, bottom - topline, 0x40000000);
- height = (top - topline) * _realWidth + vs->xstart + left;
-
- backbuff = vs->screenPtr + height;
- bgbak = getResourceAddress(rtBuffer, vs->number + 5) + height;
+ int offset = (top - topline) * _realWidth + vs->xstart + left;
+ backbuff = vs->screenPtr + offset;
+ bgbak = getResourceAddress(rtBuffer, vs->number + 5) + offset;
height = bottom - top;
width = right - left;
@@ -1839,11 +1821,9 @@ void Scumm::restoreBG(int left, int top, int right, int bottom)
} while (--height);
}
} else {
- if (height) {
- do {
- memset(backbuff, _bkColor, width);
- backbuff += _realWidth;
- } while (--height);
+ while (height--) {
+ memset(backbuff, _bkColor, width);
+ backbuff += _realWidth;
}
}
}
diff --git a/scumm/string.cpp b/scumm/string.cpp
index 42faf6b6b5..a7c6aa85b9 100644
--- a/scumm/string.cpp
+++ b/scumm/string.cpp
@@ -308,8 +308,6 @@ void Scumm::CHARSET_1()
gdi._mask_bottom = 16;
}
restoreCharsetBg();
- charset._xpos2 = _string[0].xpos;
- charset._ypos2 = _string[0].ypos;
}
t = charset._right - _string[0].xpos - 1;
@@ -515,7 +513,6 @@ void Scumm::description()
charset._ypos2 = charset._top;
continue;
}
-
} while (1);
gdi._mask_left = charset._strLeft;