putting if outside the for loop should speed things up

This commit is contained in:
Seth Galbraith 2002-01-05 16:53:43 +00:00
parent ac5b6823c6
commit cb6ef3e225

View file

@ -303,12 +303,10 @@ GL_GetAliasFrameVerts (int frame, aliashdr_t *paliashdr, entity_t *e)
} else if (blend == 1) {
verts = verts2;
} else {
for (i = 0, vo_v = vo->verts; i < count;
i++, vo_v++, verts1++, verts2++) {
if (paliashdr->mdl.ident == POLYHEADER16)
{
for (j = 0; j < 3; j++)
{
if (paliashdr->mdl.ident == POLYHEADER16) {
for (i = 0, vo_v = vo->verts; i < count;
i++, vo_v++, verts1++, verts2++) {
for (j = 0; j < 3; j++) {
v1[j] = verts1->v[j] + (verts1
+ count)->v[j] /
(float)256;
@ -317,12 +315,19 @@ GL_GetAliasFrameVerts (int frame, aliashdr_t *paliashdr, entity_t *e)
(float)256;
}
VectorBlend (v1, v2, blend, vo_v->vert);
vo_v->lightdot =
shadedots[verts1->lightnormalindex] * (1 - blend)
+ shadedots[verts2->lightnormalindex] * blend;
}
else
}
else {
for (i = 0, vo_v = vo->verts; i < count;
i++, vo_v++, verts1++, verts2++) {
VectorBlend (verts1->v, verts2->v, blend, vo_v->vert);
vo_v->lightdot =
shadedots[verts1->lightnormalindex] * (1 - blend)
+ shadedots[verts2->lightnormalindex] * blend;
vo_v->lightdot =
shadedots[verts1->lightnormalindex] * (1 - blend)
+ shadedots[verts2->lightnormalindex] * blend;
}
}
lastposenum0 = e->pose1;
lastposenum = e->pose2;
@ -334,14 +339,16 @@ GL_GetAliasFrameVerts (int frame, aliashdr_t *paliashdr, entity_t *e)
else
verts += pose * count;
}
for (i = 0, vo_v = vo->verts; i < count; i++, vo_v++, verts++) {
if (paliashdr->mdl.ident == POLYHEADER16)
{
if (paliashdr->mdl.ident == POLYHEADER16) {
for (i = 0, vo_v = vo->verts; i < count; i++, vo_v++, verts++) {
for (j = 0; j < 3; j++)
vo_v->vert[j] = verts->v[j] + (verts +
count)->v[j] / (float)256;
}
else
vo_v->lightdot = shadedots[verts->lightnormalindex];
}
else {
for (i = 0, vo_v = vo->verts; i < count; i++, vo_v++, verts++)
VectorCopy (verts->v, vo_v->vert);
vo_v->lightdot = shadedots[verts->lightnormalindex];
}