- ent->deltabaseline.skin = ent->skinnum = bits & U_SKIN ? MSG_ReadByte() : baseline->skin;
-
- ent->effects = ((bits & U_EFFECTS) ? MSG_ReadByte() : (baseline->effects & 0xFF));
-
-// shift the known values for interpolation
- VectorCopy (ent->msg_origins[0], ent->msg_origins[1]);
- VectorCopy (ent->msg_angles[0], ent->msg_angles[1]);
- VectorCopy (baseline->origin, ent->msg_origins[0]);
- VectorCopy (baseline->angles, ent->msg_angles[0]);
-
- if (bits & U_ORIGIN1) ent->msg_origins[0][0] = MSG_ReadCoord ();
- if (bits & U_ANGLE1) ent->msg_angles[0][0] = MSG_ReadAngle();
- if (bits & U_ORIGIN2) ent->msg_origins[0][1] = MSG_ReadCoord ();
- if (bits & U_ANGLE2) ent->msg_angles[0][1] = MSG_ReadAngle();
- if (bits & U_ORIGIN3) ent->msg_origins[0][2] = MSG_ReadCoord ();
- if (bits & U_ANGLE3) ent->msg_angles[0][2] = MSG_ReadAngle();
-
- VectorCopy(ent->msg_origins[0], ent->deltabaseline.origin);
- VectorCopy(ent->msg_angles[0], ent->deltabaseline.angles);
-
- alpha = bits & U_ALPHA ? MSG_ReadByte() : baseline->alpha;
- scale = bits & U_SCALE ? MSG_ReadByte() : baseline->scale;
- ent->effects |= ((bits & U_EFFECTS2) ? (MSG_ReadByte() << 8) : (baseline->effects & 0xFF00));
- glowsize = bits & U_GLOWSIZE ? MSG_ReadByte() : baseline->glowsize;
- glowcolor = bits & U_GLOWCOLOR ? MSG_ReadByte() : baseline->glowcolor;
- colormod = bits & U_COLORMOD ? MSG_ReadByte() : baseline->colormod;
- ent->frame |= ((bits & U_FRAME2) ? (MSG_ReadByte() << 8) : (baseline->frame & 0xFF00));
- ent->deltabaseline.alpha = alpha;
- ent->deltabaseline.scale = scale;
- ent->deltabaseline.effects = ent->effects;
- ent->deltabaseline.glowsize = glowsize;
- ent->deltabaseline.glowcolor = glowcolor;
- ent->deltabaseline.colormod = colormod;
- ent->deltabaseline.frame = ent->frame;
- ent->alpha = (float) alpha * (1.0 / 255.0);
- ent->scale = (float) scale * (1.0 / 16.0);
- ent->glowsize = glowsize * 4.0;
- ent->glowcolor = glowcolor;
- ent->colormod[0] = (float) ((colormod >> 5) & 7) * (1.0 / 7.0);
- ent->colormod[1] = (float) ((colormod >> 2) & 7) * (1.0 / 7.0);
- ent->colormod[2] = (float) (colormod & 3) * (1.0 / 3.0);
- if (bits & U_EXTEND1 && Nehahrademcompatibility) // LordHavoc: to allow playback of the early Nehahra movie segments
+ if (new.flags & RENDER_STEP) // FIXME: rename this flag?
+ {
+ // make time identical for memcmp
+ new.time = ent->state_current.time;
+ if (memcmp(&new, &ent->state_current, sizeof(entity_state_t)))
+ {
+ // state has changed
+ ent->state_previous = ent->state_current;
+ ent->state_current = new;
+ // assume 10fps animation
+ ent->state_previous.time = cl.mtime[0];
+ ent->state_current.time = cl.mtime[0] + 0.1; //ent->state_previous.time + 0.1;
+ }
+ }
+ else