From a7959a4ed4132c4a4f5ce7af5de1a8d075038395 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 27 Dec 2015 22:50:09 +0200 Subject: LAB: Remove superfluous mouse show/hide calls Our mouse cursor is drawn in a separate layer, so we can draw on the screen without needing to hide it beforehand --- engines/lab/dispman.cpp | 8 -------- engines/lab/engine.cpp | 13 +++---------- engines/lab/eventman.cpp | 11 +---------- engines/lab/map.cpp | 12 +----------- 4 files changed, 5 insertions(+), 39 deletions(-) (limited to 'engines/lab') diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp index 4b256f0c23..289e66894f 100644 --- a/engines/lab/dispman.cpp +++ b/engines/lab/dispman.cpp @@ -218,7 +218,6 @@ int DisplayMan::longDrawMessage(Common::String str, bool isActionMessage) { return 0; _vm->_event->attachButtonList(nullptr); - _vm->_event->mouseHide(); if (!_longWinInFront) { _longWinInFront = true; @@ -227,7 +226,6 @@ int DisplayMan::longDrawMessage(Common::String str, bool isActionMessage) { } createBox(198); - _vm->_event->mouseShow(); return flowText(_vm->_msgFont, 0, 1, 7, false, true, true, true, _vm->_utils->vgaRectScale(6, 155, 313, 195), str.c_str()); } @@ -252,17 +250,13 @@ void DisplayMan::drawMessage(Common::String str, bool isActionMessage) { drawPanel(); } - _vm->_event->mouseHide(); createBox(168); drawText(_vm->_msgFont, _vm->_utils->vgaScaleX(7), _vm->_utils->vgaScaleY(155) + _vm->_utils->svgaCord(2), 1, str); - _vm->_event->mouseShow(); _lastMessageLong = false; } } void DisplayMan::drawPanel() { - _vm->_event->mouseHide(); - // Clear Area rectFill(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319), _vm->_utils->vgaScaleY(199), 3); @@ -307,8 +301,6 @@ void DisplayMan::drawPanel() { _vm->_event->drawButtonList(&_vm->_invButtonList); } - - _vm->_event->mouseShow(); } void DisplayMan::setUpScreens() { diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index 8894ae79de..8f39ff52d4 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -150,11 +150,8 @@ void LabEngine::perFlipButton(uint16 buttonId) { topButton->_image = topButton->_altImage; topButton->_altImage = tmpImage; - if (!_alternate) { - _event->mouseHide(); + if (!_alternate) topButton->_image->drawImage(topButton->_x, topButton->_y); - _event->mouseShow(); - } break; } @@ -1022,13 +1019,13 @@ void LabEngine::go() { _msgFont = _resource->getFont("F:AvanteG.12"); else _msgFont = _resource->getFont("F:Map.fon"); - _event->mouseHide(); + _event->mouseHide(); Intro *intro = new Intro(this); intro->play(); delete intro; - _event->mouseShow(); + mainGameLoop(); _graphics->freeFont(&_msgFont); @@ -1133,9 +1130,7 @@ void LabEngine::mayShowCrumbIndicator() { memcpy(imgData, dropCrumbsImageData, CRUMBSWIDTH * CRUMBSHEIGHT); static Image dropCrumbsImage(CRUMBSWIDTH, CRUMBSHEIGHT, imgData, this); - _event->mouseHide(); dropCrumbsImage.drawMaskImage(612, 4); - _event->mouseShow(); } } @@ -1175,9 +1170,7 @@ void LabEngine::mayShowCrumbIndicatorOff() { memcpy(imgData, dropCrumbsOffImageData, CRUMBSWIDTH * CRUMBSHEIGHT); static Image dropCrumbsOffImage(CRUMBSWIDTH, CRUMBSHEIGHT, imgData, this); - _event->mouseHide(); dropCrumbsOffImage.drawMaskImage(612, 4); - _event->mouseShow(); } } diff --git a/engines/lab/eventman.cpp b/engines/lab/eventman.cpp index d1db854863..333cedd749 100644 --- a/engines/lab/eventman.cpp +++ b/engines/lab/eventman.cpp @@ -79,16 +79,12 @@ Button *EventManager::checkButtonHit(ButtonList *buttonList, Common::Point pos) if (_vm->_isHiRes) { _hitButton = button; } else { - mouseHide(); button->_altImage->drawImage(button->_x, button->_y); - mouseShow(); for (int i = 0; i < 3; i++) _vm->waitTOF(); - mouseHide(); button->_image->drawImage(button->_x, button->_y); - mouseShow(); } return button; @@ -119,16 +115,11 @@ void EventManager::updateMouse() { if (!_hitButton) return; - mouseHide(); _hitButton->_altImage->drawImage(_hitButton->_x, _hitButton->_y); - mouseShow(); - for (int i = 0; i < 3; i++) _vm->waitTOF(); - - mouseHide(); _hitButton->_image->drawImage(_hitButton->_x, _hitButton->_y); - mouseShow(); + _hitButton = nullptr; _vm->_graphics->screenUpdate(); } diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp index ee47c2b14b..2b283aec4a 100644 --- a/engines/lab/map.cpp +++ b/engines/lab/map.cpp @@ -328,8 +328,6 @@ uint16 LabEngine::getLowerFloor(uint16 floorNum) { } void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fadeIn) { - _event->mouseHide(); - _graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0); _imgMap->drawImage(0, 0); _event->drawButtonList(&_mapButtonList); @@ -380,8 +378,6 @@ void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fad if (fadeIn) _graphics->fade(true); - - _event->mouseShow(); } void LabEngine::processMap(uint16 curRoom) { @@ -503,7 +499,6 @@ void LabEngine::processMap(uint16 curRoom) { const char *sptr; if ((sptr = _rooms[curMsg]._roomMsg.c_str())) { - _event->mouseHide(); _graphics->rectFillScaled(13, 148, 135, 186, 3); _graphics->flowText(_msgFont, 0, 5, 3, true, true, true, true, _utils->vgaRectScale(14, 148, 134, 186), sptr); @@ -516,11 +511,8 @@ void LabEngine::processMap(uint16 curRoom) { int top, bottom; top = bottom = (curCoords.top + curCoords.bottom) / 2; - if ((curMsg != curRoom) && (_maps[curMsg]._pageNumber == curFloor)) { + if ((curMsg != curRoom) && (_maps[curMsg]._pageNumber == curFloor)) _graphics->rectFill(left, top, right, bottom, 1); - } - - _event->mouseShow(); } } } @@ -552,11 +544,9 @@ void LabEngine::doMap(uint16 curRoom) { _event->attachButtonList(nullptr); _graphics->fade(false); _graphics->blackAllScreen(); - _event->mouseHide(); _graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0); freeMapData(); _graphics->blackAllScreen(); - _event->mouseShow(); _graphics->screenUpdate(); } -- cgit v1.2.3