Treat UV gen mode 3 as GE_TEXMAP_TEXTURE_COORDS.

Fixes Riviera, #2214.
This commit is contained in:
Unknown W. Brackets
2013-08-19 00:33:15 -07:00
parent ad40ef6a52
commit a5cf284c1b
2 changed files with 9 additions and 6 deletions
+5 -3
View File
@@ -670,13 +670,14 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
// Perform texture coordinate generation after the transform and lighting - one style of UV depends on lights.
switch (gstate.getUVGenMode())
{
case 0: // UV mapping
case GE_TEXMAP_TEXTURE_COORDS: // UV mapping
case GE_TEXMAP_UNKNOWN: // Seen in Riviera. Unsure of meaning, but this works.
// Texture scale/offset is only performed in this mode.
uv[0] = uscale * (ruv[0]*gstate_c.uv.uScale + gstate_c.uv.uOff);
uv[1] = vscale * (ruv[1]*gstate_c.uv.vScale + gstate_c.uv.vOff);
uv[2] = 1.0f;
break;
case 1:
case GE_TEXMAP_TEXTURE_MATRIX:
{
// Projection mapping
Vec3f source;
@@ -713,7 +714,7 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
uv[2] = uvw[2];
}
break;
case 2:
case GE_TEXMAP_ENVIRONMENT_MAP:
// Shade mapping - use two light sources to generate U and V.
{
Vec3f lightpos0 = Vec3f(gstate_c.lightpos[gstate.getUVLS0()]).Normalized();
@@ -726,6 +727,7 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
break;
default:
// Illegal
ERROR_LOG_REPORT(G3D, "Impossible UV gen mode? %d", gstate.getUVGenMode());
break;
}
uv[0] = uv[0] * widthFactor;
+4 -3
View File
@@ -459,9 +459,10 @@ enum GEStencilOp
enum GETexMapMode
{
GE_TEXMAP_TEXTURE_COORDS=0,
GE_TEXMAP_TEXTURE_MATRIX=1,
GE_TEXMAP_ENVIRONMENT_MAP=2,
GE_TEXMAP_TEXTURE_COORDS = 0,
GE_TEXMAP_TEXTURE_MATRIX = 1,
GE_TEXMAP_ENVIRONMENT_MAP = 2,
GE_TEXMAP_UNKNOWN = 3,
};
enum GETexProjMapMode