- [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() {
|
void initGamePad() {
|
||||||
const int num_joysticks = SDL_NumJoysticks();
|
const int num_joysticks = SDL_NumJoysticks();
|
||||||
if (num_joysticks==0) return;
|
if (num_joysticks>=1) {
|
||||||
int gamepad_num=-1;
|
for (int i=0; i<num_joysticks; ++i) {
|
||||||
for (int i=0; i<num_joysticks; ++i) {
|
if (SDL_IsGameController(i)) {
|
||||||
if (SDL_IsGameController(i)) {
|
gamepad = SDL_GameControllerOpen(i);
|
||||||
gamepad = SDL_GameControllerOpen(i);
|
if (SDL_GameControllerGetAttached(gamepad) == SDL_TRUE) {
|
||||||
if (SDL_GameControllerGetAttached(gamepad) == SDL_TRUE) {
|
SDL_GameControllerEventState(SDL_ENABLE);
|
||||||
SDL_GameControllerEventState(SDL_ENABLE);
|
return;
|
||||||
return;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user