move some platform-specific code out of the main wiiuse source

Initializing and cleaning up platform-specific fields in the wiimote
structure is now done in a separate routine.
This commit is contained in:
Ryan Pavlik
2011-09-07 10:26:43 -05:00
parent da52f94619
commit 7e295eb944
4 changed files with 28 additions and 20 deletions

View File

@@ -253,4 +253,16 @@ int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len) {
return 0;
}
void wiiuse_init_platform_fields(struct wiimote_t* wm) {
wm->dev_handle = 0;
wm->stack = WIIUSE_STACK_UNKNOWN;
wm->normal_timeout = WIIMOTE_DEFAULT_TIMEOUT;
wm->exp_timeout = WIIMOTE_EXP_TIMEOUT;
wm->timeout = wm->normal_timeout;
}
void wiiuse_cleanup_platform_fields(struct wiimote_t* wm) {
wm->dev_handle = 0;
}
#endif /* ifdef WIIUSE_WIN32 */