From 3d4629337693a8867629e77acfd4876fa2f7bfe4 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Tue, 16 Oct 2018 00:07:19 +0700 Subject: [PATCH] Correct condition for depth buffer copy hack for Perfect dark. Fixed Perfect Dark high-res mode issues #1807 Fixed Perfect Dark No text/notifications in multiplayer #1930 --- src/GraphicsDrawer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/GraphicsDrawer.cpp b/src/GraphicsDrawer.cpp index b6e95615..e4b97136 100644 --- a/src/GraphicsDrawer.cpp +++ b/src/GraphicsDrawer.cpp @@ -1013,7 +1013,9 @@ bool texturedRectDepthBufferCopy(const GraphicsDrawer::TexturedRectParams & _par // Works only with depth buffer emulation enabled. // Load of arbitrary data to that area causes weird camera rotation in CBFD. const gDPTile * pTile = gSP.textureTile[0]; - if (pTile->loadType == LOADTYPE_BLOCK && gDP.textureImage.size == 2 && gDP.textureImage.address >= gDP.depthImageAddress && gDP.textureImage.address < (gDP.depthImageAddress + gDP.colorImage.width*gDP.colorImage.width * 6 / 4)) { + if (pTile->loadType == LOADTYPE_BLOCK && gDP.textureImage.size == 2 && + gDP.textureImage.address >= gDP.depthImageAddress && + gDP.textureImage.address < (gDP.depthImageAddress + gDP.colorImage.width*gDP.scissor.lry*2)) { if (config.frameBufferEmulation.copyDepthToRDRAM == Config::cdDisable) return true; FrameBuffer * pBuffer = frameBufferList().getCurrent();