diff options
Diffstat (limited to 'Source/Core/VideoBackends/OGL/Render.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/Render.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index f04eef8ba2..e977035240 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -1023,18 +1023,17 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) // Scale the 32-bit value returned by glReadPixels to a 24-bit // value (GC uses a 24-bit Z-buffer). - float val = z / float(0xFFFFFFFF); - u32 ret = 0; + // TODO: in RE0 this value is often off by one, which causes lighting to disappear if (bpmem.zcontrol.pixel_format == PEControl::RGB565_Z16) { // if Z is in 16 bit format you must return a 16 bit integer - ret = MathUtil::Clamp<u32>((u32)(val * 65536.0f), 0, 0xFFFF); + z = z >> 16; } else { - ret = MathUtil::Clamp<u32>((u32)(val * 16777216.0f), 0, 0xFFFFFF); + z = z >> 8; } - return ret; + return z; } case PEEK_COLOR: // GXPeekARGB |
