]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
replaced cl.movement_queue with direct use of cl.movecmd array, this
[xonotic/darkplaces.git] / cl_parse.c
index 0cb0133e5fbc74f55f34adb4bef490bebdc7b225..e002e6004b63ea15e7477e2c736b28cafffd2e21 100644 (file)
@@ -94,6 +94,9 @@ char *svc_strings[128] =
        "svc_entities", //                      57              // [int] deltaframe [int] thisframe [float vector] eye [variable length] entitydata
        "svc_csqcentities", //          58              // [short] entnum [variable length] entitydata ... [short] 0x0000
        "svc_spawnstaticsound2", //     59              // [coord3] [short] samp [byte] vol [byte] aten
+       "svc_trailparticles", //        60              // [short] entnum [short] effectnum [vector] start [vector] end
+       "svc_pointparticles", //        61              // [short] effectnum [vector] start [vector] velocity [short] count
+       "svc_pointparticles1", //       62              // [short] effectnum [vector] start, same as svc_pointparticles except velocity is zero and count is 1
 };
 
 char *qw_svc_strings[128] =
@@ -364,8 +367,9 @@ void CL_ParseEntityLump(char *entdata)
                else if (!strcmp("fog", key))
                {
                        r_refdef.fog_start = 0;
-                       r_refdef.fog_end = 1000000000;
-                       sscanf(value, "%f %f %f %f %f %f", &r_refdef.fog_density, &r_refdef.fog_red, &r_refdef.fog_green, &r_refdef.fog_blue, &r_refdef.fog_start, &r_refdef.fog_end);
+                       r_refdef.fog_alpha = 1;
+                       r_refdef.fog_end = 16384;
+                       sscanf(value, "%f %f %f %f %f %f %f", &r_refdef.fog_density, &r_refdef.fog_red, &r_refdef.fog_green, &r_refdef.fog_blue, &r_refdef.fog_alpha, &r_refdef.fog_start, &r_refdef.fog_end);
                }
                else if (!strcmp("fog_density", key))
                        r_refdef.fog_density = atof(value);
@@ -375,11 +379,19 @@ void CL_ParseEntityLump(char *entdata)
                        r_refdef.fog_green = atof(value);
                else if (!strcmp("fog_blue", key))
                        r_refdef.fog_blue = atof(value);
+               else if (!strcmp("fog_alpha", key))
+                       r_refdef.fog_alpha = atof(value);
+               else if (!strcmp("fog_start", key))
+                       r_refdef.fog_start = atof(value);
+               else if (!strcmp("fog_end", key))
+                       r_refdef.fog_end = atof(value);
        }
 }
 
 extern void CL_Locs_Reload_f(void);
 extern void CL_VM_Init (void);
