- [FIX] Removed unused variable, minor readjustment of code to avoid errors.
This commit is contained in:
18
mini.cpp
18
mini.cpp
@@ -211,16 +211,16 @@ void destroyDisplay() {
|
||||
|
||||
void initGamePad() {
|
||||
const int num_joysticks = SDL_NumJoysticks();
|
||||
if (num_joysticks==0) return;
|
||||
int gamepad_num=-1;
|
||||
for (int i=0; i<num_joysticks; ++i) {
|
||||
if (SDL_IsGameController(i)) {
|
||||
gamepad = SDL_GameControllerOpen(i);
|
||||
if (SDL_GameControllerGetAttached(gamepad) == SDL_TRUE) {
|
||||
SDL_GameControllerEventState(SDL_ENABLE);
|
||||
return;
|
||||
if (num_joysticks>=1) {
|
||||
for (int i=0; i<num_joysticks; ++i) {
|
||||
if (SDL_IsGameController(i)) {
|
||||
gamepad = SDL_GameControllerOpen(i);
|
||||
if (SDL_GameControllerGetAttached(gamepad) == SDL_TRUE) {
|
||||
SDL_GameControllerEventState(SDL_ENABLE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user