diff options
Diffstat (limited to 'engines/mads/nebular/dialogs_nebular.cpp')
-rw-r--r-- | engines/mads/nebular/dialogs_nebular.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 5b0fb7b538..ff119536ec 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -346,7 +346,6 @@ void DialogsNebular::showScummVMSaveDialog() { } scene->_spriteSlots.reset(); - _vm->_screen._offset.y = 0; scene->loadScene(scene->_currentSceneId, game._aaName, true); scene->_userInterface.noInventoryAnim(); game._scene.drawElements(kTransitionFadeIn, false); @@ -560,7 +559,8 @@ FullScreenDialog::FullScreenDialog(MADSEngine *vm) : _vm(vm) { } FullScreenDialog::~FullScreenDialog() { - _vm->_screen._offset.y = 0; + _vm->_screen.resetClipBounds(); + _vm->_game->_scene.restrictScene(); } void FullScreenDialog::display() { @@ -577,7 +577,6 @@ void FullScreenDialog::display() { scene._currentSceneId = currentSceneId; scene._nextSceneId = nextSceneId; - _vm->_screen._offset.y = 22; _vm->_events->initVars(); game._kernelMode = KERNEL_ROOM_INIT; @@ -590,11 +589,7 @@ void FullScreenDialog::display() { _vm->_palette->fadeOut(pal, nullptr, 0, PALETTE_COUNT, 0, 1, 1, 16); } - _vm->_screen.empty(); - _vm->_screen.hLine(0, 20, MADS_SCREEN_WIDTH, 2); - _vm->_screen.hLine(0, 179, MADS_SCREEN_WIDTH, 2); - game._scene._spriteSlots.fullRefresh(); - + // Set Fx state and palette entries game._fx = _vm->_screenFade == SCREEN_FADE_SMOOTH ? kTransitionFadeIn : kCenterVertTransition; game._trigger = 0; @@ -604,6 +599,18 @@ void FullScreenDialog::display() { _vm->_palette->setEntry(13, 45, 45, 0); _vm->_palette->setEntry(14, 63, 63, 63); _vm->_palette->setEntry(15, 45, 45, 45); + + + // Clear the screen and draw the upper and lower horizontal lines + _vm->_screen.empty(); + _vm->_screen.hLine(0, 20, MADS_SCREEN_WIDTH, 2); + _vm->_screen.hLine(0, 179, MADS_SCREEN_WIDTH, 2); + _vm->_screen.copyRectToScreen(Common::Rect(0, 0, MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT)); + + // Restrict the screen to the area between the two lines + _vm->_screen.setClipBounds(Common::Rect(0, DIALOG_TOP, MADS_SCREEN_WIDTH, + DIALOG_TOP + MADS_SCENE_HEIGHT)); + _vm->_game->_scene.restrictScene(); } /*------------------------------------------------------------------------*/ @@ -667,7 +674,7 @@ void GameDialog::display() { } GameDialog::~GameDialog() { - _vm->_screen._offset.y = 0; + _vm->_screen.resetClipBounds(); } void GameDialog::clearLines() { @@ -868,10 +875,11 @@ void GameDialog::handleEvents() { _vm->_events->pollEvents(); // Scan for objects in the dialog - int objIndex = screenObjects.scan(events.currentPos() - _vm->_screen._offset, LAYER_GUI); + Common::Point mousePos = events.currentPos() - Common::Point(0, DIALOG_TOP); + int objIndex = screenObjects.scan(mousePos, LAYER_GUI); if (_movedFlag) { - int yp = events.currentPos().y - _vm->_screen._offset.y; + int yp = mousePos.y; if (yp < screenObjects[1]._bounds.top) { if (!events._mouseReleased) _lines[1]._state = DLGSTATE_SELECTED; |