changed all references to entity_render_t->frame to frame2 to eliminate
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 17 Jun 2007 07:16:31 +0000 (07:16 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 17 Jun 2007 07:16:31 +0000 (07:16 +0000)
the unnecessary field

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7437 d7cf8633-e32d-0410-b094-e92efae38249

cl_collision.c
cl_main.c
cl_parse.c
client.h
clvm_cmds.c
csprogs.c
gl_rmain.c

index 9698027..e4f0c36 100644 (file)
@@ -254,7 +254,7 @@ trace_t CL_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const
                        entity_render_t *ent = &cl.entities[cl.brushmodel_entities[i]].render;
                        if (!BoxesOverlap(clipboxmins, clipboxmaxs, ent->mins, ent->maxs))
                                continue;
-                       Collision_ClipToGenericEntity(&trace, ent->model, ent->frame, vec3_origin, vec3_origin, 0, &ent->matrix, &ent->inversematrix, start, mins, maxs, end, hitsupercontentsmask);
+                       Collision_ClipToGenericEntity(&trace, ent->model, ent->frame2, vec3_origin, vec3_origin, 0, &ent->matrix, &ent->inversematrix, start, mins, maxs, end, hitsupercontentsmask);
                        if (cliptrace.realfraction > trace.realfraction && hitnetworkentity)
                                *hitnetworkentity = cl.brushmodel_entities[i];
                        Collision_CombineTraces(&cliptrace, &trace, NULL, true);
index ad928ca..edbcd5b 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -440,7 +440,7 @@ static void CL_PrintEntities_f(void)
                        modelname = ent->render.model->name;
                else
                        modelname = "--no model--";
-               Con_Printf("%3i: %-25s:%4i (%5i %5i %5i) [%3i %3i %3i] %4.2f %5.3f\n", i, modelname, ent->render.frame, (int) ent->state_current.origin[0], (int) ent->state_current.origin[1], (int) ent->state_current.origin[2], (int) ent->state_current.angles[0] % 360, (int) ent->state_current.angles[1] % 360, (int) ent->state_current.angles[2] % 360, ent->render.scale, ent->render.alpha);
+               Con_Printf("%3i: %-25s:%4i (%5i %5i %5i) [%3i %3i %3i] %4.2f %5.3f\n", i, modelname, ent->render.frame2, (int) ent->state_current.origin[0], (int) ent->state_current.origin[1], (int) ent->state_current.origin[2], (int) ent->state_current.angles[0] % 360, (int) ent->state_current.angles[1] % 360, (int) ent->state_current.angles[2] % 360, ent->render.scale, ent->render.alpha);
        }
 }
 
@@ -996,7 +996,7 @@ void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qboolean interpolat
                // begin a new frame lerp
                e->render.frame1 = e->render.frame2;
                e->render.frame1time = e->render.frame2time;
-               e->render.frame = e->render.frame2 = e->state_current.frame;
+               e->render.frame2 = e->state_current.frame;
                e->render.frame2time = cl.time;
                e->render.framelerp = 0;
        }
@@ -1231,7 +1231,7 @@ void CL_UpdateViewModel(void)
        // reset animation interpolation on weaponmodel if model changed
        if (ent->state_previous.modelindex != ent->state_current.modelindex)
        {
-               ent->render.frame = ent->render.frame1 = ent->render.frame2 = ent->state_current.frame;
+               ent->render.frame1 = ent->render.frame2 = ent->state_current.frame;
                ent->render.frame1time = ent->render.frame2time = cl.time;
                ent->render.framelerp = 1;
        }
@@ -1512,7 +1512,6 @@ static void CL_RelinkEffects(void)
                                        ent->render.model = cl.model_precache[e->modelindex];
                                else
                                        ent->render.model = cl.csqc_model_precache[-(e->modelindex+1)];
-                               ent->render.frame = ent->render.frame2;
                                ent->render.colormap = -1; // no special coloring
                                ent->render.alpha = 1;
                                VectorSet(ent->render.colormod, 1, 1, 1);
