From 6b3ddae5545fe64262b907bb08941b599b50023d Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Wed, 6 Feb 2013 21:38:19 +0100 Subject: [PATCH] Fix UV error introduced in previous commit --- GPU/GLES/ShaderManager.cpp | 2 -- GPU/GLES/TransformPipeline.cpp | 2 +- GPU/GLES/VertexDecoder.cpp | 4 ++-- GPU/GLES/VertexDecoder.h | 11 ++++++++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/GPU/GLES/ShaderManager.cpp b/GPU/GLES/ShaderManager.cpp index 6179e50262..2ce7a880dd 100644 --- a/GPU/GLES/ShaderManager.cpp +++ b/GPU/GLES/ShaderManager.cpp @@ -273,8 +273,6 @@ void LinkedShader::updateUniforms() { } else { uvscaleoff[0] *= 2.0f; uvscaleoff[1] *= 2.0f; - uvscaleoff[2] *= 2.0f; - uvscaleoff[3] *= 2.0f; } glUniform4fv(u_uvscaleoffset, 1, uvscaleoff); } diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index 1eed1c0f7e..2e61fe289d 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -319,7 +319,7 @@ static const GlTypeInfo GLComp[] = { {GL_UNSIGNED_SHORT, 2, GL_TRUE},// DEC_U16_2, {GL_UNSIGNED_SHORT, 3, GL_TRUE},// DEC_U16_3, {GL_UNSIGNED_SHORT, 4, GL_TRUE},// DEC_U16_4, - {GL_UNSIGNED_BYTE, 2, GL_FALSE},// DEC_U8A_2, + {GL_UNSIGNED_BYTE, 2, GL_FALSE},// DEC_U8A_2, {GL_UNSIGNED_SHORT, 2, GL_FALSE},// DEC_U16A_2, }; diff --git a/GPU/GLES/VertexDecoder.cpp b/GPU/GLES/VertexDecoder.cpp index 8bfc77a451..e006927307 100644 --- a/GPU/GLES/VertexDecoder.cpp +++ b/GPU/GLES/VertexDecoder.cpp @@ -178,8 +178,8 @@ void VertexDecoder::Step_TcFloatThrough() const { float *uv = (float *)(decoded_ + decFmt.uvoff); const float *uvdata = (const float*)(ptr_ + tcoff); - uv[0] = uvdata[0] * 0.5f; - uv[1] = uvdata[1] * 0.5f; + uv[0] = uvdata[0]; + uv[1] = uvdata[1]; } void VertexDecoder::Step_Color565() const diff --git a/GPU/GLES/VertexDecoder.h b/GPU/GLES/VertexDecoder.h index 09cbaafba4..6e006d7398 100644 --- a/GPU/GLES/VertexDecoder.h +++ b/GPU/GLES/VertexDecoder.h @@ -254,8 +254,13 @@ public: break; case DEC_FLOAT_2: - uv[0] = f[0] * 2.0f; - uv[1] = f[1] * 2.0f; + if (isThrough()) { + uv[0] = f[0]; + uv[1] = f[1]; + } else { + uv[0] = f[0] * 2.0f; + uv[1] = f[1] * 2.0f; + } break; case DEC_U16A_2: @@ -357,7 +362,7 @@ public: bool hasColor0() const { return decFmt_.c0fmt != 0; } bool hasNormal() const { return decFmt_.nrmfmt != 0; } bool hasUV() const { return decFmt_.uvfmt != 0; } - + bool isThrough() const { return (vtype_ & GE_VTYPE_THROUGH) != 0; } void Goto(int index) { data_ = base_ + index * decFmt_.stride; }