MCPcopy Create free account
hub / github.com/OpenDUNE/OpenDUNE / GUI_Mouse_SetPosition

Function GUI_Mouse_SetPosition

src/gui/gui.c:4140–4161  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

4138 * @param y The new Y-position of the mouse.
4139 */
4140void 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.

Callers 1

GUI_StrategicMap_ShowFunction · 0.85

Calls 3

GUI_Mouse_HideFunction · 0.85
GUI_Mouse_ShowFunction · 0.85
Video_Mouse_SetPositionFunction · 0.50

Tested by

no test coverage detected