From a328bc968cc71d5bb47966f3286ed2f659204620 Mon Sep 17 00:00:00 2001 From: raven02 Date: Tue, 20 Aug 2013 11:56:43 +0800 Subject: [PATCH 1/2] HW: Use GETexProjMapMode constants --- GPU/GLES/VertexShaderGenerator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GPU/GLES/VertexShaderGenerator.cpp b/GPU/GLES/VertexShaderGenerator.cpp index f4dace2e4b..7573de263c 100644 --- a/GPU/GLES/VertexShaderGenerator.cpp +++ b/GPU/GLES/VertexShaderGenerator.cpp @@ -531,23 +531,23 @@ void GenerateVertexShader(int prim, char *buffer, bool useHWTransform) { { std::string temp_tc; switch (gstate.getUVProjMode()) { - case 0: // Use model space XYZ as source + case GE_PROJMAP_POSITION: // Use model space XYZ as source temp_tc = "vec4(a_position.xyz, 1.0)"; break; - case 1: // Use unscaled UV as source + case GE_PROJMAP_UV: // Use unscaled UV as source { static const char *rescaleuv[4] = {"", " * 1.9921875", " * 1.999969482421875", ""}; // 2*127.5f/128.f, 2*32767.5f/32768.f, 1.0f}; const char *factor = rescaleuv[(vertType & GE_VTYPE_TC_MASK) >> GE_VTYPE_TC_SHIFT]; temp_tc = StringFromFormat("vec4(a_texcoord.xy %s, 0.0, 1.0)", factor); } break; - case 2: // Use normalized transformed normal as source + case GE_PROJMAP_NORMALIZED_NORMAL: // Use normalized transformed normal as source if (hasNormal) temp_tc = "vec4(normalize(a_normal), 1.0)"; else temp_tc = "vec4(0.0, 0.0, 1.0, 1.0)"; break; - case 3: // Use non-normalized transformed normal as source + case GE_PROJMAP_NORMAL: // Use non-normalized transformed normal as source if (hasNormal) temp_tc = "vec4(a_normal, 1.0)"; else From 77090143a053b3626db59457201521335551be39 Mon Sep 17 00:00:00 2001 From: raven02 Date: Tue, 20 Aug 2013 11:58:34 +0800 Subject: [PATCH 2/2] SW : use GETexProjMapMod constants --- GPU/GLES/TransformPipeline.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index 9b05431ddb..d4ad30fefc 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -683,13 +683,13 @@ void TransformDrawEngine::SoftwareTransformAndDraw( Vec3f source; switch (gstate.getUVProjMode()) { - case 0: // Use model space XYZ as source + case GE_PROJMAP_POSITION: // Use model space XYZ as source source = pos; break; - case 1: // Use unscaled UV as source + case GE_PROJMAP_UV: // Use unscaled UV as source source = Vec3f(ruv[0], ruv[1], 0.0f); break; - case 2: // Use normalized normal as source + case GE_PROJMAP_NORMALIZED_NORMAL: // Use normalized normal as source if (reader.hasNormal()) { source = Vec3f(norm).Normalized(); } else { @@ -697,7 +697,7 @@ void TransformDrawEngine::SoftwareTransformAndDraw( source = Vec3f::AssignToAll(0.0f); } break; - case 3: // Use non-normalized normal as source! + case GE_PROJMAP_NORMAL: // Use non-normalized normal as source! if (reader.hasNormal()) { source = Vec3f(norm); } else {