mirror of
https://git.code.sf.net/p/quake/newtree
synced 2025-05-31 01:00:53 +00:00
Okay, that's it. Model animation interpolation is as done as it's going to
get with the QW protocol.
This commit is contained in:
parent
b7bb19e57a
commit
3b6b929841
2 changed files with 17 additions and 17 deletions
|
@ -560,7 +560,7 @@ CL_LinkPacketEntities (void)
|
||||||
ent->skinnum = s1->skinnum;
|
ent->skinnum = s1->skinnum;
|
||||||
|
|
||||||
// set frame
|
// set frame
|
||||||
ent->pose1 = ent->pose2 = ent->frame = s1->frame;
|
ent->frame = s1->frame;
|
||||||
|
|
||||||
if (model->flags & EF_ROTATE) { // rotate binary objects locally
|
if (model->flags & EF_ROTATE) { // rotate binary objects locally
|
||||||
ent->angles[0] = 0;
|
ent->angles[0] = 0;
|
||||||
|
@ -968,6 +968,8 @@ CL_LinkPlayers (void)
|
||||||
ent = &cl_visedicts[cl_numvisedicts];
|
ent = &cl_visedicts[cl_numvisedicts];
|
||||||
cl_numvisedicts++;
|
cl_numvisedicts++;
|
||||||
|
|
||||||
|
ent->frame = state->frame;
|
||||||
|
|
||||||
// scan the old entity display list for a matching player
|
// scan the old entity display list for a matching player
|
||||||
for (i = 0; i < cl_oldnumvisedicts; i++) {
|
for (i = 0; i < cl_oldnumvisedicts; i++) {
|
||||||
if (cl_oldvisedicts[i].keynum == state->number) {
|
if (cl_oldvisedicts[i].keynum == state->number) {
|
||||||
|
@ -981,9 +983,6 @@ CL_LinkPlayers (void)
|
||||||
ent->keynum = 0;
|
ent->keynum = 0;
|
||||||
ent->model = cl.model_precache[state->modelindex];
|
ent->model = cl.model_precache[state->modelindex];
|
||||||
ent->skinnum = state->skinnum;
|
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;
|
ent->colormap = info->translations;
|
||||||
if (state->modelindex == cl_playerindex)
|
if (state->modelindex == cl_playerindex)
|
||||||
ent->scoreboard = info; // use custom skin
|
ent->scoreboard = info; // use custom skin
|
||||||
|
|
|
@ -655,13 +655,15 @@ R_SetupAliasBlendedFrame (int frame, aliashdr_t *paliashdr, entity_t *e, qboolea
|
||||||
e->frame_interval = paliashdr->frames[frame].interval;
|
e->frame_interval = paliashdr->frames[frame].interval;
|
||||||
pose += (int) (cl.time / e->frame_interval) % numposes;
|
pose += (int) (cl.time / e->frame_interval) % numposes;
|
||||||
} else {
|
} 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
|
One tenth of a second is a good for most Quake animations. If the
|
||||||
(e.g. check out the shambler magic animation in shambler.qc). If
|
nextthink is longer then the animation is usually meant to pause
|
||||||
its shorter then things will still be smoothed partly, and the
|
(e.g. check out the shambler magic animation in shambler.qc). If
|
||||||
jumps will be less noticable because of the shorter time. So,
|
its shorter then things will still be smoothed partly, and the
|
||||||
this is probably a good assumption. */
|
jumps will be less noticable because of the shorter time. So,
|
||||||
e->frame_interval = 0.2;
|
this is probably a good assumption.
|
||||||
|
*/
|
||||||
|
e->frame_interval = 0.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e->pose2 != pose) {
|
if (e->pose2 != pose) {
|
||||||
|
@ -671,12 +673,11 @@ R_SetupAliasBlendedFrame (int frame, aliashdr_t *paliashdr, entity_t *e, qboolea
|
||||||
blend = 0;
|
blend = 0;
|
||||||
} else {
|
} else {
|
||||||
blend = (realtime - e->frame_start_time) / e->frame_interval;
|
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
|
// wierd things start happening if blend passes 1
|
||||||
if (cl.paused)
|
if (cl.paused || blend > 1)
|
||||||
blend = 1;
|
blend = 1;
|
||||||
|
|
||||||
GL_DrawAliasBlendedFrame (paliashdr, e->pose1, e->pose2, blend, fb);
|
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 &&
|
if (clmodel->hasfullbrights && gl_fb_models->int_val &&
|
||||||
paliashdr->gl_fb_texturenum[currententity->skinnum][anim]) {
|
paliashdr->gl_fb_texturenum[currententity->skinnum][anim]) {
|
||||||
glBindTexture (GL_TEXTURE_2D, 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);
|
R_SetupAliasBlendedFrame (currententity->frame, paliashdr, currententity, true);
|
||||||
} else {
|
} else {
|
||||||
R_SetupAliasFrame (currententity->frame, paliashdr, true);
|
R_SetupAliasFrame (currententity->frame, paliashdr, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gl_affinemodels->int_val)
|
if (gl_affinemodels->int_val)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue