[mednaffe] 05/06: It does not detect more than two XInput devices: Fixed
Stephen Kitt
skitt at moszumanska.debian.org
Tue Aug 2 21:00:18 UTC 2016
This is an automated email from the git hooks/post-receive script.
skitt pushed a commit to branch upstream
in repository mednaffe.
commit 649613cc5f191f515c224546cf14c38ebad19658
Author: AmatCoder <amatcoder at gmail.com>
Date: Sun Jul 26 23:41:41 2015 +0200
It does not detect more than two XInput devices: Fixed
---
src/input.c | 59 +++++++++++++++++++++++++++---------------------------
src/joystick_win.c | 2 +-
2 files changed, 30 insertions(+), 31 deletions(-)
diff --git a/src/input.c b/src/input.c
index 91a5d63..d238d7b 100644
--- a/src/input.c
+++ b/src/input.c
@@ -753,46 +753,45 @@ void on_input_clicked (GtkButton *button, guidata *gui)
}
else
{
- gui->joy[i].sdl_id = SDL_JoystickInstanceID(gui->joy[i].sdljoy);
- gui->joy[i].name = g_strdup(SDL_JoystickName(gui->joy[i].sdljoy));
+ gui->joy[i].sdl_id = SDL_JoystickInstanceID(gui->joy[i].sdljoy);
+ gui->joy[i].name = g_strdup(SDL_JoystickName(gui->joy[i].sdljoy));
- SDL_JoystickGUID guid = SDL_JoystickGetGUID(gui->joy[i].sdljoy);
- char pszGUID[32];
- SDL_JoystickGetGUIDString(guid, (char *)pszGUID, 33);
+ SDL_JoystickGUID guid = SDL_JoystickGetGUID(gui->joy[i].sdljoy);
+ char pszGUID[32];
+ SDL_JoystickGetGUIDString(guid, (char *)pszGUID, 33);
- /*printf("GUID: %s\n", pszGUID);*/
+ /*printf("GUID: %s\n", pszGUID);*/
- /*if ((guid.data[0]=='x') &&
+ /*if ((guid.data[0]=='x') &&
(guid.data[1]=='i') &&
(guid.data[2]=='n') &&
(guid.data[3]=='p') &&
(guid.data[4]=='u') &&
(guid.data[5]=='t'))*/
- if (g_strcmp0(pszGUID, "00000000000000000000000000000000")==0)
- {
- int type, subtype;
+ if (g_strcmp0(pszGUID, "00000000000000000000000000000000")==0)
+ {
+ int type, subtype;
- type = SDL_JoystickDevType(gui->joy[i].sdljoy); // Those functions does not exits in SDL
- subtype = SDL_JoystickDevSubType(gui->joy[i].sdljoy); // I patched it to expose XINPUT_CAPABILITIES
+ type = SDL_JoystickDevType(gui->joy[i].sdljoy); // Those functions do not exist in SDL
+ subtype = SDL_JoystickDevSubType(gui->joy[i].sdljoy); // I patched it to expose XINPUT_CAPABILITIES
- if ((type > -1) &&
- (type < 2) &&
- (subtype > -1 ) &&
- (subtype < 20))
- {
- gui->joy[i].id = ((type << 24) | (subtype << 16));
- }
- else
- gui->joy[i].id = (0x00000000 << 24) | (0x00000001 << 16);
-
- gui->joy[i].xinput = TRUE;
- CheckDuplicatesXInput(i, gui);
- }
- else
- {
- GetJoy(i, gui);
- CheckDuplicates(i, gui);
- }
+ if ((type > -1) &&
+ (type < 2) &&
+ (subtype > -1 ) &&
+ (subtype < 20))
+ {
+ gui->joy[i].id = ((type << 24) | (subtype << 16));
+ }
+ else gui->joy[i].id = (0x00000000 << 24) | (0x00000001 << 16);
+
+ gui->joy[i].xinput = TRUE;
+ CheckDuplicatesXInput(i, gui);
+ }
+ else
+ {
+ GetJoy(i, gui);
+ }
+ CheckDuplicates(i, gui);
}
}
diff --git a/src/joystick_win.c b/src/joystick_win.c
index a4b016e..741787a 100644
--- a/src/joystick_win.c
+++ b/src/joystick_win.c
@@ -71,7 +71,7 @@ void CheckDuplicatesXInput(guint js, guidata *gui)
if (a==js) break;
if (gui->joy[js].id == gui->joy[a].id) {
gui->joy[js].id++;
- CheckDuplicates(js, gui);
+ CheckDuplicatesXInput(js, gui);
}
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mednaffe.git
More information about the Pkg-games-commits
mailing list