+static const vec3_t defaultmins = {-4096, -4096, -4096};
+static const vec3_t defaultmaxs = {4096, 4096, 4096};
 static void CL_SetupWorldModel(void)
 {
        // update the world model
@@ -388,16 +400,9 @@ static void CL_SetupWorldModel(void)
 
        // set up csqc world for collision culling
        if (cl.worldmodel)
-       {
-               VectorCopy(cl.worldmodel->normalmins, cl.world.areagrid_mins);
-               VectorCopy(cl.worldmodel->normalmaxs, cl.world.areagrid_maxs);
-       }
+               World_SetSize(&cl.world, cl.worldmodel->name, cl.worldmodel->normalmins, cl.worldmodel->normalmaxs);
        else
-       {
-               VectorSet(cl.world.areagrid_mins, -4096, -4096, -4096);
-               VectorSet(cl.world.areagrid_maxs, 4096, 4096, 4096);
-       }
-       World_Clear(&cl.world);
+               World_SetSize(&cl.world, "", defaultmins, defaultmaxs);
 
        // load or reload .loc file for team chat messages
        CL_Locs_Reload_f();
@@ -528,9 +533,6 @@ static void QW_CL_RequestNextDownload(void)
 
                cls.qw_downloadtype = dl_none;
 
-               // parse the Q3 shader files
-               Mod_LoadQ3Shaders();
-
                // touch all of the precached models that are still loaded so we can free
                // anything that isn't needed
                if (!sv.active)
@@ -997,10 +999,6 @@ void CL_BeginDownloads(qboolean aborteddownload)
        {
                // loading models
 
-               // parse the Q3 shader files
-               if (cl.loadmodel_current < 2)
-                       Mod_LoadQ3Shaders();
-
                for (;cl.loadmodel_current < cl.loadmodel_total;cl.loadmodel_current++)
                {
                        if (cl.model_precache[cl.loadmodel_current] && cl.model_precache[cl.loadmodel_current]->Draw)
@@ -1156,7 +1154,7 @@ void CL_BeginDownloads_f(void)
        // prevent cl_begindownloads from being issued multiple times in one match
        // to prevent accidentally cancelled downloads
        if(cl.loadbegun)
-               Con_DPrintf("cl_begindownloads is only valid once per match\n");
+               Con_Printf("cl_begindownloads is only valid once per match\n");
        else
                CL_BeginDownloads(false);
 }
@@ -1282,6 +1280,7 @@ void CL_DownloadBegin_f(void)
 
 void CL_StopDownload_f(void)
 {
+       Curl_CancelAll();
        if (cls.qw_downloadname[0])
        {
                Con_Printf("Download of %s aborted\n", cls.qw_downloadname);
@@ -1338,7 +1337,8 @@ An svc_signonnum has been received, perform a client side setup
 */
 static void CL_SignonReply (void)
 {
-       Con_DPrintf("CL_SignonReply: %i\n", cls.signon);
+       if (developer.integer >= 100)
+               Con_Printf("CL_SignonReply: %i\n", cls.signon);
 
        switch (cls.signon)
        {
@@ -1916,7 +1916,6 @@ void CL_ParseStatic (int large)
        ent->render.framelerp = 0;
        // make torchs play out of sync
        ent->render.frame1time = ent->render.frame2time = lhrandom(-10, -1);
-       ent->render.colormap = -1; // no special coloring
        ent->render.skinnum = ent->state_baseline.skin;
        ent->render.effects = ent->state_baseline.effects;
        ent->render.alpha = 1;
@@ -2961,7 +2960,7 @@ static void CL_NetworkTimeReceived(double newtime)
        }
        // this packet probably contains a player entity update, so we will need
        // to update the prediction
-       cl.movement_needupdate = true;
+       cl.movement_replay = true;
        // this may get updated later in parsing by svc_clientdata
        cl.onground = false;
        // if true the cl.viewangles are interpolated from cl.mviewangles[]
@@ -2973,7 +2972,7 @@ static void CL_NetworkTimeReceived(double newtime)
                VectorCopy(cl.mviewangles[0], cl.mviewangles[1]);
 }
 
-#define SHOWNET(x) if(cl_shownet.integer==2)Con_Printf("%3i:%s\n", msg_readcount-1, x);
+#define SHOWNET(x) if(cl_shownet.integer==2)Con_Printf("%3i:%s(%i)\n", msg_readcount-1, x, cmd);
 
 //[515]: csqc
 qboolean CL_VM_Parse_TempEntity (void);
@@ -3335,14 +3334,20 @@ void CL_ParseServerMessage(void)
                                EntityFrameQW_CL_ReadFrame(false);
                                // first update is the final signon stage
                                if (cls.signon == SIGNONS - 1)
+                               {
                                        cls.signon = SIGNONS;
+                                       CL_SignonReply ();
+                               }
                                break;
 
                        case qw_svc_deltapacketentities:
                                EntityFrameQW_CL_ReadFrame(true);
                                // first update is the final signon stage
                                if (cls.signon == SIGNONS - 1)
+                               {
                                        cls.signon = SIGNONS;
+                                       CL_SignonReply ();
+                               }
                                break;
 
                        case qw_svc_maxspeed: