From 12ccba7427904b3704196c5b8ebcefcb75a4b01a Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Thu, 25 Jan 2018 08:51:15 +0300 Subject: [PATCH] no message --- src/main.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main.c b/src/main.c index 0335c88..e33a7b2 100644 --- a/src/main.c +++ b/src/main.c @@ -519,31 +519,31 @@ static void pollEvent() // case SDL_KEYDOWN: // if(processShortcuts(&event.key)) return NULL; // break; -// case SDL_JOYDEVICEADDED: -// { -// s32 id = event.jdevice.which; + case SDL_JOYDEVICEADDED: + { + s32 id = event.jdevice.which; -// if (id < TIC_GAMEPADS) -// { -// if(platform.joysticks[id]) -// SDL_JoystickClose(platform.joysticks[id]); + if (id < TIC_GAMEPADS) + { + if(platform.joysticks[id]) + SDL_JoystickClose(platform.joysticks[id]); -// platform.joysticks[id] = SDL_JoystickOpen(id); -// } -// } -// break; + platform.joysticks[id] = SDL_JoystickOpen(id); + } + } + break; -// case SDL_JOYDEVICEREMOVED: -// { -// s32 id = event.jdevice.which; + case SDL_JOYDEVICEREMOVED: + { + s32 id = event.jdevice.which; -// if (id < TIC_GAMEPADS && platform.joysticks[id]) -// { -// SDL_JoystickClose(platform.joysticks[id]); -// platform.joysticks[id] = NULL; -// } -// } -// break; + if (id < TIC_GAMEPADS && platform.joysticks[id]) + { + SDL_JoystickClose(platform.joysticks[id]); + platform.joysticks[id] = NULL; + } + } + break; case SDL_WINDOWEVENT: switch(event.window.event) {