I have decided to rewrite most of the code inside cgame, by slowly deactivating old code and migrating to newer code. However, i’m not completely sure about the Quake 3 architecture. Is there any other dependency between cgame and the engine, other than the vmMain and the events it receives?
There seems to be some tight coupling with other parts of the system, and i’m afraid about global variables and shared global state. Or is it really completely isolate and i should just care about vmMain and drawing the current frame properly?
There is also cg_syscalls.c which shares some types defined in cg_public.h with code/client (and code/client is a part of the engine). One example is snapshot_t which must be the same between the client and cgame, because the CG_GETSNAPSHOT syscall writes to wherever the snapshot_t pointer points to.