]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_lerpanim.c
made packfile_t (describes a file in a pack) use fs_offset_t
[xonotic/darkplaces.git] / r_lerpanim.c
index b9f30a7f12a0d28b8414db56a5906c03be053dab..831a16e42380f33b4323cd66d4819bd7077527bc 100644 (file)
@@ -32,7 +32,10 @@ void R_LerpAnimation(entity_render_t *r)
 
        // 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