diff options
author | Filippos Karapetis | 2015-12-13 19:36:56 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:34:03 +0100 |
commit | 2332fb617c0c26da563cb60625b24d824ad4630b (patch) | |
tree | 17aa12ff02c806873d57338f9cb1812485c6ed8b /engines/lab | |
parent | 1524e20ef1f55d4af9ded4e599d3dda26f93e0b7 (diff) | |
download | scummvm-rg350-2332fb617c0c26da563cb60625b24d824ad4630b.tar.gz scummvm-rg350-2332fb617c0c26da563cb60625b24d824ad4630b.tar.bz2 scummvm-rg350-2332fb617c0c26da563cb60625b24d824ad4630b.zip |
LAB: Rename gadget to button
Diffstat (limited to 'engines/lab')
-rw-r--r-- | engines/lab/dispman.cpp | 50 | ||||
-rw-r--r-- | engines/lab/engine.cpp | 106 | ||||
-rw-r--r-- | engines/lab/eventman.cpp | 68 | ||||
-rw-r--r-- | engines/lab/eventman.h | 40 | ||||
-rw-r--r-- | engines/lab/interface.cpp | 112 | ||||
-rw-r--r-- | engines/lab/lab.cpp | 2 | ||||
-rw-r--r-- | engines/lab/lab.h | 18 | ||||
-rw-r--r-- | engines/lab/map.cpp | 36 | ||||
-rw-r--r-- | engines/lab/processroom.cpp | 2 | ||||
-rw-r--r-- | engines/lab/special.cpp | 38 |
10 files changed, 236 insertions, 236 deletions
diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp index d5ae0f48b5..736b7ea043 100644 --- a/engines/lab/dispman.cpp +++ b/engines/lab/dispman.cpp @@ -312,7 +312,7 @@ int32 DisplayMan::longDrawMessage(const char *str) { if (str == NULL) return 0; - _vm->_event->attachGadgetList(NULL); + _vm->_event->attachButtonList(NULL); _vm->_event->mouseHide(); strcpy(newText, str); @@ -373,7 +373,7 @@ void DisplayMan::drawPanel() { // Second Line setAPen(5); drawHLine(0, _vm->_utils->vgaScaleY(149) + 1 + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319)); - // Gadget Separators + // Button Separators setAPen(0); // First black line to separate buttons drawHLine(0, _vm->_utils->vgaScaleY(170), _vm->_utils->vgaScaleX(319)); @@ -382,7 +382,7 @@ void DisplayMan::drawPanel() { setAPen(4); // The horizontal lines under the black one drawHLine(0, _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(319)); - _vm->_event->drawGadgetList(&_vm->_moveGadgetList); + _vm->_event->drawButtonList(&_vm->_moveButtonList); } else { if (_vm->getPlatform() != Common::kPlatformWindows) { // Vertical Black lines @@ -412,7 +412,7 @@ void DisplayMan::drawPanel() { drawVLine(_vm->_utils->vgaScaleX(232), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198)); } - _vm->_event->drawGadgetList(&_vm->_invGadgetList); + _vm->_event->drawButtonList(&_vm->_invButtonList); } _vm->_event->mouseShow(); @@ -429,22 +429,22 @@ void DisplayMan::setUpScreens() { _vm->_moveImages[i] = new Image(controlFile); delete controlFile; - // Creates the gadgets for the movement control panel + // Creates the buttons for the movement control panel uint16 y = _vm->_utils->vgaScaleY(173) - _vm->_utils->svgaCord(2); // The key mapping was only set for the Windows version. // It's very convenient to have those shortcut, so I added them // for all versions. (Strangerke) - _vm->_moveGadgetList.push_back(_vm->_event->createButton( 1, y, 0, 't', _vm->_moveImages[0], _vm->_moveImages[1])); - _vm->_moveGadgetList.push_back(_vm->_event->createButton( 33, y, 1, 'm', _vm->_moveImages[2], _vm->_moveImages[3])); - _vm->_moveGadgetList.push_back(_vm->_event->createButton( 65, y, 2, 'o', _vm->_moveImages[4], _vm->_moveImages[5])); - _vm->_moveGadgetList.push_back(_vm->_event->createButton( 97, y, 3, 'c', _vm->_moveImages[6], _vm->_moveImages[7])); - _vm->_moveGadgetList.push_back(_vm->_event->createButton(129, y, 4, 'l', _vm->_moveImages[8], _vm->_moveImages[9])); - _vm->_moveGadgetList.push_back(_vm->_event->createButton(161, y, 5, 'i', _vm->_moveImages[12], _vm->_moveImages[13])); - _vm->_moveGadgetList.push_back(_vm->_event->createButton(193, y, 6, VKEY_LTARROW, _vm->_moveImages[14], _vm->_moveImages[15])); - _vm->_moveGadgetList.push_back(_vm->_event->createButton(225, y, 7, VKEY_UPARROW, _vm->_moveImages[16], _vm->_moveImages[17])); - _vm->_moveGadgetList.push_back(_vm->_event->createButton(257, y, 8, VKEY_RTARROW, _vm->_moveImages[18], _vm->_moveImages[19])); - _vm->_moveGadgetList.push_back(_vm->_event->createButton(289, y, 9, 'p', _vm->_moveImages[10], _vm->_moveImages[11])); + _vm->_moveButtonList.push_back(_vm->_event->createButton( 1, y, 0, 't', _vm->_moveImages[0], _vm->_moveImages[1])); + _vm->_moveButtonList.push_back(_vm->_event->createButton( 33, y, 1, 'm', _vm->_moveImages[2], _vm->_moveImages[3])); + _vm->_moveButtonList.push_back(_vm->_event->createButton( 65, y, 2, 'o', _vm->_moveImages[4], _vm->_moveImages[5])); + _vm->_moveButtonList.push_back(_vm->_event->createButton( 97, y, 3, 'c', _vm->_moveImages[6], _vm->_moveImages[7])); + _vm->_moveButtonList.push_back(_vm->_event->createButton(129, y, 4, 'l', _vm->_moveImages[8], _vm->_moveImages[9])); + _vm->_moveButtonList.push_back(_vm->_event->createButton(161, y, 5, 'i', _vm->_moveImages[12], _vm->_moveImages[13])); + _vm->_moveButtonList.push_back(_vm->_event->createButton(193, y, 6, VKEY_LTARROW, _vm->_moveImages[14], _vm->_moveImages[15])); + _vm->_moveButtonList.push_back(_vm->_event->createButton(225, y, 7, VKEY_UPARROW, _vm->_moveImages[16], _vm->_moveImages[17])); + _vm->_moveButtonList.push_back(_vm->_event->createButton(257, y, 8, VKEY_RTARROW, _vm->_moveImages[18], _vm->_moveImages[19])); + _vm->_moveButtonList.push_back(_vm->_event->createButton(289, y, 9, 'p', _vm->_moveImages[10], _vm->_moveImages[11])); Common::File *invFile = _vm->_resource->openDataFile("P:Inv"); if (_vm->getPlatform() == Common::kPlatformWindows) { @@ -454,18 +454,18 @@ void DisplayMan::setUpScreens() { for (uint16 imgIdx = 0; imgIdx < 6; imgIdx++) _vm->_invImages[imgIdx] = new Image(invFile); } - _vm->_invGadgetList.push_back(_vm->_event->createButton( 24, y, 0, 'm', _vm->_invImages[0], _vm->_invImages[1])); - _vm->_invGadgetList.push_back(_vm->_event->createButton( 56, y, 1, 'g', _vm->_invImages[2], _vm->_invImages[3])); - _vm->_invGadgetList.push_back(_vm->_event->createButton( 94, y, 2, 'u', _vm->_invImages[4], _vm->_invImages[5])); - _vm->_invGadgetList.push_back(_vm->_event->createButton(126, y, 3, 'l', _vm->_moveImages[8], _vm->_moveImages[9])); - _vm->_invGadgetList.push_back(_vm->_event->createButton(164, y, 4, VKEY_LTARROW, _vm->_moveImages[14], _vm->_moveImages[15])); - _vm->_invGadgetList.push_back(_vm->_event->createButton(196, y, 5, VKEY_RTARROW, _vm->_moveImages[18], _vm->_moveImages[19])); - - // The windows version has 2 extra gadgets for breadcrumb trail + _vm->_invButtonList.push_back(_vm->_event->createButton( 24, y, 0, 'm', _vm->_invImages[0], _vm->_invImages[1])); + _vm->_invButtonList.push_back(_vm->_event->createButton( 56, y, 1, 'g', _vm->_invImages[2], _vm->_invImages[3])); + _vm->_invButtonList.push_back(_vm->_event->createButton( 94, y, 2, 'u', _vm->_invImages[4], _vm->_invImages[5])); + _vm->_invButtonList.push_back(_vm->_event->createButton(126, y, 3, 'l', _vm->_moveImages[8], _vm->_moveImages[9])); + _vm->_invButtonList.push_back(_vm->_event->createButton(164, y, 4, VKEY_LTARROW, _vm->_moveImages[14], _vm->_moveImages[15])); + _vm->_invButtonList.push_back(_vm->_event->createButton(196, y, 5, VKEY_RTARROW, _vm->_moveImages[18], _vm->_moveImages[19])); + + // The windows version has 2 extra buttons for breadcrumb trail // TODO: the game is really hard to play without those, maybe we could add something to enable that. if (_vm->getPlatform() == Common::kPlatformWindows) { - _vm->_invGadgetList.push_back(_vm->_event->createButton(234, y, 6, 'b', _vm->_invImages[6], _vm->_invImages[7])); - _vm->_invGadgetList.push_back(_vm->_event->createButton(266, y, 7, 'f', _vm->_invImages[8], _vm->_invImages[9])); + _vm->_invButtonList.push_back(_vm->_event->createButton(234, y, 6, 'b', _vm->_invImages[6], _vm->_invImages[7])); + _vm->_invButtonList.push_back(_vm->_event->createButton(266, y, 7, 'f', _vm->_invImages[8], _vm->_invImages[9])); } delete invFile; diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index 9ae7beb29a..ed08d85665 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -135,19 +135,19 @@ void LabEngine::freeScreens() { } /** - * Permanently flips the imagery of a gadget. + * Permanently flips the imagery of a button. */ -void LabEngine::perFlipGadget(uint16 gadgetId) { - for (GadgetList::iterator gadget = _moveGadgetList.begin(); gadget != _moveGadgetList.end(); ++gadget) { - Gadget *topGadget = *gadget; - if (topGadget->_gadgetID == gadgetId) { - Image *tmpImage = topGadget->_image; - topGadget->_image = topGadget->_altImage; - topGadget->_altImage = tmpImage; +void LabEngine::perFlipButton(uint16 buttonId) { + for (ButtonList::iterator button = _moveButtonList.begin(); button != _moveButtonList.end(); ++button) { + Button *topButton = *button; + if (topButton->_buttonID == buttonId) { + Image *tmpImage = topButton->_image; + topButton->_image = topButton->_altImage; + topButton->_altImage = tmpImage; if (!_alternate) { _event->mouseHide(); - topGadget->_image->drawImage(topGadget->x, topGadget->y); + topButton->_image->drawImage(topButton->x, topButton->y); _event->mouseShow(); } @@ -260,7 +260,7 @@ const char *LabEngine::getInvName(uint16 curInv) { */ void LabEngine::interfaceOff() { if (!_interfaceOff) { - _event->attachGadgetList(nullptr); + _event->attachButtonList(nullptr); _event->mouseHide(); _interfaceOff = true; } @@ -276,15 +276,15 @@ void LabEngine::interfaceOn() { } if (_graphics->_longWinInFront) - _event->attachGadgetList(nullptr); + _event->attachButtonList(nullptr); else if (_alternate) - _event->attachGadgetList(&_invGadgetList); + _event->attachButtonList(&_invButtonList); else - _event->attachGadgetList(&_moveGadgetList); + _event->attachButtonList(&_moveButtonList); } /** - * If the user hits the "Use" gadget; things that can get used on themselves. + * If the user hits the "Use" button; things that can get used on themselves. */ bool LabEngine::doUse(uint16 curInv) { switch (curInv) { @@ -427,7 +427,7 @@ void LabEngine::mainGameLoop() { _graphics->_longWinInFront = false; _graphics->drawPanel(); - perFlipGadget(actionMode); + perFlipButton(actionMode); // Set up initial picture. while (1) { @@ -534,7 +534,7 @@ void LabEngine::mainGameLoop() { gotMessage = true; mayShowCrumbIndicator(); _graphics->screenUpdate(); - if (!fromCrumbs(GADGETUP, code, 0, _event->updateAndGetMousePos(), curInv, curMsg, forceDraw, code, actionMode)) + if (!fromCrumbs(BUTTONUP, code, 0, _event->updateAndGetMousePos(), curInv, curMsg, forceDraw, code, actionMode)) break; } } @@ -549,7 +549,7 @@ void LabEngine::mainGameLoop() { curPos.y = curMsg->_mouseY; _followingCrumbs = false; - if (!fromCrumbs(curMsg->_msgClass, curMsg->_code, curMsg->_qualifier, curPos, curInv, curMsg, forceDraw, curMsg->_gadgetID, actionMode)) + if (!fromCrumbs(curMsg->_msgClass, curMsg->_code, curMsg->_qualifier, curPos, curInv, curMsg, forceDraw, curMsg->_buttonID, actionMode)) break; } } @@ -596,7 +596,7 @@ void LabEngine::showLab2Teaser() { } bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Common::Point tmpPos, - uint16 &curInv, IntuiMessage *curMsg, bool &forceDraw, uint16 gadgetId, uint16 &actionMode) { + uint16 &curInv, IntuiMessage *curMsg, bool &forceDraw, uint16 buttonId, uint16 &actionMode) { uint32 msgClass = tmpClass; Common::Point curPos = tmpPos; @@ -641,7 +641,7 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo _graphics->_doNotDrawMessage = false; _mainDisplay = true; - // Sets the correct gadget list + // Sets the correct button list interfaceOn(); _graphics->drawPanel(); drawRoomMessage(curInv, _closeDataPtr); @@ -710,9 +710,9 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo drawRoomMessage(curInv, _closeDataPtr); _graphics->screenUpdate(); } - } else if ((msgClass == GADGETUP) && !_alternate) { - if (gadgetId <= 5) { - if ((actionMode == 4) && (gadgetId == 4) && _closeDataPtr) { + } else if ((msgClass == BUTTONUP) && !_alternate) { + if (buttonId <= 5) { + if ((actionMode == 4) && (buttonId == 4) && _closeDataPtr) { doMainView(&_closeDataPtr); _anim->_doBlack = true; @@ -720,13 +720,13 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo _closeDataPtr = nullptr; mayShowCrumbIndicator(); _graphics->screenUpdate(); - } else if (gadgetId == 5) { + } else if (buttonId == 5) { eatMessages(); _alternate = true; _anim->_doBlack = true; _graphics->_doNotDrawMessage = false; - // Sets the correct gadget list + // Sets the correct button list interfaceOn(); _mainDisplay = false; @@ -743,29 +743,29 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo _graphics->screenUpdate(); } else { uint16 oldActionMode = actionMode; - actionMode = gadgetId; + actionMode = buttonId; if (oldActionMode < 5) - perFlipGadget(oldActionMode); + perFlipButton(oldActionMode); - perFlipGadget(actionMode); + perFlipButton(actionMode); - if (gadgetId <= 4) - drawStaticMessage(kTextTakeWhat + gadgetId); + if (buttonId <= 4) + drawStaticMessage(kTextTakeWhat + buttonId); _graphics->screenUpdate(); } - } else if (gadgetId == 9) { + } else if (buttonId == 9) { doUse(kItemMap); mayShowCrumbIndicator(); _graphics->screenUpdate(); - } else if (gadgetId >= 6) { - // Arrow Gadgets + } else if (buttonId >= 6) { + // Arrow Buttons _closeDataPtr = nullptr; wrkClosePtr = nullptr; - if ((gadgetId == 6) || (gadgetId == 8)) { - if (gadgetId == 6) + if ((buttonId == 6) || (buttonId == 8)) { + if (buttonId == 6) drawStaticMessage(kTextTurnLeft); else drawStaticMessage(kTextTurnRight); @@ -774,7 +774,7 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo oldDirection = _direction; - uint16 newDir = processArrow(_direction, gadgetId - 6); + uint16 newDir = processArrow(_direction, buttonId - 6); doTurn(_direction, newDir, &_closeDataPtr); _anim->_doBlack = true; _direction = newDir; @@ -782,7 +782,7 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo mayShowCrumbIndicator(); _graphics->screenUpdate(); - } else if (gadgetId == 7) { + } else if (buttonId == 7) { uint16 oldRoomNum = _roomNum; if (doGoForward(&_closeDataPtr)) { @@ -790,7 +790,7 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo _anim->_doBlack = true; } else { _anim->_doBlack = true; - _direction = processArrow(_direction, gadgetId - 6); + _direction = processArrow(_direction, buttonId - 6); if (oldRoomNum != _roomNum) { drawStaticMessage(kTextGoForward); @@ -847,17 +847,17 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo _graphics->screenUpdate(); } } - } else if ((msgClass == GADGETUP) && _alternate) { + } else if ((msgClass == BUTTONUP) && _alternate) { _anim->_doBlack = true; - if (gadgetId == 0) { + if (buttonId == 0) { eatMessages(); _alternate = false; _anim->_doBlack = true; _graphics->_doNotDrawMessage = false; _mainDisplay = true; - // Sets the correct gadget list + // Sets the correct button list interfaceOn(); _graphics->drawPanel(); drawRoomMessage(curInv, _closeDataPtr); @@ -865,9 +865,9 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo _graphics->screenUpdate(); } - gadgetId--; + buttonId--; - if (gadgetId == 0) { + if (buttonId == 0) { interfaceOff(); _anim->stopDiff(); _curFileName = " "; @@ -889,21 +889,21 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo g_system->delayMillis(1000); } _graphics->screenUpdate(); - } else if (gadgetId == 1) { + } else if (buttonId == 1) { if (!doUse(curInv)) { uint16 oldActionMode = actionMode; // Use button actionMode = 5; if (oldActionMode < 5) - perFlipGadget(oldActionMode); + perFlipButton(oldActionMode); drawStaticMessage(kTextUseOnWhat); _mainDisplay = true; _graphics->screenUpdate(); } - } else if (gadgetId == 2) { + } else if (buttonId == 2) { _mainDisplay = !_mainDisplay; if ((curInv == 0) || (curInv > _numInv)) { @@ -917,30 +917,30 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo _nextFileName = getInvName(curInv); _graphics->screenUpdate(); - } else if (gadgetId == 3) { - // Left gadget + } else if (buttonId == 3) { + // Left button decIncInv(&curInv, true); lastInv = curInv; _graphics->_doNotDrawMessage = false; drawRoomMessage(curInv, _closeDataPtr); _graphics->screenUpdate(); - } else if (gadgetId == 4) { - // Right gadget + } else if (buttonId == 4) { + // Right button decIncInv(&curInv, false); lastInv = curInv; _graphics->_doNotDrawMessage = false; drawRoomMessage(curInv, _closeDataPtr); _graphics->screenUpdate(); - } else if (gadgetId == 5) { + } else if (buttonId == 5) { // bread crumbs _breadCrumbs[0]._roomNum = 0; _numCrumbs = 0; _droppingCrumbs = true; mayShowCrumbIndicator(); _graphics->screenUpdate(); - } else if (gadgetId == 6) { + } else if (buttonId == 6) { // follow crumbs if (_droppingCrumbs) { if (_numCrumbs > 0) { @@ -958,7 +958,7 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo _graphics->_doNotDrawMessage = false; _mainDisplay = true; - // Sets the correct gadget list + // Sets the correct button list interfaceOn(); _graphics->drawPanel(); drawRoomMessage(curInv, _closeDataPtr); @@ -1085,7 +1085,7 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo _anim->_doBlack = true; _graphics->_doNotDrawMessage = false; _mainDisplay = true; - // Sets the correct gadget list + // Sets the correct button list interfaceOn(); if (_alternate) { diff --git a/engines/lab/eventman.cpp b/engines/lab/eventman.cpp index 7b5d184dc9..63ca63a7b4 100644 --- a/engines/lab/eventman.cpp +++ b/engines/lab/eventman.cpp @@ -60,49 +60,49 @@ static const byte mouseData[] = { #define MOUSE_HEIGHT 15 /** - * Checks whether or not the cords fall within one of the gadgets in a list - * of gadgets. + * Checks whether or not the cords fall within one of the buttons in a list + * of buttons. */ -Gadget *EventManager::checkGadgetHit(GadgetList *gadgetList, Common::Point pos) { - for (GadgetList::iterator gadgetItr = gadgetList->begin(); gadgetItr != gadgetList->end(); ++gadgetItr) { - Gadget *gadget = *gadgetItr; - Common::Rect gadgetRect(gadget->x, gadget->y, gadget->x + gadget->_image->_width - 1, gadget->y + gadget->_image->_height - 1); +Button *EventManager::checkButtonHit(ButtonList *buttonList, Common::Point pos) { + for (ButtonList::iterator buttonItr = buttonList->begin(); buttonItr != buttonList->end(); ++buttonItr) { + Button *button = *buttonItr; + Common::Rect buttonRect(button->x, button->y, button->x + button->_image->_width - 1, button->y + button->_image->_height - 1); - if (gadgetRect.contains(pos) && gadget->isEnabled) { + if (buttonRect.contains(pos) && button->isEnabled) { if (_vm->_isHiRes) { - _hitGadget = gadget; + _hitButton = button; } else { mouseHide(); - gadget->_altImage->drawImage(gadget->x, gadget->y); + button->_altImage->drawImage(button->x, button->y); mouseShow(); for (uint16 i = 0; i < 3; i++) _vm->waitTOF(); mouseHide(); - gadget->_image->drawImage(gadget->x, gadget->y); + button->_image->drawImage(button->x, button->y); mouseShow(); } - return gadget; + return button; } } return NULL; } -void EventManager::attachGadgetList(GadgetList *gadgetList) { - if (_screenGadgetList != gadgetList) - _lastGadgetHit = nullptr; +void EventManager::attachButtonList(ButtonList *buttonList) { + if (_screenButtonList != buttonList) + _lastButtonHit = nullptr; - _screenGadgetList = gadgetList; + _screenButtonList = buttonList; } -Gadget *EventManager::getGadget(uint16 id) { - for (GadgetList::iterator gadgetItr = _screenGadgetList->begin(); gadgetItr != _screenGadgetList->end(); ++gadgetItr) { - Gadget *gadget = *gadgetItr; - if (gadget->_gadgetID == id) - return gadget; +Button *EventManager::getButton(uint16 id) { + for (ButtonList::iterator buttonItr = _screenButtonList->begin(); buttonItr != _screenButtonList->end(); ++buttonItr) { + Button *button = *buttonItr; + if (button->_buttonID == id) + return button; } return nullptr; @@ -113,9 +113,9 @@ EventManager::EventManager(LabEngine *vm) : _vm(vm) { _rightClick = false; _mouseHidden = true; - _lastGadgetHit = nullptr; - _screenGadgetList = nullptr; - _hitGadget = nullptr; + _lastButtonHit = nullptr; + _screenButtonList = nullptr; + _hitButton = nullptr; _nextKeyIn = 0; _nextKeyOut = 0; _mousePos = Common::Point(0, 0); @@ -129,12 +129,12 @@ EventManager::EventManager(LabEngine *vm) : _vm(vm) { void EventManager::mouseHandler(int flag, Common::Point pos) { if (flag & 0x02) { // Left mouse button click - Gadget *tmp = NULL; - if (_screenGadgetList) - tmp = checkGadgetHit(_screenGadgetList, _vm->_isHiRes ? pos : Common::Point(pos.x / 2, pos.y)); + Button *tmp = NULL; + if (_screenButtonList) + tmp = checkButtonHit(_screenButtonList, _vm->_isHiRes ? pos : Common::Point(pos.x / 2, pos.y)); if (tmp) - _lastGadgetHit = tmp; + _lastButtonHit = tmp; else _leftClick = true; } @@ -150,19 +150,19 @@ void EventManager::updateMouse() { if (!_mouseHidden) doUpdateDisplay = true; - if (_hitGadget) { + if (_hitButton) { mouseHide(); - _hitGadget->_altImage->drawImage(_hitGadget->x, _hitGadget->y); + _hitButton->_altImage->drawImage(_hitButton->x, _hitButton->y); mouseShow(); for (uint16 i = 0; i < 3; i++) _vm->waitTOF(); mouseHide(); - _hitGadget->_image->drawImage(_hitGadget->x, _hitGadget->y); + _hitButton->_image->drawImage(_hitButton->x, _hitButton->y); mouseShow(); doUpdateDisplay = true; - _hitGadget = nullptr; + _hitButton = nullptr; } if (doUpdateDisplay) @@ -251,10 +251,10 @@ bool EventManager::mouseButton(uint16 *x, uint16 *y, bool leftbutton) { return false; } -Gadget *EventManager::mouseGadget() { - Gadget *temp = _lastGadgetHit; +Button *EventManager::mouseButton() { + Button *temp = _lastButtonHit; - _lastGadgetHit = nullptr; + _lastButtonHit = nullptr; return temp; } diff --git a/engines/lab/eventman.h b/engines/lab/eventman.h index 3becfeb693..cf61c40c19 100644 --- a/engines/lab/eventman.h +++ b/engines/lab/eventman.h @@ -40,7 +40,7 @@ class Image; // Defines for the Class variable in IntuiMessage #define MOUSEBUTTONS 0x00000008 -#define GADGETUP 0x00000040 +#define BUTTONUP 0x00000040 #define RAWKEY 0x00000400 #define DELTAMOVE 0x00100000 @@ -55,19 +55,19 @@ class Image; struct IntuiMessage { uint32 _msgClass; - uint16 _code, _qualifier, _mouseX, _mouseY, _gadgetID; + uint16 _code, _qualifier, _mouseX, _mouseY, _buttonID; uint32 _seconds, _micros; }; -struct Gadget { - uint16 x, y, _gadgetID; - uint16 _keyEquiv; // if not zero, a key that activates gadget +struct Button { + uint16 x, y, _buttonID; + uint16 _keyEquiv; // if not zero, a key that activates button bool isEnabled; Image *_image, *_altImage; }; -typedef Common::List<Gadget *> GadgetList; +typedef Common::List<Button *> ButtonList; class EventManager { private: @@ -76,7 +76,7 @@ private: bool _rightClick; bool _mouseHidden; - Gadget *_lastGadgetHit; + Button *_lastButtonHit; uint16 _nextKeyIn; uint16 _nextKeyOut; Common::Point _mousePos; @@ -86,11 +86,11 @@ private: public: EventManager (LabEngine *vm); - GadgetList *_screenGadgetList; - Gadget *_hitGadget; + ButtonList *_screenButtonList; + Button *_hitButton; Common::KeyState _keyPressed; - Gadget *checkGadgetHit(GadgetList *gadgetList, Common::Point pos); + Button *checkButtonHit(ButtonList *buttonList, Common::Point pos); void initMouse(); void updateMouse(); void mouseShow(); @@ -98,9 +98,9 @@ public: Common::Point getMousePos(); void setMousePos(Common::Point pos); bool mouseButton(uint16 *x, uint16 *y, bool leftButton); - Gadget *mouseGadget(); - void attachGadgetList(GadgetList *gadgetList); - Gadget *getGadget(uint16 id); + Button *mouseButton(); + void attachButtonList(ButtonList *buttonList); + Button *getButton(uint16 id); void mouseHandler(int flag, Common::Point pos); bool keyPress(uint16 *keyCode); bool haveNextChar(); @@ -108,14 +108,14 @@ public: uint16 getNextChar(); Common::Point updateAndGetMousePos(); - Gadget *checkNumGadgetHit(GadgetList *gadgetList, uint16 key); - Gadget *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *im, Image *imalt); - void freeButtonList(GadgetList *gadgetList); - void drawGadgetList(GadgetList *gadgetList); - void disableGadget(Gadget *curgad, uint16 pencolor); - void enableGadget(Gadget *curgad); + Button *checkNumButtonHit(ButtonList *buttonList, uint16 key); + Button *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *im, Image *imalt); + void freeButtonList(ButtonList *buttonList); + void drawButtonList(ButtonList *buttonList); + void disableButton(Button *curgad, uint16 pencolor); + void enableButton(Button *curgad); IntuiMessage *getMsg(); - uint16 makeGadgetKeyEquiv(uint16 key); + uint16 makeButtonKeyEquiv(uint16 key); }; } // End of namespace Lab diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp index cd062a8ea3..acc5a8a3cc 100644 --- a/engines/lab/interface.cpp +++ b/engines/lab/interface.cpp @@ -39,66 +39,66 @@ namespace Lab { -Gadget *EventManager::createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *image, Image *altImage) { - Gadget *gadget = new Gadget(); - - if (gadget) { - gadget->x = _vm->_utils->vgaScaleX(x); - gadget->y = y; - gadget->_gadgetID = id; - gadget->_keyEquiv = key; - gadget->_image = image; - gadget->_altImage = altImage; - gadget->isEnabled = true; - - return gadget; +Button *EventManager::createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *image, Image *altImage) { + Button *button = new Button(); + + if (button) { + button->x = _vm->_utils->vgaScaleX(x); + button->y = y; + button->_buttonID = id; + button->_keyEquiv = key; + button->_image = image; + button->_altImage = altImage; + button->isEnabled = true; + + return button; } else return nullptr; } -void EventManager::freeButtonList(GadgetList *gadgetList) { - for (GadgetList::iterator gadgetIter = gadgetList->begin(); gadgetIter != gadgetList->end(); ++gadgetIter) { - Gadget *gadget = *gadgetIter; - delete gadget->_image; - delete gadget->_altImage; - delete gadget; +void EventManager::freeButtonList(ButtonList *buttonList) { + for (ButtonList::iterator buttonIter = buttonList->begin(); buttonIter != buttonList->end(); ++buttonIter) { + Button *button = *buttonIter; + delete button->_image; + delete button->_altImage; + delete button; } - gadgetList->clear(); + buttonList->clear(); } /** - * Draws a gadget list to the screen. + * Draws a button list to the screen. */ -void EventManager::drawGadgetList(GadgetList *gadgetList) { - for (GadgetList::iterator gadget = gadgetList->begin(); gadget != gadgetList->end(); ++gadget) { - (*gadget)->_image->drawImage((*gadget)->x, (*gadget)->y); +void EventManager::drawButtonList(ButtonList *buttonList) { + for (ButtonList::iterator button = buttonList->begin(); button != buttonList->end(); ++button) { + (*button)->_image->drawImage((*button)->x, (*button)->y); - if (!(*gadget)->isEnabled) - disableGadget((*gadget), 1); + if (!(*button)->isEnabled) + disableButton((*button), 1); } } /** - * Dims a gadget, and makes it unavailable for using. + * Dims a button, and makes it unavailable for using. */ -void EventManager::disableGadget(Gadget *gadget, uint16 penColor) { - _vm->_graphics->overlayRect(penColor, gadget->x, gadget->y, gadget->x + gadget->_image->_width - 1, gadget->y + gadget->_image->_height - 1); - gadget->isEnabled = false; +void EventManager::disableButton(Button *button, uint16 penColor) { + _vm->_graphics->overlayRect(penColor, button->x, button->y, button->x + button->_image->_width - 1, button->y + button->_image->_height - 1); + button->isEnabled = false; } /** - * Undims a gadget, and makes it available again. + * Undims a button, and makes it available again. */ -void EventManager::enableGadget(Gadget *gadget) { - gadget->_image->drawImage(gadget->x, gadget->y); - gadget->isEnabled = true; +void EventManager::enableButton(Button *button) { + button->_image->drawImage(button->x, button->y); + button->isEnabled = true; } /** - * Make a key press have the right case for a gadget KeyEquiv value. + * Make a key press have the right case for a button KeyEquiv value. */ -uint16 EventManager::makeGadgetKeyEquiv(uint16 key) { +uint16 EventManager::makeButtonKeyEquiv(uint16 key) { if (Common::isAlnum(key)) key = tolower(key); @@ -106,29 +106,29 @@ uint16 EventManager::makeGadgetKeyEquiv(uint16 key) { } /** - * Checks whether or not the coords fall within one of the gadgets in a list - * of gadgets. + * Checks whether or not the coords fall within one of the buttons in a list + * of buttons. */ -Gadget *EventManager::checkNumGadgetHit(GadgetList *gadgetList, uint16 key) { +Button *EventManager::checkNumButtonHit(ButtonList *buttonList, uint16 key) { uint16 gkey = key - '0'; - if (!gadgetList) + if (!buttonList) return nullptr; - for (GadgetList::iterator gadgetItr = gadgetList->begin(); gadgetItr != gadgetList->end(); ++gadgetItr) { - Gadget *gadget = *gadgetItr; - if ((gkey - 1 == gadget->_gadgetID || (gkey == 0 && gadget->_gadgetID == 9) || - (gadget->_keyEquiv != 0 && makeGadgetKeyEquiv(key) == gadget->_keyEquiv)) - && gadget->isEnabled) { + for (ButtonList::iterator buttonItr = buttonList->begin(); buttonItr != buttonList->end(); ++buttonItr) { + Button *button = *buttonItr; + if ((gkey - 1 == button->_buttonID || (gkey == 0 && button->_buttonID == 9) || + (button->_keyEquiv != 0 && makeButtonKeyEquiv(key) == button->_keyEquiv)) + && button->isEnabled) { mouseHide(); - gadget->_altImage->drawImage(gadget->x, gadget->y); + button->_altImage->drawImage(button->x, button->y); mouseShow(); g_system->delayMillis(80); mouseHide(); - gadget->_image->drawImage(gadget->x, gadget->y); + button->_image->drawImage(button->x, button->y); mouseShow(); - return gadget; + return button; } } @@ -141,13 +141,13 @@ IntuiMessage *EventManager::getMsg() { updateMouse(); int qualifiers = _keyPressed.flags; - Gadget *curgad = mouseGadget(); + Button *curgad = mouseButton(); if (curgad) { updateMouse(); - message._msgClass = GADGETUP; - message._code = curgad->_gadgetID; - message._gadgetID = curgad->_gadgetID; + message._msgClass = BUTTONUP; + message._code = curgad->_buttonID; + message._buttonID = curgad->_buttonID; message._qualifier = qualifiers; return &message; } else if (mouseButton(&message._mouseX, &message._mouseY, true)) { @@ -162,12 +162,12 @@ IntuiMessage *EventManager::getMsg() { return &message; } else if (keyPress(&message._code)) { // Keyboard key - curgad = checkNumGadgetHit(_screenGadgetList, message._code); + curgad = checkNumButtonHit(_screenButtonList, message._code); if (curgad) { - message._msgClass = GADGETUP; - message._code = curgad->_gadgetID; - message._gadgetID = curgad->_gadgetID; + message._msgClass = BUTTONUP; + message._code = curgad->_buttonID; + message._buttonID = curgad->_buttonID; } else message._msgClass = RAWKEY; diff --git a/engines/lab/lab.cpp b/engines/lab/lab.cpp index e7df814c5e..06ab61d3f7 100644 --- a/engines/lab/lab.cpp +++ b/engines/lab/lab.cpp @@ -135,7 +135,7 @@ LabEngine::LabEngine(OSystem *syst, const ADGameDescription *gameDesc) _monitorPage = 0; _monitorTextFilename = ""; _monitorButton = nullptr; - _monitorGadgetHeight = 1; + _monitorButtonHeight = 1; for (int i = 0; i < 20; i++) _highPalette[i] = 0; diff --git a/engines/lab/lab.h b/engines/lab/lab.h index 7c438c4a6e..770e1ea4d2 100644 --- a/engines/lab/lab.h +++ b/engines/lab/lab.h @@ -46,7 +46,7 @@ namespace Lab { struct MapData; struct Action; struct CloseData; -struct Gadget; +struct Button; struct IntuiMessage; struct InventoryData; struct RoomData; @@ -71,7 +71,7 @@ enum GameFeatures { #define ONESECOND 1000 -typedef Common::List<Gadget *> GadgetList; +typedef Common::List<Button *> ButtonList; struct CrumbData { uint16 _roomNum; @@ -106,7 +106,7 @@ private: uint16 _journalPage; uint16 _maxRooms; uint16 _monitorPage; - uint16 _monitorGadgetHeight; + uint16 _monitorButtonHeight; uint32 _extraGameFeatures; @@ -117,8 +117,8 @@ private: const char *_monitorTextFilename; CloseDataPtr _closeDataPtr; - GadgetList _journalGadgetList; - GadgetList _mapGadgetList; + ButtonList _journalButtonList; + ButtonList _mapButtonList; Image *_imgMap, *_imgRoom, *_imgUpArrowRoom, *_imgDownArrowRoom, *_imgBridge; Image *_imgHRoom, *_imgVRoom, *_imgMaze, *_imgHugeMaze, *_imgPath, *_imgMapNorth; Image *_imgMapEast, *_imgMapSouth, *_imgMapWest, *_imgXMark; @@ -156,8 +156,8 @@ public: CrumbData _breadCrumbs[MAX_CRUMBS]; DisplayMan *_graphics; EventManager *_event; - GadgetList _invGadgetList; - GadgetList _moveGadgetList; + ButtonList _invButtonList; + ButtonList _moveButtonList; Image *_invImages[10]; Image *_moveImages[20]; LargeSet *_conditions, *_roomsFound; @@ -223,7 +223,7 @@ private: void freeMapData(); void freeScreens(); bool fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Common::Point tmpPos, - uint16 &curInv, IntuiMessage *curMsg, bool &forceDraw, uint16 gadgetId, uint16 &actionMode); + uint16 &curInv, IntuiMessage *curMsg, bool &forceDraw, uint16 buttonId, uint16 &actionMode); const char *getInvName(uint16 curInv); uint16 getLowerFloor(uint16 floorNum); CloseData *getObject(Common::Point pos, CloseDataPtr closePtr); @@ -237,7 +237,7 @@ private: void showLab2Teaser(); void mayShowCrumbIndicator(); void mayShowCrumbIndicatorOff(); - void perFlipGadget(uint16 gadID); + void perFlipButton(uint16 gadID); uint16 processArrow(uint16 curDirection, uint16 arrow); void processJournal(); void processMap(uint16 curRoom); diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp index 179bba5581..2258775c79 100644 --- a/engines/lab/map.cpp +++ b/engines/lab/map.cpp @@ -78,9 +78,9 @@ void LabEngine::loadMapData() { _imgPath = new Image(mapImages); _imgBridge = new Image(mapImages); - _mapGadgetList.push_back(_event->createButton( 8, _utils->vgaScaleY(105), 0, VKEY_LTARROW, new Image(mapImages), new Image(mapImages))); // back - _mapGadgetList.push_back(_event->createButton( 55, _utils->vgaScaleY(105), 1, VKEY_UPARROW, new Image(mapImages), new Image(mapImages))); // up - _mapGadgetList.push_back(_event->createButton(101, _utils->vgaScaleY(105), 2, VKEY_DNARROW, new Image(mapImages), new Image(mapImages))); // down + _mapButtonList.push_back(_event->createButton( 8, _utils->vgaScaleY(105), 0, VKEY_LTARROW, new Image(mapImages), new Image(mapImages))); // back + _mapButtonList.push_back(_event->createButton( 55, _utils->vgaScaleY(105), 1, VKEY_UPARROW, new Image(mapImages), new Image(mapImages))); // up + _mapButtonList.push_back(_event->createButton(101, _utils->vgaScaleY(105), 2, VKEY_DNARROW, new Image(mapImages), new Image(mapImages))); // down delete mapImages; @@ -103,7 +103,7 @@ void LabEngine::loadMapData() { } void LabEngine::freeMapData() { - _event->freeButtonList(&_mapGadgetList); + _event->freeButtonList(&_mapButtonList); delete _imgMap; delete _imgRoom; @@ -368,7 +368,7 @@ void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fad _graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1); _imgMap->drawImage(0, 0); - _event->drawGadgetList(&_mapGadgetList); + _event->drawButtonList(&_mapButtonList); for (uint16 i = 1; i <= _maxRooms; i++) { if ((_maps[i]._pageNumber == floorNum) && _roomsFound->in(i) && _maps[i]._x) { @@ -383,18 +383,18 @@ void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fad if ((_maps[curRoom]._pageNumber == floorNum) && _roomsFound->in(curRoom) && _maps[curRoom]._x) drawRoomMap(curRoom, true); - Gadget *upGadget = _event->getGadget(1); - Gadget *downGadget = _event->getGadget(2); + Button *upButton = _event->getButton(1); + Button *downButton = _event->getButton(2); if (getUpperFloor(floorNum) != kFloorNone) - _event->enableGadget(upGadget); + _event->enableButton(upButton); else - _event->disableGadget(upGadget, 12); + _event->disableButton(upButton, 12); if (getLowerFloor(floorNum) != kFloorNone) - _event->enableGadget(downGadget); + _event->enableButton(downButton); else - _event->disableGadget(downGadget, 12); + _event->disableButton(downButton, 12); // Labyrinth specific code if (floorNum == kFloorLower) { @@ -474,7 +474,7 @@ void LabEngine::processMap(uint16 curRoom) { } else { uint32 msgClass = msg->_msgClass; uint16 msgCode = msg->_code; - uint16 gadgetID = msg->_gadgetID; + uint16 buttonID = msg->_buttonID; uint16 qualifier = msg->_qualifier; uint16 mouseX = msg->_mouseX; uint16 mouseY = msg->_mouseY; @@ -482,11 +482,11 @@ void LabEngine::processMap(uint16 curRoom) { if (((msgClass == MOUSEBUTTONS) && (IEQUALIFIER_RIGHTBUTTON & qualifier)) || ((msgClass == RAWKEY) && (msgCode == 27))) return; - if (msgClass == GADGETUP) { - if (gadgetID == 0) { + if (msgClass == BUTTONUP) { + if (buttonID == 0) { // Quit menu button return; - } else if (gadgetID == 1) { + } else if (buttonID == 1) { // Up arrow uint16 upperFloor = getUpperFloor(curFloor); if (upperFloor != kFloorNone) { @@ -495,7 +495,7 @@ void LabEngine::processMap(uint16 curRoom) { drawMap(curRoom, curMsg, curFloor, false, false); _graphics->fade(true, 0); } - } else if (gadgetID == 2) { + } else if (buttonID == 2) { // Down arrow uint16 lowerFloor = getLowerFloor(curFloor); if (lowerFloor != kFloorNone) { @@ -613,12 +613,12 @@ void LabEngine::doMap(uint16 curRoom) { else if (_direction == WEST) _imgXMark = _imgMapWest; - _event->attachGadgetList(&_mapGadgetList); + _event->attachButtonList(&_mapButtonList); drawMap(curRoom, curRoom, _maps[curRoom]._pageNumber, false, true); _event->mouseShow(); _graphics->screenUpdate(); processMap(curRoom); - _event->attachGadgetList(nullptr); + _event->attachButtonList(nullptr); _graphics->fade(false, 0); _graphics->blackAllScreen(); _event->mouseHide(); diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp index c754d288b7..e95b67604e 100644 --- a/engines/lab/processroom.cpp +++ b/engines/lab/processroom.cpp @@ -176,7 +176,7 @@ void LabEngine::drawDirection(CloseDataPtr closePtr) { } /** - * process a arrow gadget movement. + * process a arrow button movement. */ uint16 LabEngine::processArrow(uint16 curDirection, uint16 arrow) { if (arrow == 1) { // Forward diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp index 1fc5c67efd..0f5e00b3e2 100644 --- a/engines/lab/special.cpp +++ b/engines/lab/special.cpp @@ -141,9 +141,9 @@ void LabEngine::loadJournalData() { Common::File *journalFile = _resource->openDataFile("P:JImage"); Utils *utils = _utils; - _journalGadgetList.push_back(_event->createButton( 80, utils->vgaScaleY(162) + utils->svgaCord(1), 0, VKEY_LTARROW, new Image(journalFile), new Image(journalFile))); // back - _journalGadgetList.push_back(_event->createButton(194, utils->vgaScaleY(162) + utils->svgaCord(1), 2, 0, new Image(journalFile), new Image(journalFile))); // cancel - _journalGadgetList.push_back(_event->createButton(144, utils->vgaScaleY(164) - utils->svgaCord(1), 1, VKEY_RTARROW, new Image(journalFile), new Image(journalFile))); // forward + _journalButtonList.push_back(_event->createButton( 80, utils->vgaScaleY(162) + utils->svgaCord(1), 0, VKEY_LTARROW, new Image(journalFile), new Image(journalFile))); // back + _journalButtonList.push_back(_event->createButton(194, utils->vgaScaleY(162) + utils->svgaCord(1), 2, 0, new Image(journalFile), new Image(journalFile))); // cancel + _journalButtonList.push_back(_event->createButton(144, utils->vgaScaleY(164) - utils->svgaCord(1), 1, VKEY_RTARROW, new Image(journalFile), new Image(journalFile))); // forward delete journalFile; _anim->_noPalChange = true; @@ -231,18 +231,18 @@ void LabEngine::drawJournal(uint16 wipenum, bool needFade) { else turnPage((bool)(wipenum == 1)); - Gadget *backGadget = _event->getGadget(0); - Gadget *forwardGadget = _event->getGadget(2); + Button *backButton = _event->getButton(0); + Button *forwardButton = _event->getButton(2); if (_journalPage == 0) - _event->disableGadget(backGadget, 15); + _event->disableButton(backButton, 15); else - _event->enableGadget(backGadget); + _event->enableButton(backButton); if (_lastPage) - _event->disableGadget(forwardGadget, 15); + _event->disableButton(forwardButton, 15); else - _event->enableGadget(forwardGadget); + _event->enableButton(forwardButton); if (needFade) _graphics->fade(true, 0); @@ -273,7 +273,7 @@ void LabEngine::processJournal() { if (((msgClass == MOUSEBUTTONS) && (IEQUALIFIER_RIGHTBUTTON & qualifier)) || ((msgClass == RAWKEY) && (gadID == 27))) return; - else if (msgClass == GADGETUP) { + else if (msgClass == BUTTONUP) { if (gadID == 0) { if (_journalPage >= 2) { _journalPage -= 2; @@ -310,17 +310,17 @@ void LabEngine::doJournal() { _music->updateMusic(); loadJournalData(); - _event->attachGadgetList(&_journalGadgetList); + _event->attachButtonList(&_journalButtonList); drawJournal(0, true); _event->mouseShow(); processJournal(); - _event->attachGadgetList(NULL); + _event->attachButtonList(NULL); _graphics->fade(false, 0); _event->mouseHide(); delete[] _blankJournal; delete[] journalBackImage._imageData; - _event->freeButtonList(&_journalGadgetList); + _event->freeButtonList(&_journalButtonList); _graphics->closeFont(_journalFont); ScreenImage._imageData = _graphics->getCurrentDrawingBuffer(); @@ -349,18 +349,18 @@ void LabEngine::drawMonText(char *text, TextFont *monitorFont, uint16 x1, uint16 fheight = _graphics->textHeight(monitorFont); x1 = _monitorButton->_width + _utils->vgaScaleX(3); - _monitorGadgetHeight = _monitorButton->_height + _utils->vgaScaleY(3); + _monitorButtonHeight = _monitorButton->_height + _utils->vgaScaleY(3); - if (_monitorGadgetHeight > fheight) - yspacing = _monitorGadgetHeight - fheight; + if (_monitorButtonHeight > fheight) + yspacing = _monitorButtonHeight - fheight; else - _monitorGadgetHeight = fheight; + _monitorButtonHeight = fheight; _graphics->setAPen(0); _graphics->rectFill(0, 0, _graphics->_screenWidth - 1, y2); for (uint16 i = 0; i < numlines; i++) - _monitorButton->drawImage(0, i * _monitorGadgetHeight); + _monitorButton->drawImage(0, i * _monitorButtonHeight); } else if (isinteractive) { _graphics->setAPen(0); _graphics->rectFill(0, 0, _graphics->_screenWidth - 1, y2); @@ -468,7 +468,7 @@ void LabEngine::processMonitor(char *ntext, TextFont *monitorFont, bool isIntera } } else if (isInteractive) { CloseDataPtr tmpClosePtr = _closeDataPtr; - mouseY = 64 + (mouseY / _monitorGadgetHeight) * 42; + mouseY = 64 + (mouseY / _monitorButtonHeight) * 42; mouseX = 101; setCurrentClose(Common::Point(mouseX, mouseY), &_closeDataPtr, false); |