From 7d72d0e2ffa83ab67bf28d852650e9758b3b82fa Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 6 Apr 2017 12:50:27 +0200 Subject: [PATCH] Now the lib tries to mount the SD Card on each start until it actually works This should fix the config reading problems some people have. Also fixing some compiler warnings --- src/controller_patcher | 2 +- src/main.cpp | 4 ++-- src/main.h | 2 +- src/menu/drc/MenuListDRC.cpp | 4 ++-- src/menu/drc/content/ContentHelp.cpp | 4 ++-- src/menu/drc/content/ContentNetworkHelp.cpp | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/controller_patcher b/src/controller_patcher index 7292edb..5a3aa0d 160000 --- a/src/controller_patcher +++ b/src/controller_patcher @@ -1 +1 @@ -Subproject commit 7292edb8cee47f25210eb3ad1df6224938fc90d8 +Subproject commit 5a3aa0d0aab1d1729f46f01c5b53f72a4a2dbd92 diff --git a/src/main.cpp b/src/main.cpp index e244163..2452e43 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -59,7 +59,7 @@ extern "C" int Menu_Main(void){ log_print("Initializing the controller data\n"); bool res = ControllerPatcher::Init(); if(!res){ - SplashScreen(5, "Error. The app starts in 5 seconds without patches."); + SplashScreen(5, std::string("Error. The app starts in 5 seconds without patches.").c_str()); RestorePatches(); return EXIT_RELAUNCH_ON_LOAD; } @@ -138,7 +138,7 @@ int isInMiiMakerHBL(){ } -void SplashScreen(int time,char * message){ +void SplashScreen(int time,const char * message){ // Prepare screen int screen_buf0_size = 0; diff --git a/src/main.h b/src/main.h index 41b0e33..c029145 100644 --- a/src/main.h +++ b/src/main.h @@ -16,7 +16,7 @@ void ApplyPatches(void); void RestorePatches(void); int isInMiiMakerHBL(); -void SplashScreen(int time,char * message); +void SplashScreen(int time,const char * message); #ifdef __cplusplus } #endif diff --git a/src/menu/drc/MenuListDRC.cpp b/src/menu/drc/MenuListDRC.cpp index c12ea6c..dd6f79d 100644 --- a/src/menu/drc/MenuListDRC.cpp +++ b/src/menu/drc/MenuListDRC.cpp @@ -158,7 +158,7 @@ void MenuListDRC::addToTotalOffset(f32 added_offset){ void MenuListDRC::update(GuiController * c){ if(dpad_selection_changed && (lastSelectedItem != selectedItem)){ lastSelectedItem = selectedItem; - if(selectedItem >= 0 && selectedItem < listElementsButtons.size()){ + if(selectedItem >= 0 && (u32) selectedItem < listElementsButtons.size()){ int i = 0; MenuElement * element = NULL; for (std::vector::iterator it = listElementsButtons.begin() ; it != listElementsButtons.end(); ++it){ @@ -185,7 +185,7 @@ void MenuListDRC::update(GuiController * c){ addToTotalOffset(-1*(offset)); scroll_needs_update = true; }else if(-1*(element->getOffsetY() - element->getHeight()) > this->getHeight()){ - if(i+1 < listElementsButtons.size()){ + if(i >=0 && (u32)i+1 < listElementsButtons.size()){ MenuElement * nextElement = listElementsButtons[i+1]; if(nextElement != NULL){ addToTotalOffset(-1*(nextElement->getOffsetY()) - this->getHeight()); diff --git a/src/menu/drc/content/ContentHelp.cpp b/src/menu/drc/content/ContentHelp.cpp index f52e262..43f6677 100644 --- a/src/menu/drc/content/ContentHelp.cpp +++ b/src/menu/drc/content/ContentHelp.cpp @@ -29,8 +29,8 @@ ContentHelp::ContentHelp(): ContentTemplate(){ f32 positionY = 200.0f; f32 positionX = 40.0f; - f32 positionX2 = 250.0f; - f32 positionX3 = 80.0f; + //f32 positionX2 = 250.0f; + //f32 positionX3 = 80.0f; int fontSize = 35; int fontSize2 = 24; diff --git a/src/menu/drc/content/ContentNetworkHelp.cpp b/src/menu/drc/content/ContentNetworkHelp.cpp index 15864f0..37dc327 100644 --- a/src/menu/drc/content/ContentNetworkHelp.cpp +++ b/src/menu/drc/content/ContentNetworkHelp.cpp @@ -29,8 +29,8 @@ ContentNetworkHelp::ContentNetworkHelp(): ContentTemplate(){ f32 positionY = 200.0f; f32 positionX = 40.0f; - f32 positionX2 = 250.0f; - f32 positionX3 = 80.0f; + //f32 positionX2 = 250.0f; + //f32 positionX3 = 80.0f; int fontSize = 35; int fontSize2 = 24;