diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 25c4d6d47d..278a07ee38 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -261,7 +261,10 @@ EVT_COMMAND_SCROLL(IDM_VOLUME, CFrame::MM_OnVolume) //EVT_MENU(IDM_MM_LOG, CFrame::MM_OnLog) #endif +#if defined(HAVE_SFML) && HAVE_SFML EVT_MENU(IDM_NETPLAY, CFrame::OnNetPlay) +#endif + EVT_MENU(IDM_BROWSE, CFrame::OnBrowse) EVT_MENU(IDM_MEMCARD, CFrame::OnMemcard) EVT_MENU(IDM_CHEATS, CFrame::OnShow_CheatsWindow) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index a5c46a0ac7..8ba23d64b8 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -714,6 +714,7 @@ void Renderer::Swap(u32 xfbAddr, u32 srcWidth, u32 srcHeight, s32 yOffset) float u_max; float v_min; float v_max; + if (g_Config.bAutoScale) { u_max = (xfbSource->sourceRc.right - xfbSource->sourceRc.left); @@ -725,6 +726,7 @@ void Renderer::Swap(u32 xfbAddr, u32 srcWidth, u32 srcHeight, s32 yOffset) u_max = (float)xfbSource->texWidth; v_max = (float)xfbSource->texHeight; } + v_min -= yOffset; v_max -= yOffset; @@ -909,6 +911,7 @@ void Renderer::Swap(u32 xfbAddr, u32 srcWidth, u32 srcHeight, s32 yOffset) // Place messages on the picture, then copy it to the screen SwapBuffers(); + // Why save this as s_bNativeResolution if we updated it every frame? s_bNativeResolution = g_Config.bNativeResolution; @@ -921,7 +924,6 @@ void Renderer::Swap(u32 xfbAddr, u32 srcWidth, u32 srcHeight, s32 yOffset) // Renderer::SetZBufferRender(); // SaveTexture("tex.tga", GL_TEXTURE_RECTANGLE_ARB, s_FakeZTarget, GetTargetWidth(), GetTargetHeight()); } -////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp index 386b4d68c3..874fe05507 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp @@ -467,23 +467,26 @@ u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y) if (!g_VideoInitialize.bUseDualCore) { u32 z = 0; + float xScale = Renderer::GetTargetScaleX(); + float yScale = Renderer::GetTargetScaleY(); if (g_Config.iMultisampleMode != MULTISAMPLE_OFF) { // Find the proper dimensions TRectangle source, scaledTargetSource; ComputeBackbufferRectangle(&source); - source.Scale(Renderer::GetTargetScaleX(), Renderer::GetTargetScaleY(), &scaledTargetSource); + source.Scale(xScale, yScale, &scaledTargetSource); // This will resolve and bind to the depth buffer glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, Renderer::ResolveAndGetDepthTarget(scaledTargetSource)); } - // Read the z value! - glReadPixels(x, Renderer::GetTargetHeight()-y, 1, 1, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, &z); + // Read the z value! Also adjust the pixel to read to the upscaled EFB resolution + // Plus we need to flip the y value as the OGL image is upside down + glReadPixels(x*xScale, Renderer::GetTargetHeight() - y*yScale, xScale, yScale, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, &z); GL_REPORT_ERRORD(); - // Mask away the stencil bits - return z & 0xffffff; + // Clamp the 32bits value returned by glReadPixels to a 24bits value (GC uses a 24bits Z-Buffer) + return z / 0x100; } } break;