
Begin:
sys_win.c or sys_whatever.c
Main program loop:
1. Host_Frame (time); // host.c
-- 1a. _Host_Frame (time); // host.c
---- 1aa. IN_Commands // in_win.c on Windows, get mouse and joystick input
---- 1ab. Cbuf_Execute // Process console commands
---- 1ac. NET_Poll // net_main.c --- no idea what this does actually
---- 1ad. if (sv.active) CL_SendCmd ();
// Ok now this has to be single player or listen server
------ 1ada. CL_BaseMove (&cmd) // Get right, left, up, down and angles from keyboard
------ 1adb. IN_Move (&cmd) // Add mouse/joystick right/left/up/down and angles to movement
------ 1adc. CL_SendMove (&cmd) // Send the move to server (UNLESS we are playing back a demo)
------ 1add. NET_CanSendMessage // unless playing demo
------ 1ade. NET_SendMessage // unless playing demo
------ 1adf. SZ_Clear (&cls.message); // I guess this is clearing the message for next time
// End single and listen server send input
// Back to _Host_Frame
---- 1ae. Host_GetConsoleCommands (); // Not 100% sure.
---- 1af. if (sv.active) Host_ServerFrame ();
------ 1afa.SV_ClearDatagram (); // I don't know what a datagram is.
------ 1afb. SV_CheckForNewClients (); //
------ 1afc. SV_RunClients (); // Read client messages
------ 1afd. SV_Physics (); // Obvious
// Begin physics
-------- 1afda. PR_ExecuteProgram // Run the QuakeC
-------- 1afdb. Physics: Loop thru all entities and run physics based
on MOVETYPE
// End physics - back to Host_ServerFrame ();
------ 1afe. SV_SendClientMessages (); // Send messages to clients
//End of Host_ServerFrame -- back to _Host_Frame
---- 1ag. if (!sv.active) CL_SendCmd (); // If client only, send commands
---- 1ah. if (cls.state == ca_connected) CL_ReadFromServer (); // If connected read from server
---- 1ai. SCR_UpdateScreen (); // Worthy of exploration
---- 1aj. S_Update (r_origin, vpn, vright, vup); // Sound update from current position
---- 1ak. CL_DecayLights
End