diff --git a/Core/Config.cpp b/Core/Config.cpp index 8380017a8b..ff381e219e 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -694,10 +694,6 @@ struct ConfigTranslator { typedef ConfigTranslator GPUBackendTranslator; static ConfigSetting graphicsSettings[] = { - ConfigSetting("EnableCardboard", &g_Config.bEnableCardboard, false, true, true), - ConfigSetting("CardboardScreenSize", &g_Config.iCardboardScreenSize, 50, true, true), - ConfigSetting("CardboardXShift", &g_Config.iCardboardXShift, 0, true, true), - ConfigSetting("CardboardYShift", &g_Config.iCardboardXShift, 0, true, true), ConfigSetting("ShowFPSCounter", &g_Config.iShowFPSCounter, 0, true, true), ReportedConfigSetting("GraphicsBackend", &g_Config.iGPUBackend, &DefaultGPUBackend, &GPUBackendTranslator::To, &GPUBackendTranslator::From, true, false), ConfigSetting("FailedGraphicsBackends", &g_Config.sFailedGPUBackends, ""), diff --git a/Core/Config.h b/Core/Config.h index 34a97fc0d0..ae736a912a 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -152,11 +152,6 @@ public: bool bAutoFrameSkip; bool bFrameSkipUnthrottle; - bool bEnableCardboard; // Cardboard Master Switch - int iCardboardScreenSize; // Screen Size (in %) - int iCardboardXShift; // X-Shift of Screen (in %) - int iCardboardYShift; // Y-Shift of Screen (in %) - int iWindowX; int iWindowY; int iWindowWidth; // Windows and other windowed environments diff --git a/GPU/Common/FramebufferCommon.cpp b/GPU/Common/FramebufferCommon.cpp index 0bce2d0fa2..6417452c19 100644 --- a/GPU/Common/FramebufferCommon.cpp +++ b/GPU/Common/FramebufferCommon.cpp @@ -782,9 +782,6 @@ void FramebufferManagerCommon::DrawFramebufferToOutput(const u8 *srcPixels, GEBu float v0 = 0.0f, v1 = 1.0f; MakePixelTexture(srcPixels, srcPixelFormat, srcStride, 512, 272, u1, v1); - struct CardboardSettings cardboardSettings; - GetCardboardSettings(&cardboardSettings); - // This might draw directly at the backbuffer (if so, applyPostShader is set) so if there's a post shader, we need to apply it here. // Should try to unify this path with the regular path somehow, but this simple solution works for most of the post shaders // (it always runs at output resolution so FXAA may look odd). @@ -810,18 +807,9 @@ void FramebufferManagerCommon::DrawFramebufferToOutput(const u8 *srcPixels, GEBu DrawTextureFlags flags = g_Config.iBufFilter == SCALE_LINEAR ? DRAWTEX_LINEAR : DRAWTEX_NEAREST; flags = flags | DRAWTEX_TO_BACKBUFFER; - if (cardboardSettings.enabled) { - // Left Eye Image - SetViewport2D(cardboardSettings.leftEyeXPosition, cardboardSettings.screenYPosition, cardboardSettings.screenWidth, cardboardSettings.screenHeight); - DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, ROTATION_LOCKED_HORIZONTAL, flags | DRAWTEX_KEEP_TEX); - // Right Eye Image - SetViewport2D(cardboardSettings.rightEyeXPosition, cardboardSettings.screenYPosition, cardboardSettings.screenWidth, cardboardSettings.screenHeight); - DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, ROTATION_LOCKED_HORIZONTAL, flags); - } else { - // Fullscreen Image - SetViewport2D(0, 0, pixelWidth_, pixelHeight_); - DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, uvRotation, flags); - } + // Fullscreen Image + SetViewport2D(0, 0, pixelWidth_, pixelHeight_); + DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, uvRotation, flags); gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_RASTER_STATE); } @@ -866,9 +854,6 @@ void FramebufferManagerCommon::CopyDisplayToOutput() { u32 offsetX = 0; u32 offsetY = 0; - CardboardSettings cardboardSettings; - GetCardboardSettings(&cardboardSettings); - VirtualFramebuffer *vfb = GetVFBAt(displayFramebufPtr_); if (!vfb) { // Let's search for a framebuf within this range. Note that we also look for @@ -984,19 +969,9 @@ void FramebufferManagerCommon::CopyDisplayToOutput() { // flip V. if (needBackBufferYSwap_) std::swap(v0, v1); - if (cardboardSettings.enabled) { - // Left Eye Image - SetViewport2D(cardboardSettings.leftEyeXPosition, cardboardSettings.screenYPosition, cardboardSettings.screenWidth, cardboardSettings.screenHeight); - DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, ROTATION_LOCKED_HORIZONTAL, flags | DRAWTEX_KEEP_TEX); - - // Right Eye Image - SetViewport2D(cardboardSettings.rightEyeXPosition, cardboardSettings.screenYPosition, cardboardSettings.screenWidth, cardboardSettings.screenHeight); - DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, ROTATION_LOCKED_HORIZONTAL, flags); - } else { - // Fullscreen Image - SetViewport2D(0, 0, pixelWidth_, pixelHeight_); - DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, uvRotation, flags); - } + // Fullscreen Image + SetViewport2D(0, 0, pixelWidth_, pixelHeight_); + DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, uvRotation, flags); } else if (usePostShader_ && extraFBOs_.size() == 1 && !postShaderAtOutputResolution_) { // An additional pass, post-processing shader to the extra FBO. shaderManager_->DirtyLastShader(); // dirty lastShader_ @@ -1031,19 +1006,9 @@ void FramebufferManagerCommon::CopyDisplayToOutput() { Bind2DShader(); flags = (!postShaderIsUpscalingFilter_ && g_Config.iBufFilter == SCALE_LINEAR) ? DRAWTEX_LINEAR : DRAWTEX_NEAREST; flags = flags | DRAWTEX_TO_BACKBUFFER; - if (g_Config.bEnableCardboard) { - // Left Eye Image - SetViewport2D(cardboardSettings.leftEyeXPosition, cardboardSettings.screenYPosition, cardboardSettings.screenWidth, cardboardSettings.screenHeight); - DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, ROTATION_LOCKED_HORIZONTAL, flags | DRAWTEX_KEEP_TEX); - - // Right Eye Image - SetViewport2D(cardboardSettings.rightEyeXPosition, cardboardSettings.screenYPosition, cardboardSettings.screenWidth, cardboardSettings.screenHeight); - DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, ROTATION_LOCKED_HORIZONTAL, flags); - } else { - // Fullscreen Image - SetViewport2D(0, 0, pixelWidth_, pixelHeight_); - DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, uvRotation, flags); - } + // Fullscreen Image + SetViewport2D(0, 0, pixelWidth_, pixelHeight_); + DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, uvRotation, flags); } else { shaderManager_->DirtyLastShader(); // dirty lastShader_ BEFORE drawing draw_->BindFramebufferAsRenderTarget(nullptr, { Draw::RPAction::CLEAR, Draw::RPAction::CLEAR, Draw::RPAction::CLEAR }); @@ -1059,19 +1024,9 @@ void FramebufferManagerCommon::CopyDisplayToOutput() { PostShaderUniforms uniforms{}; CalculatePostShaderUniforms(vfb->bufferWidth, vfb->bufferHeight, vfb->renderWidth, vfb->renderHeight, &uniforms); BindPostShader(uniforms); - if (g_Config.bEnableCardboard) { - // Left Eye Image - SetViewport2D(cardboardSettings.leftEyeXPosition, cardboardSettings.screenYPosition, cardboardSettings.screenWidth, cardboardSettings.screenHeight); - DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, ROTATION_LOCKED_HORIZONTAL, flags | DRAWTEX_KEEP_TEX); - - // Right Eye Image - SetViewport2D(cardboardSettings.rightEyeXPosition, cardboardSettings.screenYPosition, cardboardSettings.screenWidth, cardboardSettings.screenHeight); - DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, ROTATION_LOCKED_HORIZONTAL, flags); - } else { - // Fullscreen Image - SetViewport2D(0, 0, pixelWidth_, pixelHeight_); - DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, uvRotation, flags); - } + // Fullscreen Image + SetViewport2D(0, 0, pixelWidth_, pixelHeight_); + DrawActiveTexture(x, y, w, h, (float)pixelWidth_, (float)pixelHeight_, u0, v0, u1, v1, uvRotation, flags); } } else if (useBufferedRendering_) { @@ -1841,27 +1796,6 @@ void FramebufferManagerCommon::CalculatePostShaderUniforms(int bufferWidth, int uniforms->video = textureCache_->VideoIsPlaying(); } -void FramebufferManagerCommon::GetCardboardSettings(CardboardSettings *cardboardSettings) { - // Calculate Cardboard Settings - float cardboardScreenScale = g_Config.iCardboardScreenSize / 100.0f; - float cardboardScreenWidth = pixelWidth_ / 2.0f * cardboardScreenScale; - float cardboardScreenHeight = pixelHeight_ / 2.0f * cardboardScreenScale; - float cardboardMaxXShift = (pixelWidth_ / 2.0f - cardboardScreenWidth) / 2.0f; - float cardboardUserXShift = g_Config.iCardboardXShift / 100.0f * cardboardMaxXShift; - float cardboardLeftEyeX = cardboardMaxXShift + cardboardUserXShift; - float cardboardRightEyeX = pixelWidth_ / 2.0f + cardboardMaxXShift - cardboardUserXShift; - float cardboardMaxYShift = pixelHeight_ / 2.0f - cardboardScreenHeight / 2.0f; - float cardboardUserYShift = g_Config.iCardboardYShift / 100.0f * cardboardMaxYShift; - float cardboardScreenY = cardboardMaxYShift + cardboardUserYShift; - - cardboardSettings->enabled = g_Config.bEnableCardboard; - cardboardSettings->leftEyeXPosition = cardboardLeftEyeX; - cardboardSettings->rightEyeXPosition = cardboardRightEyeX; - cardboardSettings->screenYPosition = cardboardScreenY; - cardboardSettings->screenWidth = cardboardScreenWidth; - cardboardSettings->screenHeight = cardboardScreenHeight; -} - Draw::Framebuffer *FramebufferManagerCommon::GetTempFBO(TempFBO reason, u16 w, u16 h, Draw::FBColorDepth depth) { u64 key = ((u64)reason << 48) | ((u64)depth << 32) | ((u32)w << 16) | h; auto it = tempFBOs_.find(key); diff --git a/GPU/Common/FramebufferCommon.h b/GPU/Common/FramebufferCommon.h index 3f1d1a49a5..ce5e0c8aef 100644 --- a/GPU/Common/FramebufferCommon.h +++ b/GPU/Common/FramebufferCommon.h @@ -46,15 +46,6 @@ namespace Draw { class Framebuffer; } -struct CardboardSettings { - bool enabled; - float leftEyeXPosition; - float rightEyeXPosition; - float screenYPosition; - float screenWidth; - float screenHeight; -}; - class VulkanFBO; struct PostShaderUniforms { @@ -325,9 +316,6 @@ protected: virtual void Bind2DShader() = 0; virtual void BindPostShader(const PostShaderUniforms &uniforms) = 0; - // Cardboard Settings Calculator - void GetCardboardSettings(CardboardSettings *cardboardSettings); - bool UpdateSize(); void SetNumExtraFBOs(int num); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 49608cf8f3..8804597de3 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -438,18 +438,6 @@ void GameSettingsScreen::CreateViews() { 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())); -#ifdef __ANDROID__ - graphicsSettings->Add(new ItemHeader(gr->T("Cardboard Settings", "Cardboard Settings"))); - CheckBox *cardboardMode = graphicsSettings->Add(new CheckBox(&g_Config.bEnableCardboard, gr->T("Enable Cardboard", "Enable Cardboard"))); - 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"))); - cardboardScreenSize->SetDisabledPtr(&g_Config.bSoftwareRendering); - PopupSliderChoice *cardboardXShift = graphicsSettings->Add(new PopupSliderChoice(&g_Config.iCardboardXShift, -100, 100, gr->T("Cardboard Screen X Shift", "X Shift (in % of the void)"), 1, screenManager(), gr->T("% of the void"))); - cardboardXShift->SetDisabledPtr(&g_Config.bSoftwareRendering); - PopupSliderChoice *cardboardYShift = graphicsSettings->Add(new PopupSliderChoice(&g_Config.iCardboardYShift, -100, 100, gr->T("Cardboard Screen Y Shift", "Y Shift (in % of the void)"), 1, screenManager(), gr->T("% of the void"))); - cardboardYShift->SetDisabledPtr(&g_Config.bSoftwareRendering); -#endif - graphicsSettings->Add(new ItemHeader(gr->T("Hack Settings", "Hack Settings (these WILL cause glitches)"))); static const char *bloomHackOptions[] = { "Off", "Safe", "Balanced", "Aggressive" }; diff --git a/android/.gitignore b/android/.gitignore index 4aa0d52b74..94ec461233 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -12,3 +12,4 @@ ui_atlas.zim.png #assets/ui_atlas.zim #jni/ui_atlas.cpp #jni/ui_atlas.h +.cxx