|
@@ -722,23 +722,24 @@ Uint32
|
|
|
SDL_GetGlobalMouseState(int *x, int *y)
|
|
|
{
|
|
|
SDL_Mouse *mouse = SDL_GetMouse();
|
|
|
- int tmpx, tmpy;
|
|
|
|
|
|
- /* make sure these are never NULL for the backend implementations... */
|
|
|
- if (!x) {
|
|
|
- x = &tmpx;
|
|
|
- }
|
|
|
- if (!y) {
|
|
|
- y = &tmpy;
|
|
|
- }
|
|
|
+ if (mouse->GetGlobalMouseState) {
|
|
|
+ int tmpx, tmpy;
|
|
|
+
|
|
|
+ /* make sure these are never NULL for the backend implementations... */
|
|
|
+ if (!x) {
|
|
|
+ x = &tmpx;
|
|
|
+ }
|
|
|
+ if (!y) {
|
|
|
+ y = &tmpy;
|
|
|
+ }
|
|
|
|
|
|
- *x = *y = 0;
|
|
|
+ *x = *y = 0;
|
|
|
|
|
|
- if (!mouse->GetGlobalMouseState) {
|
|
|
- return 0;
|
|
|
+ return mouse->GetGlobalMouseState(x, y);
|
|
|
+ } else {
|
|
|
+ return SDL_GetMouseState(x, y);
|
|
|
}
|
|
|
-
|
|
|
- return mouse->GetGlobalMouseState(x, y);
|
|
|
}
|
|
|
|
|
|
void
|