* Set the mouse to the given position on the screen. * * @param x The new X-position of the mouse. * @param y The new Y-position of the mouse. */
| 4138 | * @param y The new Y-position of the mouse. |
| 4139 | */ |
| 4140 | void GUI_Mouse_SetPosition(uint16 x, uint16 y) |
| 4141 | { |
| 4142 | while (g_mouseLock != 0) sleepIdle(); |
| 4143 | g_mouseLock++; |
| 4144 | |
| 4145 | if (x < g_mouseRegionLeft) x = g_mouseRegionLeft; |
| 4146 | if (x > g_mouseRegionRight) x = g_mouseRegionRight; |
| 4147 | if (y < g_mouseRegionTop) y = g_mouseRegionTop; |
| 4148 | if (y > g_mouseRegionBottom) y = g_mouseRegionBottom; |
| 4149 | |
| 4150 | g_mouseX = x; |
| 4151 | g_mouseY = y; |
| 4152 | |
| 4153 | Video_Mouse_SetPosition(x, y); |
| 4154 | |
| 4155 | if (g_mouseX != g_mousePrevX || g_mouseY != g_mousePrevY) { |
| 4156 | GUI_Mouse_Hide(); |
| 4157 | GUI_Mouse_Show(); |
| 4158 | } |
| 4159 | |
| 4160 | g_mouseLock--; |
| 4161 | } |
| 4162 | |
| 4163 | /** |
| 4164 | * Remap all the colours in the region with the ones indicated by the remap palette. |
no test coverage detected