Make the return value of wiiuse_update match that of wiiuse_poll
This commit is contained in:
@@ -192,6 +192,7 @@ int wiiuse_poll(struct wiimote_t** wm, int wiimotes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int wiiuse_update(struct wiimote_t** wiimotes, int nwiimotes, wiiuse_update_cb callback) {
|
int wiiuse_update(struct wiimote_t** wiimotes, int nwiimotes, wiiuse_update_cb callback) {
|
||||||
|
int evnt = 0;
|
||||||
if (wiiuse_poll(wiimotes, nwiimotes)) {
|
if (wiiuse_poll(wiimotes, nwiimotes)) {
|
||||||
static struct WiimoteState_t s;
|
static struct WiimoteState_t s;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -215,12 +216,12 @@ int wiiuse_update(struct wiimote_t** wiimotes, int nwiimotes, wiiuse_update_cb c
|
|||||||
s.state = wiimotes[i]->state;
|
s.state = wiimotes[i]->state;
|
||||||
s.expansion = wiimotes[i]->exp;
|
s.expansion = wiimotes[i]->exp;
|
||||||
callback( &s );
|
callback( &s );
|
||||||
|
evnt++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return evnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -784,6 +784,8 @@ WIIUSE_EXPORT extern int wiiuse_poll(struct wiimote_t** wm, int wiimotes);
|
|||||||
*
|
*
|
||||||
* Alternative to calling wiiuse_poll yourself, and provides the same
|
* Alternative to calling wiiuse_poll yourself, and provides the same
|
||||||
* information struct on all platforms.
|
* information struct on all platforms.
|
||||||
|
*
|
||||||
|
* @return Number of wiimotes that had an event.
|
||||||
*/
|
*/
|
||||||
WIIUSE_EXPORT extern int wiiuse_update(struct wiimote_t** wm, int wiimotes, wiiuse_update_cb callback);
|
WIIUSE_EXPORT extern int wiiuse_update(struct wiimote_t** wm, int wiimotes, wiiuse_update_cb callback);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user