- // temporary working space for client data building
- // 0-255 priority level, 0 = don't send
- qbyte priorities[MAX_EDICTS];
- // this is the visible entity numbers, sorted by their priority level
- int numentitylist;
- int entitylist[MAX_EDICTS];
+ // number of the latest message sent to client
+ int latestframenum;
+ // updated by WriteFrame for internal use
+ int viewentnum;
+
+ // logs of all recently sent messages (between acked and latest)
+ entityframe5_packetlog_t packetlog[ENTITYFRAME5_MAXPACKETLOGS];
+
+ // this goes up as needed and causes all the arrays to be reallocated
+ int maxedicts;
+
+ // which properties of each entity have changed since last send
+ int *deltabits; // [maxedicts]
+ // priorities of entities (updated whenever deltabits change)
+ // (derived from deltabits)
+ qbyte *priorities; // [maxedicts]
+ // last frame this entity was sent on, for prioritzation
+ int *updateframenum; // [maxedicts]
+
+ // database of current status of all entities
+ entity_state_t *states; // [maxedicts]
+ // which entities are currently active
+ // (duplicate of the active bit of every state in states[])
+ // (derived from states)
+ qbyte *visiblebits; // [(maxedicts+7)/8]
+
+ // delta compression of stats
+ qbyte statsdeltabits[(MAX_CL_STATS+7)/8];
+ int stats[MAX_CL_STATS];
+
+ // old notes
+
+ // this is used to decide which changestates to set each frame
+ //int numvisiblestates;
+ //entity_state_t visiblestates[MAX_EDICTS];
+
+ // sorted changing states that need to be sent to the client
+ // kept sorted in lowest to highest priority order, because this allows
+ // the numchangestates to simply be decremented whenever an state is sent,
+ // rather than a memmove to remove them from the start.
+ //int numchangestates;
+ //entityframe5_changestate_t changestates[MAX_EDICTS];