diff options
author | Strangerke | 2015-12-13 20:15:24 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2015-12-23 21:34:03 +0100 |
commit | 2b91bf2f34c3e0ec4e83fa478f1e426d36719cb7 (patch) | |
tree | e6e154e3975f3575d9279ac7f566e6fa9399e8b8 /engines/lab | |
parent | 99e09b2ca2615d9f5bbb682eb17920c8205af405 (diff) | |
download | scummvm-rg350-2b91bf2f34c3e0ec4e83fa478f1e426d36719cb7.tar.gz scummvm-rg350-2b91bf2f34c3e0ec4e83fa478f1e426d36719cb7.tar.bz2 scummvm-rg350-2b91bf2f34c3e0ec4e83fa478f1e426d36719cb7.zip |
LAB: Some renaming in EventMan
Diffstat (limited to 'engines/lab')
-rw-r--r-- | engines/lab/engine.cpp | 2 | ||||
-rw-r--r-- | engines/lab/eventman.cpp | 26 | ||||
-rw-r--r-- | engines/lab/eventman.h | 12 | ||||
-rw-r--r-- | engines/lab/interface.cpp | 24 |
4 files changed, 32 insertions, 32 deletions
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index 3d71d94b8b..80ee0bf915 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -147,7 +147,7 @@ void LabEngine::perFlipButton(uint16 buttonId) { if (!_alternate) { _event->mouseHide(); - topButton->_image->drawImage(topButton->x, topButton->y); + topButton->_image->drawImage(topButton->_x, topButton->_y); _event->mouseShow(); } diff --git a/engines/lab/eventman.cpp b/engines/lab/eventman.cpp index 63ca63a7b4..ab33e75654 100644 --- a/engines/lab/eventman.cpp +++ b/engines/lab/eventman.cpp @@ -66,21 +66,21 @@ static const byte mouseData[] = { 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); + Common::Rect buttonRect(button->_x, button->_y, button->_x + button->_image->_width - 1, button->_y + button->_image->_height - 1); - if (buttonRect.contains(pos) && button->isEnabled) { + if (buttonRect.contains(pos) && button->_isEnabled) { if (_vm->_isHiRes) { _hitButton = button; } else { mouseHide(); - button->_altImage->drawImage(button->x, button->y); + button->_altImage->drawImage(button->_x, button->_y); mouseShow(); for (uint16 i = 0; i < 3; i++) _vm->waitTOF(); mouseHide(); - button->_image->drawImage(button->x, button->y); + button->_image->drawImage(button->_x, button->_y); mouseShow(); } @@ -152,14 +152,14 @@ void EventManager::updateMouse() { if (_hitButton) { mouseHide(); - _hitButton->_altImage->drawImage(_hitButton->x, _hitButton->y); + _hitButton->_altImage->drawImage(_hitButton->_x, _hitButton->_y); mouseShow(); for (uint16 i = 0; i < 3; i++) _vm->waitTOF(); mouseHide(); - _hitButton->_image->drawImage(_hitButton->x, _hitButton->y); + _hitButton->_image->drawImage(_hitButton->_x, _hitButton->_y); mouseShow(); doUpdateDisplay = true; _hitButton = nullptr; @@ -231,8 +231,8 @@ void EventManager::setMousePos(Common::Point pos) { * co-ordinates of the button press. leftbutton tells whether to check the * left or right button. */ -bool EventManager::mouseButton(uint16 *x, uint16 *y, bool leftbutton) { - if (leftbutton) { +bool EventManager::mouseButton(uint16 *x, uint16 *y, bool leftButton) { + if (leftButton) { if (_leftClick) { *x = (!_vm->_isHiRes) ? (uint16)_mousePos.x / 2 : (uint16)_mousePos.x; *y = (uint16)_mousePos.y; @@ -275,7 +275,7 @@ bool EventManager::haveNextChar() { return _nextKeyIn != _nextKeyOut; } -void EventManager::processInput(bool can_delay) { +void EventManager::processInput(bool canDelay) { Common::Event event; if (1) { //!g_IgnoreProcessInput @@ -358,21 +358,21 @@ void EventManager::processInput(bool can_delay) { } } - if (can_delay) + if (canDelay) g_system->delayMillis(10); } uint16 EventManager::getNextChar() { - uint16 c = 0; + uint16 chr = 0; processInput(); if (_nextKeyIn != _nextKeyOut) { - c = _keyBuf[_nextKeyOut]; + chr = _keyBuf[_nextKeyOut]; _nextKeyOut = ((((unsigned int)((_nextKeyOut + 1) >> 31) >> 26) + (byte)_nextKeyOut + 1) & 0x3F) - ((unsigned int)((_nextKeyOut + 1) >> 31) >> 26); } - return c; + return chr; } Common::Point EventManager::updateAndGetMousePos() { diff --git a/engines/lab/eventman.h b/engines/lab/eventman.h index 669866d8fa..acfccb21de 100644 --- a/engines/lab/eventman.h +++ b/engines/lab/eventman.h @@ -61,9 +61,9 @@ struct IntuiMessage { struct Button { - uint16 x, y, _buttonID; + uint16 _x, _y, _buttonID; uint16 _keyEquiv; // if not zero, a key that activates button - bool isEnabled; + bool _isEnabled; Image *_image, *_altImage; }; @@ -103,10 +103,10 @@ public: EventManager (LabEngine *vm); void attachButtonList(ButtonList *buttonList); - Button *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *im, Image *imalt); - void disableButton(Button *curgad, uint16 pencolor); + Button *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *image, Image *altImage); + void disableButton(Button *button, uint16 penColor); void drawButtonList(ButtonList *buttonList); - void enableButton(Button *curgad); + void enableButton(Button *button); void freeButtonList(ButtonList *buttonList); Button *getButton(uint16 id); Common::Point getMousePos(); @@ -114,7 +114,7 @@ public: void initMouse(); void mouseShow(); void mouseHide(); - void processInput(bool can_delay = false); + void processInput(bool canDelay = false); void setMousePos(Common::Point pos); void updateMouse(); Common::Point updateAndGetMousePos(); diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp index acc5a8a3cc..f4901880e6 100644 --- a/engines/lab/interface.cpp +++ b/engines/lab/interface.cpp @@ -43,13 +43,13 @@ Button *EventManager::createButton(uint16 x, uint16 y, uint16 id, uint16 key, Im Button *button = new Button(); if (button) { - button->x = _vm->_utils->vgaScaleX(x); - button->y = y; + button->_x = _vm->_utils->vgaScaleX(x); + button->_y = y; button->_buttonID = id; button->_keyEquiv = key; button->_image = image; button->_altImage = altImage; - button->isEnabled = true; + button->_isEnabled = true; return button; } else @@ -72,9 +72,9 @@ void EventManager::freeButtonList(ButtonList *buttonList) { */ void EventManager::drawButtonList(ButtonList *buttonList) { for (ButtonList::iterator button = buttonList->begin(); button != buttonList->end(); ++button) { - (*button)->_image->drawImage((*button)->x, (*button)->y); + (*button)->_image->drawImage((*button)->_x, (*button)->_y); - if (!(*button)->isEnabled) + if (!(*button)->_isEnabled) disableButton((*button), 1); } } @@ -83,16 +83,16 @@ void EventManager::drawButtonList(ButtonList *buttonList) { * Dims a button, and makes it unavailable for using. */ 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; + _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 button, and makes it available again. */ void EventManager::enableButton(Button *button) { - button->_image->drawImage(button->x, button->y); - button->isEnabled = true; + button->_image->drawImage(button->_x, button->_y); + button->_isEnabled = true; } /** @@ -119,13 +119,13 @@ Button *EventManager::checkNumButtonHit(ButtonList *buttonList, uint16 key) { Button *button = *buttonItr; if ((gkey - 1 == button->_buttonID || (gkey == 0 && button->_buttonID == 9) || (button->_keyEquiv != 0 && makeButtonKeyEquiv(key) == button->_keyEquiv)) - && button->isEnabled) { + && button->_isEnabled) { mouseHide(); - button->_altImage->drawImage(button->x, button->y); + button->_altImage->drawImage(button->_x, button->_y); mouseShow(); g_system->delayMillis(80); mouseHide(); - button->_image->drawImage(button->x, button->y); + button->_image->drawImage(button->_x, button->_y); mouseShow(); return button; |