mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-06-18 10:28:58 +00:00
Remove initialization var, its done in steam_controller
This commit is contained in:
parent
6d486e6ea5
commit
2a9f693965
|
@ -81,8 +81,6 @@ struct GAMEPAD_STATE {
|
||||||
/* State of the gamepads */
|
/* State of the gamepads */
|
||||||
static GAMEPAD_STATE STATE[GAMEPAD_COUNT];
|
static GAMEPAD_STATE STATE[GAMEPAD_COUNT];
|
||||||
|
|
||||||
static int initialized = 0;
|
|
||||||
|
|
||||||
/* Note whether a gamepad is currently connected */
|
/* Note whether a gamepad is currently connected */
|
||||||
#define FLAG_CONNECTED (1<<0)
|
#define FLAG_CONNECTED (1<<0)
|
||||||
#define FLAG_RUMBLE (1<<1)
|
#define FLAG_RUMBLE (1<<1)
|
||||||
|
@ -523,9 +521,6 @@ static void GamepadRemoveDevice(const WCHAR* devPath) {
|
||||||
void GamepadInit(void) {
|
void GamepadInit(void) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (initialized == 0)
|
|
||||||
{
|
|
||||||
initialized = 1;
|
|
||||||
/* initialize connection state */
|
/* initialize connection state */
|
||||||
for (i = 0; i != GAMEPAD_COUNT; ++i) {
|
for (i = 0; i != GAMEPAD_COUNT; ++i) {
|
||||||
STATE[i].flags = 0;
|
STATE[i].flags = 0;
|
||||||
|
@ -534,16 +529,12 @@ void GamepadInit(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
GamepadDetect();
|
GamepadDetect();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GamepadUpdate(void) {
|
void GamepadUpdate(void) {
|
||||||
static unsigned long last = 0;
|
static unsigned long last = 0;
|
||||||
unsigned long cur = time(NULL);
|
unsigned long cur = time(NULL);
|
||||||
|
|
||||||
if (initialized == 0)
|
|
||||||
GamepadInit();
|
|
||||||
|
|
||||||
if (last + 2 < cur) {
|
if (last + 2 < cur) {
|
||||||
GamepadDetect();
|
GamepadDetect();
|
||||||
last = cur;
|
last = cur;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user