From a5cd18fe300fa4586848a45aedf646464bb25ab4 Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Tue, 18 May 2021 20:41:33 -0400 Subject: [PATCH] Minor code cleanup for readability. --- src/drivers/Qt/fceuWrapper.cpp | 29 +++++++++++++++++++---------- src/drivers/Qt/sdl-video.cpp | 3 ++- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/drivers/Qt/fceuWrapper.cpp b/src/drivers/Qt/fceuWrapper.cpp index 4fc89ed5..6755e695 100644 --- a/src/drivers/Qt/fceuWrapper.cpp +++ b/src/drivers/Qt/fceuWrapper.cpp @@ -182,20 +182,29 @@ FCEUD_GetTimeFreq(void) static int DriverInitialize(FCEUGI *gi) { - if(InitVideo(gi) < 0) return 0; + if (InitVideo(gi) < 0) + { + return 0; + } inited|=4; - if(InitSound()) + if (InitSound()) + { inited|=1; + } - if(InitJoysticks()) + if (InitJoysticks()) + { inited|=2; + } int fourscore=0; g_config->getOption("SDL.FourScore", &fourscore); eoptions &= ~EO_FOURSCORE; - if(fourscore) + if (fourscore) + { eoptions |= EO_FOURSCORE; + } InitInputInterface(); return 1; @@ -425,12 +434,12 @@ CloseGame(void) debugSymbolTable.clear(); CDLoggerROMClosed(); - int state_to_save; - g_config->getOption("SDL.AutoSaveState", &state_to_save); - if (state_to_save < 10 && state_to_save >= 0){ - FCEUI_SelectState(state_to_save, 0); - FCEUI_SaveState(NULL, false); - } + int state_to_save; + g_config->getOption("SDL.AutoSaveState", &state_to_save); + if (state_to_save < 10 && state_to_save >= 0){ + FCEUI_SelectState(state_to_save, 0); + FCEUI_SaveState(NULL, false); + } int autoInputPreset; g_config->getOption( "SDL.AutoInputPreset", &autoInputPreset ); diff --git a/src/drivers/Qt/sdl-video.cpp b/src/drivers/Qt/sdl-video.cpp index b62bbc11..f99ae08c 100644 --- a/src/drivers/Qt/sdl-video.cpp +++ b/src/drivers/Qt/sdl-video.cpp @@ -105,8 +105,9 @@ KillVideo() // return failure if the video system was not initialized if (s_inited == 0) + { return -1; - + } // SDL Video system is not used. // shut down the SDL video sub-system