- sublerp = scene->framerate * (cl.time - r->frame1time);
- sub1 = (int) (sublerp);
- sub2 = sub1 + 1;
- sublerp -= sub1;
- if (!r_lerpmodels.integer)
- sublerp = 1;
- else if (sublerp >= (65535.0f / 65536.0f))
- sublerp = 1;
- else if (sublerp < (1.0f / 65536.0f))
- sublerp = 0;
- if (scene->loop)
- {
- sub1 = (sub1 % scene->framecount);
- sub2 = (sub2 % scene->framecount);
- }
- 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\
- if (d > 0)\
- {\
- for (i = 0;i < 4;i++)\
- {\
- if (blend[i].frame == f)\
- {\
- blend[i].lerp += d;\
- break;\
- }\
- if (blend[i].lerp <= 0)\
- {\
- blend[i].frame = f;\
- blend[i].lerp = d;\
- break;\
- }\
- }\
- }
- FRAMEBLENDINSERT
- f = sub2;
- d = sublerp * lerp;