summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authordonkopunchstania <donkopunchstania@gmail.com>2010-12-31 07:06:53 +0000
committerdonkopunchstania <donkopunchstania@gmail.com>2010-12-31 07:06:53 +0000
commit41c40bcd50ae2269ff27b0f0018539bb64c2ca3c (patch)
tree9ce65f5a306d1c89724e4852ec542bb907b0a2d6 /Source/Core
parent8a711eadaced8306490271c1b13c51007fe9fa67 (diff)
Finish implementing gamma correction in DX9.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6697 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/VideoCommon/Src/BPStructs.cpp15
-rw-r--r--Source/Core/VideoCommon/Src/RenderBase.cpp2
2 files changed, 13 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp
index 6192830efa..4b0998c38d 100644
--- a/Source/Core/VideoCommon/Src/BPStructs.cpp
+++ b/Source/Core/VideoCommon/Src/BPStructs.cpp
@@ -38,6 +38,14 @@ u32 mapTexAddress;
bool mapTexFound;
int numWrites;
+static const float s_gammaLUT[] =
+{
+ 1.0f,
+ 1.7f,
+ 2.2f,
+ 1.0f
+};
+
void BPInit()
{
memset(&bpmem, 0, sizeof(bpmem));
@@ -48,9 +56,9 @@ void BPInit()
mapTexFound = false;
}
-void RenderToXFB(const BPCmd &bp, const EFBRectangle &rc, float yScale, float xfbLines, u32 xfbAddr, const u32 dstWidth, const u32 dstHeight)
+void RenderToXFB(const BPCmd &bp, const EFBRectangle &rc, float yScale, float xfbLines, u32 xfbAddr, const u32 dstWidth, const u32 dstHeight, float gamma)
{
- Renderer::RenderToXFB(xfbAddr, dstWidth, dstHeight, rc);
+ Renderer::RenderToXFB(xfbAddr, dstWidth, dstHeight, rc, gamma);
}
void BPWritten(const BPCmd& bp)
@@ -272,7 +280,8 @@ void BPWritten(const BPCmd& bp)
RenderToXFB(bp, rc, yScale, xfbLines,
bpmem.copyTexDest << 5,
bpmem.copyMipMapStrideChannels << 4,
- (u32)xfbLines);
+ (u32)xfbLines,
+ s_gammaLUT[PE_copy.gamma]);
}
// Clear the rectangular region after copying it.
diff --git a/Source/Core/VideoCommon/Src/RenderBase.cpp b/Source/Core/VideoCommon/Src/RenderBase.cpp
index a4224c223b..b8dce52586 100644
--- a/Source/Core/VideoCommon/Src/RenderBase.cpp
+++ b/Source/Core/VideoCommon/Src/RenderBase.cpp
@@ -90,7 +90,7 @@ Renderer::~Renderer()
prev_efb_format = (unsigned int)-1;
}
-void Renderer::RenderToXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc,float Gamma)
+void Renderer::RenderToXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma)
{
if (!fbWidth || !fbHeight)
return;