summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/Render.cpp
diff options
context:
space:
mode:
authorJules Blok <jules.blok@gmail.com>2015-06-06 20:07:49 +0200
committerJules Blok <jules.blok@gmail.com>2015-06-06 20:07:49 +0200
commit5650b9e970de0fe8d57d7c7d38519534e9447f8e (patch)
tree76df00f6e69b26318e201b6d38bf3532233a807b /Source/Core/VideoBackends/OGL/Render.cpp
parentd3e47dfcf573e3fef422517799a52e3b5aa5c91d (diff)
Revert "OGL: Use floating point arithmetic to scale the depth value."
This reverts commit 05f42f94a0442fef64c994cb78f4d621bb1fc7ff.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/Render.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/Render.cpp9
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