mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
tiny optimisation to GL_GetAliasFrameVerts
This commit is contained in:
parent
73f9c3aaa5
commit
5d643c2483
1 changed files with 12 additions and 15 deletions
|
@ -285,6 +285,7 @@ GL_GetAliasFrameVerts (int frame, aliashdr_t *paliashdr, entity_t *e)
|
||||||
int count, numposes, pose, i;
|
int count, numposes, pose, i;
|
||||||
trivertx_t *verts;
|
trivertx_t *verts;
|
||||||
vert_order_t *vo;
|
vert_order_t *vo;
|
||||||
|
blended_vert_t *vo_v;
|
||||||
|
|
||||||
if ((frame >= paliashdr->mdl.numframes) || (frame < 0)) {
|
if ((frame >= paliashdr->mdl.numframes) || (frame < 0)) {
|
||||||
if (developer->int_val)
|
if (developer->int_val)
|
||||||
|
@ -351,16 +352,14 @@ GL_GetAliasFrameVerts (int frame, aliashdr_t *paliashdr, entity_t *e)
|
||||||
} else if (blend == 1) {
|
} else if (blend == 1) {
|
||||||
verts = verts2;
|
verts = verts2;
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0, vo_v = vo->verts; i < count;
|
||||||
vo->verts[i].vert[0] = verts1[i].v[0] * lerp
|
i++, vo_v++, verts1++, verts2++) {
|
||||||
+ verts2[i].v[0] * blend;
|
vo_v->vert[0] = verts1->v[0] * lerp + verts2->v[0] * blend;
|
||||||
vo->verts[i].vert[1] = verts1[i].v[1] * lerp
|
vo_v->vert[1] = verts1->v[1] * lerp + verts2->v[1] * blend;
|
||||||
+ verts2[i].v[1] * blend;
|
vo_v->vert[2] = verts1->v[2] * lerp + verts2->v[2] * blend;
|
||||||
vo->verts[i].vert[2] = verts1[i].v[2] * lerp
|
vo_v->lightdot =
|
||||||
+ verts2[i].v[2] * blend;
|
shadedots[verts1->lightnormalindex] * lerp
|
||||||
vo->verts[i].lightdot =
|
+ shadedots[verts2->lightnormalindex] * blend;
|
||||||
shadedots[verts1[i].lightnormalindex] * lerp
|
|
||||||
+ shadedots[verts2[i].lightnormalindex] * blend;
|
|
||||||
}
|
}
|
||||||
lastposenum0 = e->pose1;
|
lastposenum0 = e->pose1;
|
||||||
lastposenum = e->pose2;
|
lastposenum = e->pose2;
|
||||||
|
@ -369,11 +368,9 @@ GL_GetAliasFrameVerts (int frame, aliashdr_t *paliashdr, entity_t *e)
|
||||||
} else {
|
} else {
|
||||||
verts += pose * count;
|
verts += pose * count;
|
||||||
}
|
}
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0, vo_v = vo->verts; i < count; i++, vo_v++, verts++) {
|
||||||
vo->verts[i].vert[0] = verts[i].v[0];
|
VectorCopy (verts->v, vo_v->vert);
|
||||||
vo->verts[i].vert[1] = verts[i].v[1];
|
vo_v->lightdot = shadedots[verts->lightnormalindex];
|
||||||
vo->verts[i].vert[2] = verts[i].v[2];
|
|
||||||
vo->verts[i].lightdot = shadedots[verts[i].lightnormalindex];
|
|
||||||
}
|
}
|
||||||
lastposenum = pose;
|
lastposenum = pose;
|
||||||
return vo;
|
return vo;
|
||||||
|
|
Loading…
Reference in a new issue