5 // the CG state is reset quite harshly each time the client
6 // connects/disconnects (to enforce the idea of cgame dying between levels),
7 // and the Pre/PostNetworkFrame functions are only called while connected
8 // (this does mean that all memory is freed, Init will be called again, etc)
10 typedef struct cgdrawentity_s
16 int model; // index gotten from engine using CGVM_Model
24 typedef struct cgdrawlight_s
32 typedef struct cgphysentity_s
34 int entnum; // reported by tracing, for use by cgame code
35 int padding; // unused
41 // engine functions the CG code can call
42 void CGVM_RegisterNetworkCode(const unsigned char num, void (*netcode)(unsigned char num));
43 unsigned char CGVM_MSG_ReadByte(void);
44 short CGVM_MSG_ReadShort(void);
45 int CGVM_MSG_ReadLong(void);
46 float CGVM_MSG_ReadFloat(void);
47 float CGVM_MSG_ReadCoord(void);
48 float CGVM_MSG_ReadAngle(void);
49 float CGVM_MSG_ReadPreciseAngle(void);
50 void CGVM_Draw_Entity(const cgdrawentity_t *e);
51 void CGVM_Draw_Light(const cgdrawlight_t *l);
52 void *CGVM_Malloc(const int size);
53 void CGVM_Free(void *mem);
54 float CGVM_RandomRange(const float r1, const float r2);
55 float CGVM_TracePhysics(const float *start, const float *end, const float *worldmins, const float *worldmaxs, const float *entitymins, const float *entitymaxs, const cgphysentity_t *physentities, const int numphysentities, float *impactpos, float *impactnormal, int *impactentnum);
56 float CGVM_GetCvarFloat(const char *name);
57 int CGVM_GetCvarInt(const char *name);
58 char *CGVM_GetCvarString(const char *name);
59 double CGVM_Time(void);
60 int CGVM_Model(const char *name);
61 void CGVM_Stain(const float *origin, float radius, int cr1, int cg1, int cb1, int ca1, int cr2, int cg2, int cb2, int ca2);
64 // engine called functions
66 void CG_Frame(double time);
67 // more might be added