From 9be06ad9e82226bad6c70fc37dcc7db390ce3778 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Tue, 6 May 2008 21:56:16 +0000 Subject: Fixed text positioning in Woodruff, enabling "Use FOO on BAR" texts. svn-id: r31908 --- engines/gob/draw_v2.cpp | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'engines') diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp index 8f7d5b325b..baca917877 100644 --- a/engines/gob/draw_v2.cpp +++ b/engines/gob/draw_v2.cpp @@ -246,22 +246,25 @@ void Draw_v2::printTotText(int16 id) { } if (_renderFlags & RENDERFLAG_FROMSPLIT) { - destY = _vm->_video->_splitStart; + destY = _vm->_video->_splitHeight1; spriteBottom = READ_LE_UINT16(ptr + 6) - READ_LE_UINT16(ptr + 2); + if (_renderFlags & RENDERFLAG_DOUBLECOORDS) spriteBottom *= 3; - spriteBottom += _vm->_video->_splitStart; + + spriteBottom += _vm->_video->_splitHeight1; + if (_renderFlags & RENDERFLAG_DOUBLECOORDS) { - spriteBottom += _backDeltaX; - destY += _backDeltaX; + spriteBottom += _backDeltaY; + destY += _backDeltaY; } } else { + destY = READ_LE_UINT16(ptr + 2); + spriteBottom = READ_LE_UINT16(ptr + 6); + if (_renderFlags & RENDERFLAG_DOUBLECOORDS) { - destY = READ_LE_UINT16(ptr + 2) * 2; - spriteBottom = READ_LE_UINT16(ptr + 6) * 2; - } else { - destY = READ_LE_UINT16(ptr + 2); - spriteBottom = READ_LE_UINT16(ptr + 6); + destY *= 2; + spriteBottom *= 2; } } @@ -629,8 +632,7 @@ void Draw_v2::spriteOperation(int16 operation) { _destSpriteX += _backDeltaX; _destSpriteY += _backDeltaY; if ((operation == DRAW_DRAWLINE) || - ((operation >= DRAW_DRAWBAR) && - (operation <= DRAW_FILLRECTABS))) { + ((operation >= DRAW_DRAWBAR) && (operation <= DRAW_FILLRECTABS))) { _spriteRight += _backDeltaX; _spriteBottom += _backDeltaY; } @@ -646,6 +648,20 @@ void Draw_v2::spriteOperation(int16 operation) { int16 destSurface = _destSurface; int16 sourceSurface = _sourceSurface; + if ((_destSpriteY >= _vm->_video->_splitHeight1) && + ((_destSurface == 20) || (_destSurface == 21))) { + + _destSpriteY = (_destSpriteY - _vm->_video->_splitHeight1) + _vm->_video->_splitStart; + if ((operation == DRAW_DRAWLINE) || + ((operation >= DRAW_DRAWBAR) && (operation <= DRAW_FILLRECTABS))) + _spriteBottom = (_spriteBottom - _vm->_video->_splitHeight1) + _vm->_video->_splitStart; + + } + + if ((_spriteTop >= _vm->_video->_splitHeight1) && (operation == DRAW_BLITSURF) && + ((_destSurface == 20) || (_destSurface == 21))) + _spriteTop = (_spriteTop - _vm->_video->_splitHeight1) + _vm->_video->_splitStart; + adjustCoords(0, &_destSpriteX, &_destSpriteY); if ((operation != DRAW_LOADSPRITE) && (_needAdjust != 2)) { adjustCoords(0, &_spriteRight, &_spriteBottom); -- cgit v1.2.3