index 4341a3c..4deb471 100644 (file)
@@ -1666,7 +1666,7 @@ void CL_MoveLerpEntityStates(entity_t *ent)
                VectorCopy(ent->state_current.origin, ent->persistent.neworigin);
                VectorCopy(ent->state_current.angles, ent->persistent.newangles);
                // reset animation interpolation as well
-               ent->render.frame = ent->render.frame1 = ent->render.frame2 = ent->state_current.frame;
+               ent->render.frame1 = ent->render.frame2 = ent->state_current.frame;
                ent->render.frame1time = ent->render.frame2time = cl.time;
                ent->render.framelerp = 1;
                // reset various persistent stuff
@@ -1895,7 +1895,7 @@ void CL_ParseStatic (int large)
 
 // copy it to the current state
        ent->render.model = cl.model_precache[ent->state_baseline.modelindex];
-       ent->render.frame = ent->render.frame1 = ent->render.frame2 = ent->state_baseline.frame;
+       ent->render.frame1 = ent->render.frame2 = ent->state_baseline.frame;
        ent->render.framelerp = 0;
        // make torchs play out of sync
        ent->render.frame1time = ent->render.frame2time = lhrandom(-10, -1);
index 329d192..e30360b 100644 (file)
--- a/client.h
+++ b/client.h
@@ -243,8 +243,6 @@ typedef struct entity_render_s
 
        // NULL = no model
        model_t *model;
-       // current uninterpolated animation frame (for things which do not use interpolation)
-       int frame;
        // number of the entity represents, or 0 for non-network entities
        int entitynumber;
        // entity shirt and pants colors (-1 if not colormapped)
index e3e8918..c40d668 100644 (file)
@@ -1179,7 +1179,7 @@ static void VM_CL_makestatic (void)
 
                // copy it to the current state
                staticent->render.model = CL_GetModelByIndex((int)ent->fields.client->modelindex);
-               staticent->render.frame = staticent->render.frame1 = staticent->render.frame2 = (int)ent->fields.client->frame;
+               staticent->render.frame1 = staticent->render.frame2 = (int)ent->fields.client->frame;
                staticent->render.framelerp = 0;
                // make torchs play out of sync
                staticent->render.frame1time = staticent->render.frame2time = lhrandom(-10, -1);
index f2f2b6b..6a8b57c 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -112,7 +112,6 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed)
 
        e->render.model = model;
        e->render.colormap = (int)ed->fields.client->colormap;
-       e->render.frame = (int)ed->fields.client->frame;
        e->render.skinnum = (int)ed->fields.client->skin;
        e->render.effects |= e->render.model->effects;
        scale = 1;
@@ -159,8 +158,8 @@ qboolean CSQC_AddRenderEdict(prvm_edict_t *ed)
        // self.frame1time is the animation base time for the interpolation target
        // self.frame2 is the interpolation start (previous frame)
        // self.frame2time is the animation base time for the interpolation start
-       e->render.frame1 = e->render.frame = ed->fields.client->frame;
-       if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame2))) e->render.frame = val->_float;
+       e->render.frame1 = e->render.frame2 = ed->fields.client->frame;
+       if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame2))) e->render.frame2 = val->_float;
        if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame1time))) e->render.frame2time = val->_float;
        if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.frame2time))) e->render.frame1time = val->_float;
        if ((val = PRVM_EDICTFIELDVALUE(ed, prog->fieldoffsets.lerpfrac))) e->render.framelerp = val->_float;
index 3b7cfd3..2883c1b 100644 (file)
@@ -3255,7 +3255,7 @@ void R_UpdateTextureInfo(const entity_render_t *ent, texture_t *t)
                {
                        // use an alternate animation if the entity's frame is not 0,
                        // and only if the texture has an alternate animation
-                       if (ent->frame != 0 && t->anim_total[1])
+                       if (ent->frame2 != 0 && t->anim_total[1])
                                t = t->anim_frames[1][(t->anim_total[1] >= 2) ? ((int)(r_refdef.time * 5.0f) % t->anim_total[1]) : 0];
                        else
                                t = t->anim_frames[0][(t->anim_total[0] >= 2) ? ((int)(r_refdef.time * 5.0f) % t->anim_total[0]) : 0];