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
31 typedef struct cgphysentity_s
33 int entnum; // reported by tracing, for use by cgame code
34 int padding; // unused
40 // engine functions the CG code can call
41 void CGVM_RegisterNetworkCode(const unsigned char num, void (*netcode)(unsigned char num));
42 unsigned char CGVM_MSG_ReadByte(void);
43 short CGVM_MSG_ReadShort(void);
44 int CGVM_MSG_ReadLong(void);
45 float CGVM_MSG_ReadFloat(void);
46 float CGVM_MSG_ReadCoord(void);
47 float CGVM_MSG_ReadAngle(void);
48 float CGVM_MSG_ReadPreciseAngle(void);
49 void CGVM_Draw_Entity(const cgdrawentity_t *e);
50 void CGVM_Draw_Light(const cgdrawlight_t *l);
51 void *CGVM_Malloc(const int size);
52 void CGVM_Free(void *mem);
53 float CGVM_RandomRange(const float r1, const float r2);
54 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);
55 float CGVM_GetCvarFloat(const char *name);
56 int CGVM_GetCvarInt(const char *name);
57 char *CGVM_GetCvarString(const char *name);
58 double CGVM_Time(void);
59 int CGVM_Model(const char *name);
62 // engine called functions
64 void CG_Frame(double time);
65 // more might be added