* Handle the new mouse event. */
| 75 | * Handle the new mouse event. |
| 76 | */ |
| 77 | void Mouse_EventHandler(uint16 mousePosX, uint16 mousePosY, bool mouseButtonLeft, bool mouseButtonRight) |
| 78 | { |
| 79 | uint8 newButtonState = (mouseButtonLeft ? 0x1 : 0x0) | (mouseButtonRight ? 0x2 : 0x0); |
| 80 | |
| 81 | if (g_mouseDisabled == 0) { |
| 82 | if (g_mouseMode == INPUT_MOUSE_MODE_NORMAL && (g_inputFlags & INPUT_FLAG_NO_CLICK) == 0) { |
| 83 | Input_HandleInput(Mouse_CheckButtons(newButtonState)); |
| 84 | } |
| 85 | |
| 86 | if (g_mouseMode != INPUT_MOUSE_MODE_PLAY && g_mouseLock == 0) { |
| 87 | Mouse_HandleMovement(newButtonState, mousePosX, mousePosY); |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * Set the region in which the mouse can move. |
no test coverage detected