mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-04 01:46:42 +00:00
LAB: Get rid of mouseButton()
This commit is contained in:
parent
09539d76ac
commit
8b16ccbea1
@ -207,31 +207,6 @@ void EventManager::setMousePos(Common::Point pos) {
|
||||
processInput();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether or not the mouse buttons have been pressed, and the last
|
||||
* 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) {
|
||||
if (_leftClick) {
|
||||
*x = (!_vm->_isHiRes) ? (uint16)_mousePos.x / 2 : (uint16)_mousePos.x;
|
||||
*y = (uint16)_mousePos.y;
|
||||
_leftClick = false;
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (_rightClick) {
|
||||
*x = (!_vm->_isHiRes) ? (uint16)_mousePos.x / 2 : (uint16)_mousePos.x;
|
||||
*y = (uint16)_mousePos.y;
|
||||
_rightClick = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether or not a key has been pressed.
|
||||
*/
|
||||
|
@ -89,7 +89,6 @@ private:
|
||||
|
||||
private:
|
||||
Button *checkButtonHit(ButtonList *buttonList, Common::Point pos);
|
||||
bool mouseButton(uint16 *x, uint16 *y, bool leftButton);
|
||||
bool keyPress(uint16 *keyCode);
|
||||
bool haveNextChar();
|
||||
uint16 getNextChar();
|
||||
|
@ -151,18 +151,14 @@ IntuiMessage *EventManager::getMsg() {
|
||||
message._buttonId = curButton->_buttonId;
|
||||
message._qualifier = qualifiers;
|
||||
return &message;
|
||||
} else if (mouseButton(&message._mouseX, &message._mouseY, true)) {
|
||||
// Left Button
|
||||
message._qualifier = IEQUALIFIER_LEFTBUTTON | qualifiers;
|
||||
message._msgClass = MOUSEBUTTONS;
|
||||
return &message;
|
||||
} else if (mouseButton(&message._mouseX, &message._mouseY, false)) {
|
||||
// Right Button
|
||||
message._qualifier = IEQUALIFIER_RIGHTBUTTON | qualifiers;
|
||||
} else if (_leftClick || _rightClick) {
|
||||
message._qualifier = (_leftClick) ? (IEQUALIFIER_LEFTBUTTON | qualifiers) : (IEQUALIFIER_RIGHTBUTTON | qualifiers);
|
||||
message._msgClass = MOUSEBUTTONS;
|
||||
message._mouseX = (!_vm->_isHiRes) ? (uint16)_mousePos.x / 2 : (uint16)_mousePos.x;
|
||||
message._mouseY = (uint16)_mousePos.y;
|
||||
_leftClick = _rightClick = false;
|
||||
return &message;
|
||||
} else if (keyPress(&message._code)) {
|
||||
// Keyboard key
|
||||
curButton = checkNumButtonHit(_screenButtonList, message._code);
|
||||
|
||||
if (curButton) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user