Some fixes for vertical scrolling in Woodruff

svn-id: r32095
This commit is contained in:
Sven Hesse 2008-05-13 23:22:31 +00:00
parent 231ef79de2
commit cfd1fa6973
2 changed files with 30 additions and 17 deletions

View File

@ -245,13 +245,20 @@ void Draw_v2::printTotText(int16 id) {
} }
if (_renderFlags & RENDERFLAG_FROMSPLIT) { if (_renderFlags & RENDERFLAG_FROMSPLIT) {
destY = _vm->_video->_splitHeight1; int16 start;
if (_vm->_video->_splitHeight1 < _vm->_height)
start = _vm->_video->_splitHeight1;
else
start = _vm->_video->_splitStart;
destY = start;
spriteBottom = READ_LE_UINT16(ptr + 6) - READ_LE_UINT16(ptr + 2); spriteBottom = READ_LE_UINT16(ptr + 6) - READ_LE_UINT16(ptr + 2);
if (_renderFlags & RENDERFLAG_DOUBLECOORDS) if (_renderFlags & RENDERFLAG_DOUBLECOORDS)
spriteBottom *= 3; spriteBottom *= 3;
spriteBottom += _vm->_video->_splitHeight1; spriteBottom += start;
if (_renderFlags & RENDERFLAG_DOUBLECOORDS) { if (_renderFlags & RENDERFLAG_DOUBLECOORDS) {
spriteBottom += _backDeltaY; spriteBottom += _backDeltaY;
@ -650,16 +657,19 @@ void Draw_v2::spriteOperation(int16 operation) {
if ((_destSpriteY >= _vm->_video->_splitHeight1) && if ((_destSpriteY >= _vm->_video->_splitHeight1) &&
((_destSurface == 20) || (_destSurface == 21))) { ((_destSurface == 20) || (_destSurface == 21))) {
_destSpriteY = (_destSpriteY - _vm->_video->_splitHeight1) + _vm->_video->_splitStart; if (_vm->_video->_splitHeight1 < _vm->_height) {
if ((operation == DRAW_DRAWLINE) || _destSpriteY = (_destSpriteY - _vm->_video->_splitHeight1) + _vm->_video->_splitStart;
((operation >= DRAW_DRAWBAR) && (operation <= DRAW_FILLRECTABS))) if ((operation == DRAW_DRAWLINE) ||
_spriteBottom = (_spriteBottom - _vm->_video->_splitHeight1) + _vm->_video->_splitStart; ((operation >= DRAW_DRAWBAR) && (operation <= DRAW_FILLRECTABS)))
_spriteBottom = (_spriteBottom - _vm->_video->_splitHeight1) + _vm->_video->_splitStart;
}
} }
if ((_spriteTop >= _vm->_video->_splitHeight1) && (operation == DRAW_BLITSURF) && if ((_spriteTop >= _vm->_video->_splitHeight1) && (operation == DRAW_BLITSURF) &&
((_destSurface == 20) || (_destSurface == 21))) ((_destSurface == 20) || (_destSurface == 21)))
_spriteTop = (_spriteTop - _vm->_video->_splitHeight1) + _vm->_video->_splitStart; if (_vm->_video->_splitHeight1 < _vm->_height)
_spriteTop = (_spriteTop - _vm->_video->_splitHeight1) + _vm->_video->_splitStart;
adjustCoords(0, &_destSpriteX, &_destSpriteY); adjustCoords(0, &_destSpriteX, &_destSpriteY);
if ((operation != DRAW_LOADSPRITE) && (_needAdjust != 2)) { if ((operation != DRAW_LOADSPRITE) && (_needAdjust != 2)) {

View File

@ -1444,19 +1444,22 @@ void Inter_v2::o2_initScreen() {
int16 screenHeight = _vm->_video->_surfHeight; int16 screenHeight = _vm->_video->_surfHeight;
_vm->_video->_surfHeight += offY; if (screenHeight < _vm->_height) {
_vm->_video->_surfHeight += offY;
_vm->_video->_splitStart = screenHeight;
} else
_vm->_video->_splitStart = screenHeight - offY;
_vm->_video->_splitHeight1 = MIN<int16>(_vm->_height, screenHeight - offY); _vm->_video->_splitHeight1 = MIN<int16>(_vm->_height, screenHeight - offY);
_vm->_video->_splitHeight2 = offY; _vm->_video->_splitHeight2 = offY;
_vm->_video->_splitStart = screenHeight;
if ((_vm->_video->_surfHeight + offY) < _vm->_height) if ((_vm->_video->_surfHeight + offY) < _vm->_height)
_vm->_video->_screenDeltaY = (_vm->_height - (screenHeight + offY)) / 2; _vm->_video->_screenDeltaY = (_vm->_height - (screenHeight + offY)) / 2;
else else
_vm->_video->_screenDeltaY = 0; _vm->_video->_screenDeltaY = 0;
_vm->_global->_mouseMaxY = (screenHeight + _vm->_video->_screenDeltaY) - offY - 1; _vm->_global->_mouseMaxY = (screenHeight + _vm->_video->_screenDeltaY) - offY - 1;
_vm->_global->_mouseMinY = _vm->_video->_screenDeltaY; _vm->_global->_mouseMinY = _vm->_video->_screenDeltaY;
} else { } else {
_vm->_video->_splitHeight1 = MIN<int16>(_vm->_height, _vm->_video->_surfHeight - offY); _vm->_video->_splitHeight1 = MIN<int16>(_vm->_height, _vm->_video->_surfHeight - offY);