aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-09-09 20:54:19 +0000
committerMax Horn2003-09-09 20:54:19 +0000
commitdeb4f6b78679527735225808161cc223d13dfa78 (patch)
tree367a5b2b81bac2a3d09ab237806088ec585bf0a7
parentd875bb69fe436fe071e9ad5363a203e99e793ed0 (diff)
downloadscummvm-rg350-deb4f6b78679527735225808161cc223d13dfa78.tar.gz
scummvm-rg350-deb4f6b78679527735225808161cc223d13dfa78.tar.bz2
scummvm-rg350-deb4f6b78679527735225808161cc223d13dfa78.zip
cleanup; fix for bug #795942 (COMI: text display off screen) and #785760 (COMI: Lockup/crash on Skull Island)
svn-id: r10144
-rw-r--r--scumm/charset.cpp2
-rw-r--r--scumm/nut_renderer.cpp4
-rw-r--r--scumm/object.cpp2
-rw-r--r--scumm/script_v6.cpp2
-rw-r--r--scumm/script_v8.cpp2
-rw-r--r--scumm/scummvm.cpp2
-rw-r--r--scumm/string.cpp12
7 files changed, 13 insertions, 13 deletions
diff --git a/scumm/charset.cpp b/scumm/charset.cpp
index 4ee6a4398d..0a8318bc31 100644
--- a/scumm/charset.cpp
+++ b/scumm/charset.cpp
@@ -1288,7 +1288,7 @@ void CharsetRendererNut::printChar(int chr) {
shadow_bottom = _top + height + 2;
_hasMask = true;
- _current->drawShadowChar(chr, _left, _top, _color, !_ignoreCharsetMask);
+ _current->drawShadowChar(chr, _left, _top - _vm->_screenTop, _color, !_ignoreCharsetMask);
_vm->updateDirtyRect(0, shadow_left, shadow_right, shadow_top, shadow_bottom, 0);
_left += width;
diff --git a/scumm/nut_renderer.cpp b/scumm/nut_renderer.cpp
index f8470c7392..a193e6a0b7 100644
--- a/scumm/nut_renderer.cpp
+++ b/scumm/nut_renderer.cpp
@@ -238,9 +238,9 @@ void NutRenderer::drawShadowChar(int c, int x, int y, byte color, bool useMask)
y += offsetY[i];
color = cTable[i];
- dst = _vm->virtscr[0].screenPtr + y * _vm->_screenWidth + x + _vm->virtscr[0].xstart;
+ dst = _vm->virtscr[0].screenPtr + (y + _vm->_screenTop) * _vm->_screenWidth + x + _vm->virtscr[0].xstart;
if (useMask)
- mask = _vm->getMaskBuffer(x, y, 0);
+ mask = _vm->getMaskBuffer(x, y + _vm->_screenTop, 0);
if (c >= 256 && _vm->_CJKMode)
draw2byte(dst, mask, c, x, y, color);
diff --git a/scumm/object.cpp b/scumm/object.cpp
index fea4ae7c13..0b22bf155a 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -1407,7 +1407,7 @@ void Scumm::enqueueObject(int objectNumber, int objectX, int objectY, int object
eo = &_blastObjectQueue[_blastObjectQueuePos++];
eo->number = objectNumber;
eo->posX = objectX + (camera._cur.x & 7);
- eo->posY = objectY + (camera._cur.y - (_screenHeight / 2));
+ eo->posY = objectY + _screenTop;
if (objectWidth == 0) {
od = &_objs[idx];
eo->width = od->width;
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index 6206354725..a0cb3b2057 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -2510,7 +2510,7 @@ void Scumm_v6::o6_kernelSetFunctions() {
}
message = buf_output;
}
- enqueueText(message, args[3], args[4] + camera._cur.y - (_screenHeight / 2), args[2], args[1], true);
+ enqueueText(message, args[3], args[4], args[2], args[1], true);
break;}
case 20:
// Occurs in The Dig, at the alien pyramid. See bug #742979.
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp
index 2819d862b6..c333c50848 100644
--- a/scumm/script_v8.cpp
+++ b/scumm/script_v8.cpp
@@ -1426,7 +1426,7 @@ void Scumm_v8::o8_kernelGetFunctions() {
break;
case 0xD8: { // findBlastObject
int x = args[1] + (camera._cur.x & 7);
- int y = args[2] + (camera._cur.y - (_screenHeight /2));;
+ int y = args[2] + _screenTop;
BlastObject *eo;
for (int i = _blastObjectQueuePos - 1; i >= 0; i--) {
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 72fc298241..3acdf3ab40 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -1618,7 +1618,7 @@ void Scumm::processKbd() {
_virtualMouse.x = _mouse.x + virtscr[0].xstart;
_virtualMouse.y = _mouse.y - virtscr[0].topline;
if (_features & GF_NEW_CAMERA)
- _virtualMouse.y += camera._cur.y - (_screenHeight / 2);
+ _virtualMouse.y += _screenTop;
if (_virtualMouse.y < 0)
_virtualMouse.y = -1;
diff --git a/scumm/string.cpp b/scumm/string.cpp
index c7b49e6d9e..a7148b6644 100644
--- a/scumm/string.cpp
+++ b/scumm/string.cpp
@@ -122,8 +122,8 @@ void Scumm::CHARSET_1() {
s = a->scaley * a->talkPosY / 0xFF;
_string[0].ypos = ((a->talkPosY - s) >> 1) + s - a->elevation + a->y;
- if (_string[0].ypos < camera._cur.y - (_screenHeight / 2))
- _string[0].ypos = camera._cur.y - (_screenHeight / 2);
+ if (_string[0].ypos < _screenTop)
+ _string[0].ypos = _screenTop;
s = a->scalex * a->talkPosX / 0xFF;
_string[0].xpos = ((a->talkPosX - s) >> 1) + s + a->x - camera._cur.x + (_screenWidth / 2);
@@ -138,7 +138,7 @@ void Scumm::CHARSET_1() {
_string[0].xpos = _screenWidth - 80;
}
- _charset->_top = _string[0].ypos;
+ _charset->_top = _string[0].ypos + _screenTop;
_charset->_startLeft = _charset->_left = _string[0].xpos;
if (a && a->charset)
@@ -355,7 +355,7 @@ void Scumm::drawString(int a) {
_msgPtrToAdd = buf;
_messagePtr = addMessageToStack(_messagePtr);
- _charset->_top = _string[a].ypos;
+ _charset->_top = _string[a].ypos + _screenTop;
_charset->_startLeft = _charset->_left = _string[a].xpos;
_charset->_right = _string[a].right;
_charset->_center = _string[a].center;
@@ -699,7 +699,7 @@ void Scumm::drawBlastTexts() {
buf = _blastTextQueue[i].text;
- _charset->_top = _blastTextQueue[i].ypos;
+ _charset->_top = _blastTextQueue[i].ypos + _screenTop;
_charset->_startLeft = _charset->_left = _blastTextQueue[i].xpos;
_charset->_right = _screenWidth - 1;
_charset->_center = _blastTextQueue[i].center;
@@ -707,7 +707,7 @@ void Scumm::drawBlastTexts() {
_charset->_disableOffsX = _charset->_firstChar = true;
_charset->setCurID(_blastTextQueue[i].charset);
_charset->_nextLeft = _blastTextQueue[i].xpos;
- _charset->_nextTop = _blastTextQueue[i].ypos;
+ _charset->_nextTop = _charset->_top;
// Center text if necessary
if (_charset->_center) {