From 1587cb3738ee7bcf156a4a1257a67730cc7ee9c3 Mon Sep 17 00:00:00 2001 From: skidau Date: Sat, 5 May 2012 11:21:05 +1000 Subject: [PATCH] Fixed texture encoding. Fixes the interaction with objects in Another Code R. Thanks to wordmanwords for the patch. Fixes issue 5405. --- Source/Core/VideoCommon/Src/TextureConversionShader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp index c921a1a9fd..2132a25258 100644 --- a/Source/Core/VideoCommon/Src/TextureConversionShader.cpp +++ b/Source/Core/VideoCommon/Src/TextureConversionShader.cpp @@ -259,7 +259,7 @@ void WriteIncrementSampleX(char*& p,API_TYPE ApiType) void WriteToBitDepth(char*& p, u8 depth, const char* src, const char* dest) { - float result = pow(2.0f, depth) - 1.0f; + float result = 255 / pow(2.0f, (8 - depth)); WRITE(p, " %s = floor(%s * %ff);\n", dest, src, result); }