From 3b6b9298416b26df51cba703ce461a8a7c45fa0a Mon Sep 17 00:00:00 2001 From: Jeff Teunissen Date: Mon, 11 Dec 2000 18:59:55 +0000 Subject: [PATCH] Okay, that's it. Model animation interpolation is as done as it's going to get with the QW protocol. --- source/cl_ents.c | 7 +++---- source/gl_rmain.c | 27 ++++++++++++++------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source/cl_ents.c b/source/cl_ents.c index 48554cf..f4cde6a 100644 --- a/source/cl_ents.c +++ b/source/cl_ents.c @@ -560,7 +560,7 @@ CL_LinkPacketEntities (void) ent->skinnum = s1->skinnum; // set frame - ent->pose1 = ent->pose2 = ent->frame = s1->frame; + ent->frame = s1->frame; if (model->flags & EF_ROTATE) { // rotate binary objects locally ent->angles[0] = 0; @@ -968,6 +968,8 @@ CL_LinkPlayers (void) ent = &cl_visedicts[cl_numvisedicts]; cl_numvisedicts++; + ent->frame = state->frame; + // scan the old entity display list for a matching player for (i = 0; i < cl_oldnumvisedicts; i++) { if (cl_oldvisedicts[i].keynum == state->number) { @@ -981,9 +983,6 @@ CL_LinkPlayers (void) ent->keynum = 0; ent->model = cl.model_precache[state->modelindex]; ent->skinnum = state->skinnum; - ent->pose1 = ent->pose2 = ent->frame = state->frame; - ent->frame_start_time = 0; - ent->frame_interval = 0; ent->colormap = info->translations; if (state->modelindex == cl_playerindex) ent->scoreboard = info; // use custom skin diff --git a/source/gl_rmain.c b/source/gl_rmain.c index 615cf50..9fad3f4 100644 --- a/source/gl_rmain.c +++ b/source/gl_rmain.c @@ -655,13 +655,15 @@ R_SetupAliasBlendedFrame (int frame, aliashdr_t *paliashdr, entity_t *e, qboolea e->frame_interval = paliashdr->frames[frame].interval; pose += (int) (cl.time / e->frame_interval) % numposes; } else { - /* One tenth of a second is a good for most Quake animations. If the - nextthink is longer then the animation is usually meant to pause - (e.g. check out the shambler magic animation in shambler.qc). If - its shorter then things will still be smoothed partly, and the - jumps will be less noticable because of the shorter time. So, - this is probably a good assumption. */ - e->frame_interval = 0.2; + /* + One tenth of a second is a good for most Quake animations. If the + nextthink is longer then the animation is usually meant to pause + (e.g. check out the shambler magic animation in shambler.qc). If + its shorter then things will still be smoothed partly, and the + jumps will be less noticable because of the shorter time. So, + this is probably a good assumption. + */ + e->frame_interval = 0.1; } if (e->pose2 != pose) { @@ -671,12 +673,11 @@ R_SetupAliasBlendedFrame (int frame, aliashdr_t *paliashdr, entity_t *e, qboolea blend = 0; } else { blend = (realtime - e->frame_start_time) / e->frame_interval; - blend = min (blend, 1); } -// Sys_Printf ("numposes: %d, pose1: %d, pose2: %d\n", numposes, e->pose1, e->pose2); + // Con_DPrintf ("numposes: %d, poses: %d %d\n", numposes, e->pose1, e->pose2); // wierd things start happening if blend passes 1 - if (cl.paused) + if (cl.paused || blend > 1) blend = 1; GL_DrawAliasBlendedFrame (paliashdr, e->pose1, e->pose2, blend, fb); @@ -831,11 +832,11 @@ R_DrawAliasModel (entity_t *e) if (clmodel->hasfullbrights && gl_fb_models->int_val && paliashdr->gl_fb_texturenum[currententity->skinnum][anim]) { glBindTexture (GL_TEXTURE_2D, paliashdr->gl_fb_texturenum[currententity->skinnum][anim]); - if (gl_lerp_anim->int_val && !torch) { + if (gl_lerp_anim->int_val && !torch) { R_SetupAliasBlendedFrame (currententity->frame, paliashdr, currententity, true); - } else { + } else { R_SetupAliasFrame (currententity->frame, paliashdr, true); - } + } } if (gl_affinemodels->int_val)