X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=r_lerpanim.c;h=831a16e42380f33b4323cd66d4819bd7077527bc;hb=8ba97159796cbbab3a88e2230f62adc8d422b5ce;hp=91b55bff88e3893e336796f31dc2d0dc0c6d03fd;hpb=db0e59eeca766dc6c747f546a682c56c15db8e32;p=xonotic%2Fdarkplaces.git diff --git a/r_lerpanim.c b/r_lerpanim.c index 91b55bff..831a16e4 100644 --- a/r_lerpanim.c +++ b/r_lerpanim.c @@ -11,7 +11,7 @@ void R_LerpAnimation(entity_render_t *r) animscene_t *scene; frameblend_t *blend; - if (!r->model) + if (!r->model || !r->model->type) return; blend = r->frameblend; @@ -20,19 +20,22 @@ void R_LerpAnimation(entity_render_t *r) if (r->frame1 >= numframes) { - Con_DPrintf ("CL_LerpAnimation: no such frame %d\n", r->frame1); + Con_DPrintf("CL_LerpAnimation: no such frame %d\n", r->frame1); r->frame1 = 0; } if (r->frame2 >= numframes) { - Con_DPrintf ("CL_LerpAnimation: no such frame %d\n", r->frame2); + Con_DPrintf("CL_LerpAnimation: no such frame %d\n", r->frame2); r->frame2 = 0; } // note: this could be removed, if the rendering code allows an empty blend array if (r->frame1 < 0) - Host_Error ("CL_LerpAnimation: frame1 is NULL\n"); + { + Con_Printf ("CL_LerpAnimation: frame1 is NULL\n"); + r->frame1 = 0; + } // check r_lerpmodels and round off very close blend percentages if (!r_lerpmodels.integer) @@ -68,13 +71,8 @@ void R_LerpAnimation(entity_render_t *r) sub1 = (sub1 % scene->framecount); sub2 = (sub2 % scene->framecount); } - else - { - sub1 = bound(0, sub1, (scene->framecount - 1)); - sub2 = bound(0, sub2, (scene->framecount - 1)); - } - sub1 += scene->firstframe; - sub2 += scene->firstframe; + sub1 = bound(0, sub1, (scene->framecount - 1)) + scene->firstframe; + sub2 = bound(0, sub2, (scene->framecount - 1)) + scene->firstframe; f = sub1; d = (1 - sublerp) * lerp; #define FRAMEBLENDINSERT\ @@ -128,13 +126,8 @@ void R_LerpAnimation(entity_render_t *r) sub1 = (sub1 % scene->framecount); sub2 = (sub2 % scene->framecount); } - else - { - sub1 = bound(0, sub1, (scene->framecount - 1)); - sub2 = bound(0, sub2, (scene->framecount - 1)); - } - sub1 += scene->firstframe; - sub2 += scene->firstframe; + sub1 = bound(0, sub1, (scene->framecount - 1)) + scene->firstframe; + sub2 = bound(0, sub2, (scene->framecount - 1)) + scene->firstframe; f = sub1; d = (1 - sublerp) * lerp; FRAMEBLENDINSERT