]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
sv_ents: Move shared function to com_ents
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 3 Aug 2020 19:25:45 +0000 (19:25 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 3 Aug 2020 19:25:45 +0000 (19:25 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12884 d7cf8633-e32d-0410-b094-e92efae38249

com_ents.c
sv_ents.c

index 9c9543d033174a2f271cac8657c7f7ccb4387df5..fe7a3bc1c27f1e5dcb65a3e368012df4549038dd 100644 (file)
@@ -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)
 {
index b89943356db94b006744ad37d168a154b494f32c..c0e1eaca1eb6a63ec3cb7d7e2f299dd8a6932521 100644 (file)
--- 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)
 {