mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-29 09:35:39 +00:00
Fixed a number of potential issues where SDL_Event unions were not properly initialized
This commit is contained in:
parent
9cd35bed3d
commit
6bad84a27a
|
@ -162,7 +162,7 @@ void ViewController::migratedAppDataFilesDialog()
|
||||||
mWindow->pushGui(new GuiMsgBox(
|
mWindow->pushGui(new GuiMsgBox(
|
||||||
HelpStyle(), message.c_str(), "QUIT",
|
HelpStyle(), message.c_str(), "QUIT",
|
||||||
[] {
|
[] {
|
||||||
SDL_Event quit;
|
SDL_Event quit {};
|
||||||
quit.type = SDL_QUIT;
|
quit.type = SDL_QUIT;
|
||||||
SDL_PushEvent(&quit);
|
SDL_PushEvent(&quit);
|
||||||
},
|
},
|
||||||
|
@ -201,7 +201,7 @@ void ViewController::invalidSystemsFileDialog()
|
||||||
mWindow->pushGui(new GuiMsgBox(
|
mWindow->pushGui(new GuiMsgBox(
|
||||||
HelpStyle(), errorMessage.c_str(), "QUIT",
|
HelpStyle(), errorMessage.c_str(), "QUIT",
|
||||||
[] {
|
[] {
|
||||||
SDL_Event quit;
|
SDL_Event quit {};
|
||||||
quit.type = SDL_QUIT;
|
quit.type = SDL_QUIT;
|
||||||
SDL_PushEvent(&quit);
|
SDL_PushEvent(&quit);
|
||||||
},
|
},
|
||||||
|
@ -318,7 +318,7 @@ void ViewController::noGamesDialog()
|
||||||
},
|
},
|
||||||
"QUIT",
|
"QUIT",
|
||||||
[] {
|
[] {
|
||||||
SDL_Event quit;
|
SDL_Event quit {};
|
||||||
quit.type = SDL_QUIT;
|
quit.type = SDL_QUIT;
|
||||||
SDL_PushEvent(&quit);
|
SDL_PushEvent(&quit);
|
||||||
},
|
},
|
||||||
|
@ -1462,7 +1462,7 @@ void ViewController::rescanROMDirectory()
|
||||||
SystemData::loadConfig();
|
SystemData::loadConfig();
|
||||||
|
|
||||||
if (SystemData::sStartupExitSignal) {
|
if (SystemData::sStartupExitSignal) {
|
||||||
SDL_Event quit;
|
SDL_Event quit {};
|
||||||
quit.type = SDL_QUIT;
|
quit.type = SDL_QUIT;
|
||||||
SDL_PushEvent(&quit);
|
SDL_PushEvent(&quit);
|
||||||
return;
|
return;
|
||||||
|
@ -1477,7 +1477,7 @@ void ViewController::rescanROMDirectory()
|
||||||
else {
|
else {
|
||||||
preload();
|
preload();
|
||||||
if (SystemData::sStartupExitSignal) {
|
if (SystemData::sStartupExitSignal) {
|
||||||
SDL_Event quit;
|
SDL_Event quit {};
|
||||||
quit.type = SDL_QUIT;
|
quit.type = SDL_QUIT;
|
||||||
SDL_PushEvent(&quit);
|
SDL_PushEvent(&quit);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -48,7 +48,7 @@ static void onKeyPress(void* /*cbParam*/, const CEC::cec_keypress* key)
|
||||||
{
|
{
|
||||||
LOG(LogDebug) << "CECInput::onKeyPress keycode: " << CECInput::getKeyCodeString(key->keycode);
|
LOG(LogDebug) << "CECInput::onKeyPress keycode: " << CECInput::getKeyCodeString(key->keycode);
|
||||||
|
|
||||||
SDL_Event event;
|
SDL_Event event {};
|
||||||
event.type = (key->duration > 0) ? SDL_USER_CECBUTTONUP : SDL_USER_CECBUTTONDOWN;
|
event.type = (key->duration > 0) ? SDL_USER_CECBUTTONUP : SDL_USER_CECBUTTONDOWN;
|
||||||
event.user.code = key->keycode;
|
event.user.code = key->keycode;
|
||||||
SDL_PushEvent(&event);
|
SDL_PushEvent(&event);
|
||||||
|
|
|
@ -454,7 +454,7 @@ bool InputManager::parseEvent(const SDL_Event& event)
|
||||||
#if defined(__ANDROID__)
|
#if defined(__ANDROID__)
|
||||||
// Quit application if the back button is pressed.
|
// Quit application if the back button is pressed.
|
||||||
if (event.key.keysym.sym == SDLK_AC_BACK) {
|
if (event.key.keysym.sym == SDLK_AC_BACK) {
|
||||||
SDL_Event quit;
|
SDL_Event quit {};
|
||||||
quit.type = SDL_QUIT;
|
quit.type = SDL_QUIT;
|
||||||
SDL_PushEvent(&quit);
|
SDL_PushEvent(&quit);
|
||||||
return false;
|
return false;
|
||||||
|
@ -490,7 +490,7 @@ bool InputManager::parseEvent(const SDL_Event& event)
|
||||||
quitES = true;
|
quitES = true;
|
||||||
|
|
||||||
if (quitES) {
|
if (quitES) {
|
||||||
SDL_Event quit;
|
SDL_Event quit {};
|
||||||
quit.type = SDL_QUIT;
|
quit.type = SDL_QUIT;
|
||||||
SDL_PushEvent(&quit);
|
SDL_PushEvent(&quit);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
class InputConfig;
|
class InputConfig;
|
||||||
class Window;
|
class Window;
|
||||||
union SDL_Event;
|
|
||||||
|
|
||||||
class InputManager
|
class InputManager
|
||||||
{
|
{
|
||||||
|
|
|
@ -330,7 +330,7 @@ namespace Utils
|
||||||
{
|
{
|
||||||
sQuitMode = mode;
|
sQuitMode = mode;
|
||||||
|
|
||||||
SDL_Event quit;
|
SDL_Event quit {};
|
||||||
quit.type = SDL_QUIT;
|
quit.type = SDL_QUIT;
|
||||||
SDL_PushEvent(&quit);
|
SDL_PushEvent(&quit);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue