Correct o2_initScreen() for Woodruff (screen positioning, clipping and cursor limiting)

svn-id: r31846
This commit is contained in:
Sven Hesse 2008-05-03 20:08:46 +00:00
parent 7e3ce73a58
commit edff41b1c3
9 changed files with 117 additions and 44 deletions

View file

@ -1388,17 +1388,21 @@ void Inter_v2::o2_initScreen() {
width = _vm->_parse->parseValExpr();
height = _vm->_parse->parseValExpr();
_vm->_video->clearScreen();
// Lost in Time switches to 640x400x16 when showing the title screen
if (_vm->getGameType() == kGameTypeLostInTime) {
if (videoMode == 0x10) {
width = _vm->_width = 640;
height = _vm->_height = 400;
_vm->_global->_colorCount = 16;
_vm->_system->beginGFXTransaction();
_vm->_system->initSize(_vm->_width, _vm->_height);
_vm->initCommonGFX(true);
_vm->_system->endGFXTransaction();
_vm->_video->setSize(true);
} else if (_vm->_global->_videoMode == 0x10) {
if (width == -1)
width = 320;
if (height == -1)
@ -1407,10 +1411,9 @@ void Inter_v2::o2_initScreen() {
_vm->_width = 320;
_vm->_height = 200;
_vm->_global->_colorCount = 256;
_vm->_system->beginGFXTransaction();
_vm->_system->initSize(_vm->_width, _vm->_height);
_vm->initCommonGFX(false);
_vm->_system->endGFXTransaction();
_vm->_video->setSize(false);
}
}
@ -1428,10 +1431,46 @@ void Inter_v2::o2_initScreen() {
if (height > 0)
_vm->_video->_surfHeight = height;
_vm->_video->_splitHeight1 =
MIN<int16>(_vm->_height, _vm->_video->_surfHeight - offY);
_vm->_video->_splitHeight2 = offY;
_vm->_video->_splitStart = _vm->_video->_surfHeight - offY;
if (videoMode == 0x18) {
if (_vm->_video->_surfWidth < _vm->_width)
_vm->_video->_screenDeltaX = (_vm->_width - _vm->_video->_surfWidth) / 2;
else
_vm->_video->_screenDeltaX = 0;
_vm->_global->_mouseMinX = _vm->_video->_screenDeltaX;
_vm->_global->_mouseMaxX = _vm->_video->_screenDeltaX + _vm->_video->_surfWidth - 1;
int16 screenHeight = _vm->_video->_surfHeight;
_vm->_video->_surfHeight += offY;
_vm->_video->_splitHeight1 = MIN<int16>(_vm->_height, screenHeight - offY);
_vm->_video->_splitHeight2 = offY;
_vm->_video->_splitStart = screenHeight;
if ((_vm->_video->_surfHeight + offY) < _vm->_height)
_vm->_video->_screenDeltaY = (_vm->_height - (screenHeight + offY)) / 2;
else
_vm->_video->_screenDeltaY = 0;
_vm->_global->_mouseMaxY = (screenHeight + _vm->_video->_screenDeltaY) - offY - 1;
_vm->_global->_mouseMinY = _vm->_video->_screenDeltaY;
} else {
_vm->_video->_splitHeight1 = MIN<int16>(_vm->_height, _vm->_video->_surfHeight - offY);
_vm->_video->_splitHeight2 = offY;
_vm->_video->_splitStart = _vm->_video->_surfHeight - offY;
_vm->_video->_screenDeltaX = 0;
_vm->_video->_screenDeltaY = 0;
_vm->_global->_mouseMinX = 0;
_vm->_global->_mouseMinY = 0;
_vm->_global->_mouseMaxX = _vm->_width;
_vm->_global->_mouseMaxY = _vm->_height - _vm->_video->_splitHeight2 - 1;
}
_vm->_draw->closeScreen();
_vm->_util->clearPalette();