to the main loop
renamed CL_ReadFromServer to CL_UpdateWorld, and it is now called even
if not connected (to clear the r_refdef entities/lights info, and the
num_brushmodels)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7116
d7cf8633-e32d-0410-b094-
e92efae38249
/*
===============
-CL_ReadFromServer
+CL_UpdateWorld
-Read all incoming data from the server
+Update client game world for a new frame
===============
*/
-int CL_ReadFromServer(void)
+void CL_UpdateWorld(void)
{
- CL_ReadDemoMessage();
- CL_SendMove();
-
- r_refdef.time = cl.time;
r_refdef.extraupdate = !r_speeds.integer;
r_refdef.numentities = 0;
r_refdef.numlights = 0;
// move particles
CL_MoveParticles();
R_MoveExplosions();
-
- // update the r_refdef time again because cl.time may have changed in
- // CL_LerpPoint()
- r_refdef.time = cl.time;
}
- return 0;
+ r_refdef.time = cl.time;
}
// LordHavoc: pausedemo command
void CL_SetInfo(const char *key, const char *value, qboolean send, qboolean allowstarkey, qboolean allowmodel, qboolean quiet);
-int CL_ReadFromServer (void);
+void CL_UpdateWorld (void);
void CL_WriteToServer (void);
void CL_Input (void);
extern qboolean cl_ignoremousemove;
// Collect input into cmd
CL_Input();
+ // check for new packets
NetConn_ClientFrame();
- if (cls.state == ca_connected)
- {
- CL_ReadFromServer();
- // if running the server remotely, send intentions now after
- // the incoming messages have been read
- //if (!cl.islocalgame)
- // CL_SendCmd();
- }
+ // read a new frame from a demo if needed
+ CL_ReadDemoMessage();
+
+ // now that packets have been read, send input to server
+ CL_SendMove();
+
+ // update client world (interpolate entities, create trails, etc)
+ CL_UpdateWorld();
// update video
if (host_speeds.integer)