Culling and decode fixes.

Road is visible in MotoGP
This commit is contained in:
Henrik Rydgard 2012-11-16 15:35:41 +01:00
parent 85c408d329
commit e627e1aeb2
2 changed files with 11 additions and 6 deletions

View File

@ -375,6 +375,10 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff)
if (data & GE_VTYPE_THROUGH) {
glDisable(GL_CULL_FACE);
}
else {
// this might get spammy
glEnDis(GL_CULL_FACE, gstate.cullfaceEnable & 1);
}
// This sets through-mode or not, as well.
break;
@ -521,7 +525,7 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff)
break;
case GE_CMD_TEXADDR0:
gstate.textureChanged=true;
gstate.textureChanged = true;
case GE_CMD_TEXADDR1:
case GE_CMD_TEXADDR2:
case GE_CMD_TEXADDR3:
@ -533,7 +537,7 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff)
break;
case GE_CMD_TEXBUFWIDTH0:
gstate.textureChanged=true;
gstate.textureChanged = true;
case GE_CMD_TEXBUFWIDTH1:
case GE_CMD_TEXBUFWIDTH2:
case GE_CMD_TEXBUFWIDTH3:
@ -767,7 +771,8 @@ void GLES_GPU::ExecuteOp(u32 op, u32 diff)
break;
case GE_CMD_CULL:
DEBUG_LOG(G3D,"DL cull: %06x", data);
glCullFace(data ? GL_BACK : GL_FRONT);
glCullFace(data & 1 ? GL_FRONT : GL_BACK);
//glCullFace(data & 1 ? GL_BACK : GL_FRONT);
break;
case GE_CMD_LMODE:

View File

@ -354,7 +354,7 @@ void VertexDecoder::DecodeVerts(DecodedVertex *decoded, const void *verts, const
{
case GE_VTYPE_POS_FLOAT >> 7:
{
const float *fv = (const float*)(ptr + posoff);
const float *fv = (const float*)(ptr + onesize_*n + posoff);
for (int j = 0; j < 3; j++)
v[j] += fv[j] * gstate.morphWeights[n];
}
@ -364,7 +364,7 @@ void VertexDecoder::DecodeVerts(DecodedVertex *decoded, const void *verts, const
{
float multiplier = 1.0f / 32767.0f;
if (throughmode) multiplier = 1.0f;
const short *sv = (const short*)(ptr + posoff);
const short *sv = (const short*)(ptr + onesize_*n + posoff);
for (int j = 0; j < 3; j++)
v[j] += (sv[j] * multiplier) * gstate.morphWeights[n];
}
@ -372,7 +372,7 @@ void VertexDecoder::DecodeVerts(DecodedVertex *decoded, const void *verts, const
case GE_VTYPE_POS_8BIT >> 7:
{
const s8 *sv = (const s8*)(ptr + posoff);
const s8 *sv = (const s8*)(ptr + onesize_*n + posoff);
for (int j = 0; j < 3; j++)
v[j] += (sv[j] / 127.f) * gstate.morphWeights[n];
}