Add setting for Kitkat Immersive Mode on Android.

This commit is contained in:
Henrik Rydgard 2014-02-09 23:16:08 +01:00
parent a0d5610f36
commit ca500b0bf4
8 changed files with 21 additions and 6 deletions

View File

@ -257,6 +257,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) {
graphics->Get("PartialStretch", &bPartialStretch, partialStretchDefault);
graphics->Get("StretchToDisplay", &bStretchToDisplay, false);
graphics->Get("SmallDisplay", &bSmallDisplay, false);
graphics->Get("ImmersiveMode", &bImmersiveMode, false);
graphics->Get("TrueColor", &bTrueColor, true);
@ -571,6 +572,7 @@ void Config::Save() {
graphics->Set("PartialStretch", bPartialStretch);
graphics->Set("StretchToDisplay", bStretchToDisplay);
graphics->Set("SmallDisplay", bSmallDisplay);
graphics->Set("ImmersiveMode", bImmersiveMode);
graphics->Set("TrueColor", bTrueColor);
graphics->Set("MipMap", bMipMap);
graphics->Set("TexScalingLevel", iTexScalingLevel);

View File

@ -101,6 +101,7 @@ public:
bool bPartialStretch;
bool bStretchToDisplay;
bool bSmallDisplay; // Useful on large tablets with touch controls to not overlap the image. Temporary setting - will be replaced by more comprehensive display size settings.
bool bImmersiveMode; // Mode on Android Kitkat 4.4 that hides the back button etc.
bool bVSync;
int iFrameSkip;
bool bAutoFrameSkip;

View File

@ -593,6 +593,7 @@ void SymbolMap::AssignFunctionIndices() {
}
void SymbolMap::UpdateActiveSymbols() {
return;
lock_guard guard(lock_);
std::map<int, u32> activeModuleIndexes;
for (auto it = activeModuleEnds.begin(), end = activeModuleEnds.end(); it != end; ++it) {

View File

@ -128,10 +128,11 @@ void GameSettingsScreen::CreateViews() {
graphicsSettings->Add(new CheckBox(&g_Config.bSmallDisplay, gs->T("Small Display")));
if (pixel_xres < pixel_yres * 1.3) // Smaller than 4:3
graphicsSettings->Add(new CheckBox(&g_Config.bPartialStretch, gs->T("Partial Vertical Stretch")));
graphicsSettings->Add(new CheckBox(&g_Config.bMipMap, gs->T("Mipmapping")));
#ifdef ANDROID
graphicsSettings->Add(new CheckBox(&g_Config.bImmersiveMode, gs->T("Immersive Mode")))->OnClick.Handle(this, &GameSettingsScreen::OnImmersiveModeChange);
#endif
graphicsSettings->Add(new ItemHeader(gs->T("Performance")));
#ifndef MOBILE_DEVICE
static const char *internalResolutions[] = {"Auto (1:1)", "1x PSP", "2x PSP", "3x PSP", "4x PSP", "5x PSP", "6x PSP", "7x PSP", "8x PSP", "9x PSP", "10x PSP" };
#else
@ -143,6 +144,7 @@ void GameSettingsScreen::CreateViews() {
#ifdef _WIN32
graphicsSettings->Add(new CheckBox(&g_Config.bVSync, gs->T("VSync")));
#endif
graphicsSettings->Add(new CheckBox(&g_Config.bMipMap, gs->T("Mipmapping")));
graphicsSettings->Add(new CheckBox(&g_Config.bHardwareTransform, gs->T("Hardware Transform")));
CheckBox *swSkin = graphicsSettings->Add(new CheckBox(&g_Config.bSoftwareSkinning, gs->T("Software Skinning")));
CheckBox *vtxCache = graphicsSettings->Add(new CheckBox(&g_Config.bVertexCache, gs->T("Vertex Cache")));
@ -355,6 +357,11 @@ UI::EventReturn GameSettingsScreen::OnScreenRotation(UI::EventParams &e) {
return UI::EVENT_DONE;
}
UI::EventReturn GameSettingsScreen::OnImmersiveModeChange(UI::EventParams &e) {
System_SendMessage("immersive", "");
return UI::EVENT_DONE;
}
UI::EventReturn GameSettingsScreen::OnRenderingMode(UI::EventParams &e) {
// We do not want to report when rendering mode is Framebuffer to memory - so many issues
// are caused by that (framebuffer copies overwriting display lists, etc).

View File

@ -72,6 +72,7 @@ private:
UI::EventReturn OnRenderingMode(UI::EventParams &e);
UI::EventReturn OnScreenRotation(UI::EventParams &e);
UI::EventReturn OnImmersiveModeChange(UI::EventParams &e);
// Temporaries to convert bools to int settings
bool cap60FPS_;

View File

@ -943,7 +943,6 @@ UI::EventReturn MainScreen::OnForums(UI::EventParams &e) {
UI::EventReturn MainScreen::OnExit(UI::EventParams &e) {
System_SendMessage("event", "exitprogram");
NativeShutdown();
exit(0);
return UI::EVENT_DONE;
}

View File

@ -202,8 +202,9 @@ std::string NativeQueryConfig(std::string query) {
if (query == "screenRotation") {
char temp[128];
sprintf(temp, "%i", g_Config.iScreenRotation);
ILOG("Rotation queried: %s", temp);
return temp;
} else if (query == "immersiveMode") {
return g_Config.bImmersiveMode ? "1" : "0";
} else {
return "";
}
@ -793,11 +794,14 @@ void NativeShutdown() {
#ifdef ANDROID_NDK_PROFILER
moncleanup();
#endif
ILOG("NativeShutdown called");
System_SendMessage("finish", "");
// This means that the activity has been completely destroyed. PPSSPP does not
// boot up correctly with "dirty" global variables currently, so we hack around that
// by simply exiting.
#ifdef ANDROID
ILOG("NativeShutdown called");
exit(0);
#endif

2
native

@ -1 +1 @@
Subproject commit 0ba62994137392e447570b8f0eef8a819556fd3b
Subproject commit 4ae715832edace32e80cbc340b9d37d83ef5aa73