From: cloudwalk Date: Mon, 3 Aug 2020 19:25:45 +0000 (+0000) Subject: sv_ents: Move shared function to com_ents X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8b93b0da800bec7a9b68976fbdce95bc34e09343;p=xonotic%2Fdarkplaces.git sv_ents: Move shared function to com_ents git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12884 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/com_ents.c b/com_ents.c index 9c9543d0..fe7a3bc1 100644 --- a/com_ents.c +++ b/com_ents.c @@ -13,6 +13,24 @@ void EntityFrame_FreeDatabase(entityframe_database_t *d) Mem_Free(d); } +// (client and server) clears the database to contain no frames (thus delta compression compresses against nothing) +void EntityFrame_ClearDatabase(entityframe_database_t *d) +{ + memset(d, 0, sizeof(*d)); +} + +// (client and server) clears frame, to prepare for adding entities +void EntityFrame_Clear(entity_frame_t *f, vec3_t eye, int framenum) +{ + f->time = 0; + f->framenum = framenum; + f->numentities = 0; + if (eye == NULL) + VectorClear(f->eye); + else + VectorCopy(eye, f->eye); +} + // (server and client) removes frames older than 'frame' from database void EntityFrame_AckFrame(entityframe_database_t *d, int frame) { diff --git a/sv_ents.c b/sv_ents.c index b8994335..c0e1eaca 100644 --- a/sv_ents.c +++ b/sv_ents.c @@ -210,24 +210,6 @@ void EntityState_WriteUpdate(const entity_state_t *ent, sizebuf_t *msg, const en } } -// (server) clears the database to contain no frames (thus delta compression compresses against nothing) -void EntityFrame_ClearDatabase(entityframe_database_t *d) -{ - memset(d, 0, sizeof(*d)); -} - -// (server) clears frame, to prepare for adding entities -void EntityFrame_Clear(entity_frame_t *f, vec3_t eye, int framenum) -{ - f->time = 0; - f->framenum = framenum; - f->numentities = 0; - if (eye == NULL) - VectorClear(f->eye); - else - VectorCopy(eye, f->eye); -} - // (server) adds a entity_frame to the database, for future reference void EntityFrame_AddFrame_Server(entityframe_database_t *d, vec3_t eye, int framenum, int numentities, const entity_state_t **entitydata) {