mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Cardboard VR: Add an on-screen VR OFF button. Enable Cardboard on iOS.
This commit is contained in:
parent
9b8533c936
commit
5dc9acf839
3 changed files with 19 additions and 4 deletions
|
@ -964,6 +964,11 @@ void EmuScreen::CreateViews() {
|
||||||
if (g_Config.bShowDeveloperMenu) {
|
if (g_Config.bShowDeveloperMenu) {
|
||||||
root_->Add(new Button(dev->T("DevMenu")))->OnClick.Handle(this, &EmuScreen::OnDevTools);
|
root_->Add(new Button(dev->T("DevMenu")))->OnClick.Handle(this, &EmuScreen::OnDevTools);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cardboardDisableButton_ = root_->Add(new Button(sc->T("Cardboard VR OFF"), new AnchorLayoutParams(bounds.centerX(), NONE, NONE, 30, true)));
|
||||||
|
cardboardDisableButton_->OnClick.Handle(this, &EmuScreen::OnDisableCardboard);
|
||||||
|
cardboardDisableButton_->SetVisibility(V_GONE);
|
||||||
|
|
||||||
saveStatePreview_ = new AsyncImageFileView("", IS_FIXED, nullptr, new AnchorLayoutParams(bounds.centerX(), 100, NONE, NONE, true));
|
saveStatePreview_ = new AsyncImageFileView("", IS_FIXED, nullptr, new AnchorLayoutParams(bounds.centerX(), 100, NONE, NONE, true));
|
||||||
saveStatePreview_->SetFixedSize(160, 90);
|
saveStatePreview_->SetFixedSize(160, 90);
|
||||||
saveStatePreview_->SetColor(0x90FFFFFF);
|
saveStatePreview_->SetColor(0x90FFFFFF);
|
||||||
|
@ -1029,6 +1034,11 @@ UI::EventReturn EmuScreen::OnDevTools(UI::EventParams ¶ms) {
|
||||||
return UI::EVENT_DONE;
|
return UI::EVENT_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UI::EventReturn EmuScreen::OnDisableCardboard(UI::EventParams ¶ms) {
|
||||||
|
g_Config.bEnableCardboard = false;
|
||||||
|
return UI::EVENT_DONE;
|
||||||
|
}
|
||||||
|
|
||||||
void EmuScreen::update() {
|
void EmuScreen::update() {
|
||||||
UIScreen::update();
|
UIScreen::update();
|
||||||
|
|
||||||
|
@ -1282,6 +1292,7 @@ void EmuScreen::render() {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (hasVisibleUI()) {
|
if (hasVisibleUI()) {
|
||||||
|
cardboardDisableButton_->SetVisibility(g_Config.bEnableCardboard ? UI::V_VISIBLE : UI::V_GONE);
|
||||||
screenManager()->getUIContext()->BeginFrame();
|
screenManager()->getUIContext()->BeginFrame();
|
||||||
renderUI();
|
renderUI();
|
||||||
}
|
}
|
||||||
|
@ -1310,7 +1321,8 @@ bool EmuScreen::hasVisibleUI() {
|
||||||
return true;
|
return true;
|
||||||
if (!osm.IsEmpty() || g_Config.bShowTouchControls || g_Config.iShowFPSCounter != 0)
|
if (!osm.IsEmpty() || g_Config.bShowTouchControls || g_Config.iShowFPSCounter != 0)
|
||||||
return true;
|
return true;
|
||||||
|
if (g_Config.bEnableCardboard)
|
||||||
|
return true;
|
||||||
// Debug UI.
|
// Debug UI.
|
||||||
if (g_Config.bShowDebugStats || g_Config.bShowDeveloperMenu || g_Config.bShowAudioDebug || g_Config.bShowFrameProfiler)
|
if (g_Config.bShowDebugStats || g_Config.bShowDeveloperMenu || g_Config.bShowAudioDebug || g_Config.bShowFrameProfiler)
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -51,6 +51,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
void CreateViews() override;
|
void CreateViews() override;
|
||||||
UI::EventReturn OnDevTools(UI::EventParams ¶ms);
|
UI::EventReturn OnDevTools(UI::EventParams ¶ms);
|
||||||
|
UI::EventReturn OnDisableCardboard(UI::EventParams ¶ms);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void bootGame(const std::string &filename);
|
void bootGame(const std::string &filename);
|
||||||
|
@ -102,4 +103,6 @@ private:
|
||||||
UI::VisibilityTween *loadingViewVisible_ = nullptr;
|
UI::VisibilityTween *loadingViewVisible_ = nullptr;
|
||||||
UI::Spinner *loadingSpinner_ = nullptr;
|
UI::Spinner *loadingSpinner_ = nullptr;
|
||||||
UI::TextView *loadingTextView_ = nullptr;
|
UI::TextView *loadingTextView_ = nullptr;
|
||||||
|
|
||||||
|
UI::Button *cardboardDisableButton_ = nullptr;
|
||||||
};
|
};
|
||||||
|
|
|
@ -442,9 +442,9 @@ void GameSettingsScreen::CreateViews() {
|
||||||
static const char *bufFilters[] = { "Linear", "Nearest", };
|
static const char *bufFilters[] = { "Linear", "Nearest", };
|
||||||
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iBufFilter, gr->T("Screen Scaling Filter"), bufFilters, 1, ARRAY_SIZE(bufFilters), gr->GetName(), screenManager()));
|
graphicsSettings->Add(new PopupMultiChoice(&g_Config.iBufFilter, gr->T("Screen Scaling Filter"), bufFilters, 1, ARRAY_SIZE(bufFilters), gr->GetName(), screenManager()));
|
||||||
|
|
||||||
#ifdef __ANDROID__
|
#if PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(IOS)
|
||||||
graphicsSettings->Add(new ItemHeader(gr->T("Cardboard Settings", "Cardboard Settings")));
|
graphicsSettings->Add(new ItemHeader(gr->T("Cardboard VR Settings", "Cardboard VR Settings")));
|
||||||
CheckBox *cardboardMode = graphicsSettings->Add(new CheckBox(&g_Config.bEnableCardboard, gr->T("Enable Cardboard", "Enable Cardboard")));
|
CheckBox *cardboardMode = graphicsSettings->Add(new CheckBox(&g_Config.bEnableCardboard, gr->T("Enable Cardboard VR", "Enable Cardboard VR")));
|
||||||
cardboardMode->SetDisabledPtr(&g_Config.bSoftwareRendering);
|
cardboardMode->SetDisabledPtr(&g_Config.bSoftwareRendering);
|
||||||
PopupSliderChoice * cardboardScreenSize = graphicsSettings->Add(new PopupSliderChoice(&g_Config.iCardboardScreenSize, 30, 100, gr->T("Cardboard Screen Size", "Screen Size (in % of the viewport)"), 1, screenManager(), gr->T("% of viewport")));
|
PopupSliderChoice * cardboardScreenSize = graphicsSettings->Add(new PopupSliderChoice(&g_Config.iCardboardScreenSize, 30, 100, gr->T("Cardboard Screen Size", "Screen Size (in % of the viewport)"), 1, screenManager(), gr->T("% of viewport")));
|
||||||
cardboardScreenSize->SetDisabledPtr(&g_Config.bSoftwareRendering);
|
cardboardScreenSize->SetDisabledPtr(&g_Config.bSoftwareRendering);
|
||||||
|
|
Loading…
Add table
Reference in a new issue