From 60e49ea83f6e3ae12ea7dfcc1b6c184182f6026b Mon Sep 17 00:00:00 2001 From: Maschell Date: Wed, 4 Apr 2018 15:36:57 +0200 Subject: [PATCH] [Loader] Added serveral minor clean ups. --- loader/Makefile | 2 +- loader/src/Application.cpp | 11 +++++++---- loader/src/plugin/PluginLoader.cpp | 4 ++-- loader/src/plugin/PluginLoader.h | 2 +- loader/src/settings/CSettings.cpp | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/loader/Makefile b/loader/Makefile index 2bc23e2..52a6332 100644 --- a/loader/Makefile +++ b/loader/Makefile @@ -55,7 +55,7 @@ INCLUDES := src/libelf \ # options for code generation #--------------------------------------------------------------------------------- CFLAGS := -std=gnu11 -mrvl -mcpu=750 -meabi -mhard-float -ffast-math \ - -O0 -D__wiiu__ -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing $(INCLUDE) + -O0 -D__wiiu__ -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing -D_GNU_SOURCE $(INCLUDE) CXXFLAGS := -std=gnu++11 -mrvl -mcpu=750 -meabi -mhard-float -ffast-math \ -O0 -D__wiiu__ -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing -D_GNU_SOURCE $(INCLUDE) diff --git a/loader/src/Application.cpp b/loader/src/Application.cpp index a690e06..1eb0c0d 100644 --- a/loader/src/Application.cpp +++ b/loader/src/Application.cpp @@ -68,6 +68,7 @@ Application::~Application() { DEBUG_FUNCTION_LINE("Triggering AsyncDeleter\n"); AsyncDeleter::triggerDeleteProcess(); while(!AsyncDeleter::realListEmpty()) { + DEBUG_FUNCTION_LINE("Waiting...\n"); os_usleep(1000); } } while(!AsyncDeleter::deleteListEmpty()); @@ -78,7 +79,6 @@ Application::~Application() { DEBUG_FUNCTION_LINE("Stop sound handler\n"); SoundHandler::DestroyInstance(); - } s32 Application::exec() { @@ -159,6 +159,7 @@ void Application::executeThread(void) { bgMusic->Stop(); //CHANG MEEEEEEEEEEEEEEEEEEE } + while(reloadUIflag) { reloadUIflag = false; exitCode = EXIT_RELAUNCH_ON_LOAD; @@ -167,11 +168,12 @@ void Application::executeThread(void) { DEBUG_FUNCTION_LINE("Initialize main window\n"); mainWindow = MainWindow::getInstance(video->getTvWidth(), video->getTvHeight()); - DEBUG_FUNCTION_LINE("Entering main loop\n"); exitApplication = false; //! main GX2 loop (60 Hz cycle with max priority on core 1) + DEBUG_FUNCTION_LINE("Starting TcpReceiver\n"); TcpReceiver pluginReceiver(4299); + DEBUG_FUNCTION_LINE("Entering main loop\n"); while(!exitApplication && !reloadUIflag) { //! Read out inputs for(s32 i = 0; i < 5; i++) { @@ -209,6 +211,7 @@ void Application::executeThread(void) { video->drcEnable(true); } + //! as last point update the effects as it can drop elements mainWindow->updateEffects(); @@ -219,9 +222,9 @@ void Application::executeThread(void) { //! and avoid blocking the GUI thread AsyncDeleter::triggerDeleteProcess(); } - DEBUG_FUNCTION_LINE("fadeOut\n"); + DEBUG_FUNCTION_LINE("Fading out\n"); fadeOut(); - DEBUG_FUNCTION_LINE("MainWindow::destroyInstance();\n"); + DEBUG_FUNCTION_LINE("Destroying the MainWindow\n"); MainWindow::destroyInstance(); } DEBUG_FUNCTION_LINE("Delete fontSystem\n"); diff --git a/loader/src/plugin/PluginLoader.cpp b/loader/src/plugin/PluginLoader.cpp index 6efa45b..54c19b5 100644 --- a/loader/src/plugin/PluginLoader.cpp +++ b/loader/src/plugin/PluginLoader.cpp @@ -42,12 +42,12 @@ std::vector PluginLoader::getPluginInformation(const char * DIR *dfd = NULL; if(path == NULL) { - DEBUG_FUNCTION_LINE("Path was NULL"); + DEBUG_FUNCTION_LINE("Path was NULL\n"); return result; } if ((dfd = opendir(path)) == NULL) { - DEBUG_FUNCTION_LINE("Couldn't open dir %s",path); + DEBUG_FUNCTION_LINE("Couldn't open dir %s\n",path); return result; } diff --git a/loader/src/plugin/PluginLoader.h b/loader/src/plugin/PluginLoader.h index 7bf7687..8bbf42b 100644 --- a/loader/src/plugin/PluginLoader.h +++ b/loader/src/plugin/PluginLoader.h @@ -49,7 +49,7 @@ class PluginLoader { public: static PluginLoader *getInstance() { if(!instance) { - instance = new PluginLoader((void*)getApplicationEndAddr(),(void *)PLUGIN_LOCATION_END_ADDRESS); + instance = new PluginLoader((void*)getApplicationEndAddr(),(void *)PLUGIN_LOCATION_END_ADDRESS); } return instance; } diff --git a/loader/src/settings/CSettings.cpp b/loader/src/settings/CSettings.cpp index fcde966..ece60f9 100644 --- a/loader/src/settings/CSettings.cpp +++ b/loader/src/settings/CSettings.cpp @@ -71,7 +71,7 @@ bool CSettings::Load() { std::string filepath = configPath; filepath += CONFIG_FILENAME; - log_printf("CSettings::Load(line %d): Loading Configuration from %s\n",__LINE__,filepath.c_str()); + DEBUG_FUNCTION_LINE("Loading Configuration from %s\n",filepath.c_str()); CFile file(filepath, CFile::ReadOnly); if (!file.isOpen())