Warning fixes, make the back button exit the emu on the main screen on Android.

This commit is contained in:
Henrik Rydgard 2013-09-04 10:51:14 +02:00
parent 9e5362ded1
commit 273fb7c941
6 changed files with 34 additions and 25 deletions

View File

@ -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:

View File

@ -98,7 +98,7 @@ UI::EventReturn CwCheatScreen::OnBack(UI::EventParams &params)
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 &params)
std::vector<std::string> 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 &params)
return UI::EVENT_DONE;
}
UI::EventReturn CwCheatScreen::OnAddCheat(UI::EventParams &params)
{
screenManager()->finishDialog(this, DR_OK);
g_Config.bReloadCheats = true;
return UI::EVENT_DONE;
}
UI::EventReturn CwCheatScreen::OnImportCheat(UI::EventParams &params)
{
std::string line;
@ -207,7 +206,7 @@ UI::EventReturn CwCheatScreen::OnImportCheat(UI::EventParams &params)
}
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";
}
}

View File

@ -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);

View File

@ -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) {

View File

@ -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 \

2
native

@ -1 +1 @@
Subproject commit faf9714b563fb6343fe6d17305330bc715d8e532
Subproject commit 0d2699614691d71db6bfd8bbf5e46973d343c05e