]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
fixed chase_active (TraceLine no longer returns '0 0 0' when there was no impact)
[xonotic/darkplaces.git] / cl_parse.c
index 38acf24afae175e06fe0bb8197ba97d6659904c4..75d53fe7dec5bfa883829778a57c4b86b0ce2afb 100644 (file)
@@ -80,13 +80,15 @@ char *svc_strings[] =
        "?", // 47
        "?", // 48
        "?", // 49
-       "svc_skyboxsize", // [coord] size
-       "svc_fog" // [byte] enable <optional past this point, only included if enable is true> [short * 4096] density [byte] red [byte] green [byte] blue
+       "svc_farclip", // [coord] size
+       "svc_fog", // [byte] enable <optional past this point, only included if enable is true> [short * 4096] density [byte] red [byte] green [byte] blue
+       "svc_playerposition" // [float] x [float] y [float] z
 };
 
 //=============================================================================
 
-int Nehahrademcompatibility; // LordHavoc: to allow playback of the early Nehahra movie segments
+qboolean Nehahrademcompatibility; // LordHavoc: to allow playback of the early Nehahra movie segments
+qboolean dpprotocol; // LordHavoc: whether or not the current network stream is the enhanced DarkPlaces protocol
 
 /*
 ===============
@@ -223,6 +225,7 @@ extern float fog_green;
 extern float fog_blue;
 extern void R_SetSkyBox (char *sky);
 extern void FOG_clear();
+extern cvar_t r_farclip;
 
 void CL_ParseEntityLump(char *entdata)
 {
@@ -232,7 +235,7 @@ void CL_ParseEntityLump(char *entdata)
        int i, j, k;
        FOG_clear(); // LordHavoc: no fog until set
        skyname[0] = 0; // LordHavoc: no enviroment mapped sky until set
-//     r_skyboxsize.value = 4096; // LordHavoc: default skyboxsize
+       r_farclip.value = 6144; // LordHavoc: default farclip distance
        data = entdata;
        if (!data)
                return;
@@ -261,12 +264,12 @@ void CL_ParseEntityLump(char *entdata)
                        R_SetSkyBox(value);
                else if (!strcmp("qlsky", key)) // non-standard, introduced by QuakeLives (EEK)
                        R_SetSkyBox(value);
-//             else if (!strcmp("skyboxsize", key))
-//             {
-//                     r_skyboxsize.value = atof(value);
-//                     if (r_skyboxsize.value < 64)
-//                             r_skyboxsize.value = 64;
-//             }
+               else if (!strcmp("farclip", key))
+               {
+                       r_farclip.value = atof(value);
+                       if (r_farclip.value < 64)
+                               r_farclip.value = 64;
+               }
                else if (!strcmp("fog", key))
                {
                        scanf(value, "%f %f %f %f", &fog_density, &fog_red, &fog_green, &fog_blue);
@@ -342,6 +345,7 @@ void CL_ParseServerInfo (void)
                Nehahrademcompatibility = true;
        if (cls.demoplayback && demo_nehahra.value)
                Nehahrademcompatibility = true;
+       dpprotocol = i == DPPROTOCOL_VERSION;
 
 // parse maxclients
        cl.maxclients = MSG_ReadByte ();
@@ -572,7 +576,7 @@ void CL_ParseUpdate (int bits)
        ent->deltabaseline.frame = ent->frame;
        ent->alpha = (float) alpha * (1.0 / 255.0);
        ent->scale = (float) scale * (1.0 / 16.0);
-       ent->glowsize = glowsize < 128 ? glowsize * 8.0 : (glowsize - 256) * 8.0;
+       ent->glowsize = glowsize * 4.0;
        ent->glowcolor = glowcolor;
        ent->colormod[0] = (float) ((colormod >> 5) & 7) * (1.0 / 7.0);
        ent->colormod[1] = (float) ((colormod >> 2) & 7) * (1.0 / 7.0);
@@ -1054,13 +1058,12 @@ void CL_ParseServerMessage (void)
                case svc_showlmp:
                        SHOWLMP_decodeshow();
                        break;
-       // LordHavoc: extra worldspawn fields (fog, sky, skyboxsize)
+       // LordHavoc: extra worldspawn fields (fog, sky, farclip)
                case svc_skybox:
                        R_SetSkyBox(MSG_ReadString());
                        break;
-               case svc_skyboxsize:
-                       i = MSG_ReadCoord();
-                       // r_skyboxsize.value = MSG_ReadCoord();
+               case svc_farclip:
+                       r_farclip.value = MSG_ReadCoord();
                        break;
                case svc_fog:
                        if (MSG_ReadByte())