From 2f1e0d7a62ab8d318d5453c75dde23798791b354 Mon Sep 17 00:00:00 2001 From: emb <> Date: Wed, 4 Mar 2015 12:46:12 -0600 Subject: [PATCH] Fixing issue where controls are not properly configured. --- RetroFE/Source/RetroFE.cpp | 20 ++++++++++++++++++-- RetroFE/Source/RetroFE.h | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/RetroFE/Source/RetroFE.cpp b/RetroFE/Source/RetroFE.cpp index 48865f1..b15a09b 100644 --- a/RetroFE/Source/RetroFE.cpp +++ b/RetroFE/Source/RetroFE.cpp @@ -39,9 +39,11 @@ RetroFE::RetroFE(Configuration &c) : Initialized(false) + , InitializeError(false) , InitializeThread(NULL) , Config(c) , Db(NULL) + , MetaDb(NULL) , Input(Config) , CurrentPage(NULL) , KeyInputDisable(0) @@ -75,13 +77,19 @@ int RetroFE::Initialize(void *context) Logger::Write(Logger::ZONE_INFO, "RetroFE", "Initializing"); - if(!instance->Input.Initialize()) return -1; + if(!instance->Input.Initialize()) + { + Logger::Write(Logger::ZONE_ERROR, "RetroFE", "Could not initialize user controls"); + instance->InitializeError = true; + return -1; + } instance->Db = new DB(Configuration::GetAbsolutePath() + "/meta.db"); if(!instance->Db->Initialize()) { Logger::Write(Logger::ZONE_ERROR, "RetroFE", "Could not initialize database"); + instance->InitializeError = true; return -1; } @@ -90,6 +98,7 @@ int RetroFE::Initialize(void *context) if(!instance->MetaDb->Initialize()) { Logger::Write(Logger::ZONE_ERROR, "RetroFE", "Could not initialize meta database"); + instance->InitializeError = true; return -1; } @@ -243,12 +252,19 @@ void RetroFE::Run() (void)SDL_PollEvent(&e); } - if(Initialized && splashMode && CurrentPage->GetMinShowTime() <= (CurrentTime - preloadTime)) + if((Initialized || InitializeError) && splashMode && CurrentPage->GetMinShowTime() <= (CurrentTime - preloadTime)) { SDL_WaitThread(InitializeThread, &initializeStatus); + if(InitializeError) + { + state = RETROFE_QUIT_REQUEST; + break; + } + // delete the splash screen and use the standard menu delete CurrentPage; + CurrentPage = LoadPage(); splashMode = false; if(CurrentPage) diff --git a/RetroFE/Source/RetroFE.h b/RetroFE/Source/RetroFE.h index 558fa05..6aee750 100644 --- a/RetroFE/Source/RetroFE.h +++ b/RetroFE/Source/RetroFE.h @@ -44,6 +44,7 @@ public: void LaunchExit(); private: volatile bool Initialized; + volatile bool InitializeError; SDL_Thread *InitializeThread; static int Initialize(void *context);