Commit 0aca8112 authored by Sam Lantinga's avatar Sam Lantinga

Fixed compile errors introduced during the merge refactoring

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403157
parent 6b4db38d
...@@ -76,13 +76,13 @@ SDL_SetMouseIndexId(int id, int index) ...@@ -76,13 +76,13 @@ SDL_SetMouseIndexId(int id, int index)
return 1; return 1;
} }
SDL_Mouse * int
SDL_GetMouseByID(int id) SDL_GetMouseIndexId(int id)
{ {
if (id < 0 || id > SDL_highestId) { if (id < 0 || id > SDL_highestId) {
return NULL; return -1;
} }
return SDL_GetMouse(SDL_IdIndex[id]); return SDL_IdIndex[id];
} }
int int
...@@ -321,16 +321,15 @@ SDL_GetRelativeMouseState(int index, int *x, int *y) ...@@ -321,16 +321,15 @@ SDL_GetRelativeMouseState(int index, int *x, int *y)
void void
SDL_SetMouseFocus(int id, SDL_WindowID windowID) SDL_SetMouseFocus(int id, SDL_WindowID windowID)
{ {
SDL_Mouse *mouse = SDL_GetMouseByID(id); int index = SDL_GetMouseIndexId(id);
int i, index; SDL_Mouse *mouse = SDL_GetMouse(index);
int i;
SDL_bool focus; SDL_bool focus;
if (!mouse || (mouse->focus == windowID)) { if (!mouse || (mouse->focus == windowID)) {
return; return;
} }
index = SDL_IdIndex[id];
/* See if the current window has lost focus */ /* See if the current window has lost focus */
if (mouse->focus) { if (mouse->focus) {
focus = SDL_FALSE; focus = SDL_FALSE;
...@@ -372,7 +371,8 @@ SDL_SetMouseFocus(int id, SDL_WindowID windowID) ...@@ -372,7 +371,8 @@ SDL_SetMouseFocus(int id, SDL_WindowID windowID)
int int
SDL_SendProximity(int id, int x, int y, int type) SDL_SendProximity(int id, int x, int y, int type)
{ {
SDL_Mouse *mouse = SDL_GetMouseByID(id); int index = SDL_GetMouseIndexId(id);
SDL_Mouse *mouse = SDL_GetMouse(index);
int posted = 0; int posted = 0;
last_x = x; last_x = x;
last_y = y; last_y = y;
...@@ -396,7 +396,8 @@ SDL_SendProximity(int id, int x, int y, int type) ...@@ -396,7 +396,8 @@ SDL_SendProximity(int id, int x, int y, int type)
int int
SDL_SendMouseMotion(int id, int relative, int x, int y, int pressure) SDL_SendMouseMotion(int id, int relative, int x, int y, int pressure)
{ {
SDL_Mouse *mouse = SDL_GetMouseByID(id); int index = SDL_GetMouseIndexId(id);
SDL_Mouse *mouse = SDL_GetMouse(index);
int posted; int posted;
int xrel; int xrel;
int yrel; int yrel;
...@@ -491,7 +492,8 @@ SDL_SendMouseMotion(int id, int relative, int x, int y, int pressure) ...@@ -491,7 +492,8 @@ SDL_SendMouseMotion(int id, int relative, int x, int y, int pressure)
int int
SDL_SendMouseButton(int id, Uint8 state, Uint8 button) SDL_SendMouseButton(int id, Uint8 state, Uint8 button)
{ {
SDL_Mouse *mouse = SDL_GetMouseByID(id); int index = SDL_GetMouseIndexId(id);
SDL_Mouse *mouse = SDL_GetMouse(index);
int posted; int posted;
Uint8 type; Uint8 type;
...@@ -777,7 +779,8 @@ SDL_UpdateCoordinates(int x, int y) ...@@ -777,7 +779,8 @@ SDL_UpdateCoordinates(int x, int y)
void void
SDL_ChangeEnd(int id, int end) SDL_ChangeEnd(int id, int end)
{ {
SDL_Mouse *mouse = SDL_GetMouseByID(id); int index = SDL_GetMouseIndexId(id);
SDL_Mouse *mouse = SDL_GetMouse(index);
if (mouse) { if (mouse) {
mouse->current_end = end; mouse->current_end = end;
......
...@@ -88,14 +88,14 @@ struct SDL_Mouse ...@@ -88,14 +88,14 @@ struct SDL_Mouse
/* Initialize the mouse subsystem */ /* Initialize the mouse subsystem */
extern int SDL_MouseInit(void); extern int SDL_MouseInit(void);
/* Get the mouse at an index */
extern SDL_Mouse *SDL_GetMouse(int index);
/* Assign an id to a mouse at an index */ /* Assign an id to a mouse at an index */
extern int SDL_SetMouseIndexId(int id, int index); extern int SDL_SetMouseIndexId(int id, int index);
/* Get the mouse by id */ /* Get the index of a mouse specified by id */
extern SDL_Mouse *SDL_GetMouseByID(int id); extern int SDL_GetMouseIndexId(int id);
/* Get the mouse at an index */
extern SDL_Mouse *SDL_GetMouse(int index);
/* Add a mouse, possibly reattaching at a particular index (or -1), /* Add a mouse, possibly reattaching at a particular index (or -1),
returning the index of the mouse, or -1 if there was an error. returning the index of the mouse, or -1 if there was an error.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment