From 273fb7c94145bcff4167b86f1a868f9ec0cb25ed Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Wed, 4 Sep 2013 10:51:14 +0200 Subject: [PATCH] Warning fixes, make the back button exit the emu on the main screen on Android. --- UI/ControlMappingScreen.h | 4 ++-- UI/CwCheatScreen.cpp | 19 +++++++++---------- UI/MainScreen.h | 2 ++ UI/NativeApp.cpp | 10 +++++++++- android/jni/Android.mk | 22 +++++++++++----------- native | 2 +- 6 files changed, 34 insertions(+), 25 deletions(-) diff --git a/UI/ControlMappingScreen.h b/UI/ControlMappingScreen.h index 2a5782d91f..a0815ecb4d 100644 --- a/UI/ControlMappingScreen.h +++ b/UI/ControlMappingScreen.h @@ -45,8 +45,8 @@ public: protected: void CreatePopupContents(UI::ViewGroup *parent); - virtual bool FillVertical() { return false; } - virtual bool ShowButtons() { return true; } + virtual bool FillVertical() const { return false; } + virtual bool ShowButtons() const { return true; } virtual void OnCompleted(DialogResult result) {} private: diff --git a/UI/CwCheatScreen.cpp b/UI/CwCheatScreen.cpp index 62ce1ed07e..d0a7dd97c5 100644 --- a/UI/CwCheatScreen.cpp +++ b/UI/CwCheatScreen.cpp @@ -98,7 +98,7 @@ UI::EventReturn CwCheatScreen::OnBack(UI::EventParams ¶ms) os.open(activeCheatFile.c_str()); for (int j = 0; j < (int)cheatList.size(); j++) { os << cheatList[j]; - if (j < cheatList.size() - 1) { + if (j < (int)cheatList.size() - 1) { os << "\n"; } } @@ -112,23 +112,20 @@ UI::EventReturn CwCheatScreen::OnEnableAll(UI::EventParams ¶ms) std::vector temp = cheatList; enableAll = !enableAll; os.open(activeCheatFile.c_str()); - for (int j = 0; j < cheatList.size(); j++) { + for (int j = 0; j < (int)cheatList.size(); j++) { if (enableAll == 1 && cheatList[j].substr(0, 3) == "_C0"){ cheatList[j].replace(0, 3, "_C1"); - } else if (enableAll == 0 && cheatList[j].substr(0, 3) == "_C1") { cheatList[j].replace(0, 3, "_C0"); - - } } for (int y = 0; y < 128; y++) { - enableCheat[y] = enableAll; - } - for (int i = 0; i < cheatList.size(); i++) { + enableCheat[y] = enableAll; + } + for (int i = 0; i < (int)cheatList.size(); i++) { os << cheatList[i]; - if (i < cheatList.size() - 1) { + if (i < (int)cheatList.size() - 1) { os << "\n"; } } @@ -136,12 +133,14 @@ UI::EventReturn CwCheatScreen::OnEnableAll(UI::EventParams ¶ms) return UI::EVENT_DONE; } + UI::EventReturn CwCheatScreen::OnAddCheat(UI::EventParams ¶ms) { screenManager()->finishDialog(this, DR_OK); g_Config.bReloadCheats = true; return UI::EVENT_DONE; } + UI::EventReturn CwCheatScreen::OnImportCheat(UI::EventParams ¶ms) { std::string line; @@ -207,7 +206,7 @@ UI::EventReturn CwCheatScreen::OnImportCheat(UI::EventParams ¶ms) } for (int i = 0; i < (int)newList.size(); i++) { os << newList[i]; - if (i < newList.size() - 1) { + if (i < (int)newList.size() - 1) { os << "\n"; } } diff --git a/UI/MainScreen.h b/UI/MainScreen.h index 2263df29e3..be9bcb5d06 100644 --- a/UI/MainScreen.h +++ b/UI/MainScreen.h @@ -30,6 +30,8 @@ class MainScreen : public UIScreenWithBackground { public: MainScreen() {} + virtual bool isTopLevel() const { return true; } + protected: virtual void CreateViews(); virtual void update(InputState &input); diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index d470759cbe..631767cee7 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -598,7 +598,15 @@ void NativeDeviceLost() { } bool NativeIsAtTopLevel() { - return false; + Screen *currentScreen = screenManager->topScreen(); + if (currentScreen) { + bool top = currentScreen->isTopLevel(); + ILOG("Screen toplevel: %i", (int)top); + return currentScreen->isTopLevel(); + } else { + ELOG("No current screen"); + return false; + } } void NativeTouch(const TouchInput &touch) { diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 57db2a5c56..fc2506765f 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -136,6 +136,17 @@ endif LOCAL_SRC_FILES := \ $(ARCH_FILES) \ TestRunner.cpp \ + $(SRC)/Core/MIPS/MIPS.cpp.arm \ + $(SRC)/Core/MIPS/MIPSAnalyst.cpp \ + $(SRC)/Core/MIPS/MIPSDis.cpp \ + $(SRC)/Core/MIPS/MIPSDisVFPU.cpp \ + $(SRC)/Core/MIPS/MIPSInt.cpp.arm \ + $(SRC)/Core/MIPS/MIPSIntVFPU.cpp.arm \ + $(SRC)/Core/MIPS/MIPSStackWalk.cpp \ + $(SRC)/Core/MIPS/MIPSTables.cpp \ + $(SRC)/Core/MIPS/MIPSVFPUUtils.cpp.arm \ + $(SRC)/Core/MIPS/MIPSCodeUtils.cpp.arm \ + $(SRC)/Core/MIPS/MIPSDebugInterface.cpp \ $(SRC)/UI/ui_atlas.cpp \ $(SRC)/UI/NativeApp.cpp \ $(SRC)/UI/EmuScreen.cpp \ @@ -294,17 +305,6 @@ LOCAL_SRC_FILES := \ $(SRC)/Core/FileSystems/DirectoryFileSystem.cpp \ $(SRC)/Core/FileSystems/VirtualDiscFileSystem.cpp \ $(SRC)/Core/FileSystems/tlzrc.cpp \ - $(SRC)/Core/MIPS/MIPS.cpp.arm \ - $(SRC)/Core/MIPS/MIPSAnalyst.cpp \ - $(SRC)/Core/MIPS/MIPSDis.cpp \ - $(SRC)/Core/MIPS/MIPSDisVFPU.cpp \ - $(SRC)/Core/MIPS/MIPSInt.cpp.arm \ - $(SRC)/Core/MIPS/MIPSIntVFPU.cpp.arm \ - $(SRC)/Core/MIPS/MIPSStackWalk.cpp \ - $(SRC)/Core/MIPS/MIPSTables.cpp.arm \ - $(SRC)/Core/MIPS/MIPSVFPUUtils.cpp.arm \ - $(SRC)/Core/MIPS/MIPSCodeUtils.cpp.arm \ - $(SRC)/Core/MIPS/MIPSDebugInterface.cpp \ $(SRC)/Core/MIPS/JitCommon/JitCommon.cpp \ $(SRC)/Core/MIPS/JitCommon/JitBlockCache.cpp \ $(SRC)/Core/Util/BlockAllocator.cpp \ diff --git a/native b/native index faf9714b56..0d26996146 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit faf9714b563fb6343fe6d17305330bc715d8e532 +Subproject commit 0d2699614691d71db6bfd8bbf5e46973d343c05e