mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-06 13:16:52 +02:00
[SDL2] Add missing SDL_QUIT event management and small bracket correction. (#499)
This commit is contained in:
committed by
GitHub
parent
28ee7ac923
commit
46a753bbee
@@ -345,6 +345,9 @@ void inputUpdate() {
|
|||||||
|
|
||||||
while (SDL_PollEvent(&event) == 1) { // while there are still events to be processed
|
while (SDL_PollEvent(&event) == 1) { // while there are still events to be processed
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
|
case SDL_QUIT:
|
||||||
|
Core::isQuit = true;
|
||||||
|
|
||||||
case SDL_KEYDOWN: {
|
case SDL_KEYDOWN: {
|
||||||
int scancode = event.key.keysym.scancode;
|
int scancode = event.key.keysym.scancode;
|
||||||
InputKey key = codeToInputKey(scancode);
|
InputKey key = codeToInputKey(scancode);
|
||||||
@@ -417,6 +420,7 @@ void inputUpdate() {
|
|||||||
case SDL_CONTROLLERDEVICEREMOVED: {
|
case SDL_CONTROLLERDEVICEREMOVED: {
|
||||||
joyRemove(event.cdevice.which);
|
joyRemove(event.cdevice.which);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Joystick reading using the old SDL Joystick interface
|
// Joystick reading using the old SDL Joystick interface
|
||||||
case SDL_JOYBUTTONDOWN:
|
case SDL_JOYBUTTONDOWN:
|
||||||
@@ -475,7 +479,6 @@ void inputUpdate() {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user