summaryrefslogtreecommitdiff
path: root/src/renderergl2
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderergl2')
-rw-r--r--src/renderergl2/tr_model_iqm.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/renderergl2/tr_model_iqm.c b/src/renderergl2/tr_model_iqm.c
index b76c30b4..a2f6f250 100644
--- a/src/renderergl2/tr_model_iqm.c
+++ b/src/renderergl2/tr_model_iqm.c
@@ -953,10 +953,10 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
float jointMats[IQM_MAX_JOINTS * 12];
int i;
- vec4_t *outXYZ = &tess.xyz[tess.numVertexes];
- vec4_t *outNormal = &tess.normal[tess.numVertexes];
- vec2_t (*outTexCoord)[2] = &tess.texCoords[tess.numVertexes];
- vec4_t *outColor = &tess.vertexColors[tess.numVertexes];
+ vec4_t *outXYZ;
+ vec4_t *outNormal;
+ vec2_t (*outTexCoord)[2];
+ vec4_t *outColor;
int frame = data->num_frames ? backEnd.currentEntity->e.frame % data->num_frames : 0;
int oldframe = data->num_frames ? backEnd.currentEntity->e.oldframe % data->num_frames : 0;
@@ -968,6 +968,11 @@ void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
RB_CHECKOVERFLOW( surf->num_vertexes, surf->num_triangles * 3 );
+ outXYZ = &tess.xyz[tess.numVertexes];
+ outNormal = &tess.normal[tess.numVertexes];
+ outTexCoord = &tess.texCoords[tess.numVertexes];
+ outColor = &tess.vertexColors[tess.numVertexes];
+
// compute interpolated joint matrices
if ( data->num_joints > 0 ) {
ComputePoseMats( data, frame, oldframe, backlerp, jointMats );