diff options
| author | CarlKenner <carl.kenner@gmail.com> | 2015-01-20 02:31:32 +1030 |
|---|---|---|
| committer | CarlKenner <carl.kenner@gmail.com> | 2015-01-20 03:42:58 +1030 |
| commit | 4768d0f0a8a2ebec7a35dc0b11dd953e77e24356 (patch) | |
| tree | 74d71f37856a25dda465eccd38f559f748d65635 /Source/Core/VideoBackends/D3D/Render.cpp | |
| parent | 7454297820bdc887c646f0b031dbd0fc4a1346a1 (diff) | |
This fixes stereoscopic 3D with XFB enabled, for example in the intro in Animal Crossing GameCube NTSC.
The maths appears to give crazy impossible answers without this fix, but the cause is all the ints being "promoted" to unsigned because of the single unsigned division at the end.
Diffstat (limited to 'Source/Core/VideoBackends/D3D/Render.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/Render.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index 1ae034bdda..bbfe2e95b9 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -743,10 +743,10 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co int xfbWidth = xfbSource->srcWidth; int hOffset = ((s32)xfbSource->srcAddr - (s32)xfbAddr) / ((s32)fbStride * 2); - drawRc.top = targetRc.top + hOffset * targetRc.GetHeight() / fbHeight; - drawRc.bottom = targetRc.top + (hOffset + xfbHeight) * targetRc.GetHeight() / fbHeight; - drawRc.left = targetRc.left + (targetRc.GetWidth() - xfbWidth * targetRc.GetWidth() / fbStride) / 2; - drawRc.right = targetRc.left + (targetRc.GetWidth() + xfbWidth * targetRc.GetWidth() / fbStride) / 2; + drawRc.top = targetRc.top + hOffset * targetRc.GetHeight() / (s32)fbHeight; + drawRc.bottom = targetRc.top + (hOffset + xfbHeight) * targetRc.GetHeight() / (s32)fbHeight; + drawRc.left = targetRc.left + (targetRc.GetWidth() - xfbWidth * targetRc.GetWidth() / (s32)fbStride) / 2; + drawRc.right = targetRc.left + (targetRc.GetWidth() + xfbWidth * targetRc.GetWidth() / (s32)fbStride) / 2; // The following code disables auto stretch. Kept for reference. // scale draw area for a 1 to 1 pixel mapping with the draw target |
