]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
clean up, r_farclip cvar, lit particles (optional), stuff
[xonotic/darkplaces.git] / cl_parse.c
index b1f240b073493384256b3de6df599c4f3c17ba49..e7b0cb74eda1d05862c971133abea6e25228a3fa 100644 (file)
@@ -80,7 +80,7 @@ char *svc_strings[] =
        "?", // 47
        "?", // 48
        "?", // 49
-       "svc_skyboxsize", // [coord] size
+       "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
 };
 
@@ -103,7 +103,7 @@ entity_t    *CL_EntityNum (int num)
                        Host_Error ("CL_EntityNum: %i is an invalid number",num);
                while (cl.num_entities<=num)
                {
-                       cl_entities[cl.num_entities].colormap = vid.colormap;
+                       cl_entities[cl.num_entities].colormap = 0; //vid.colormap;
                        cl.num_entities++;
                }
        }
@@ -223,6 +223,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 +233,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 +262,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);
@@ -513,7 +514,7 @@ void CL_ParseUpdate (int bits)
                else
                        forcelink = true;       // hack to make null model players work
                if (num > 0 && num <= cl.maxclients)
-                       R_TranslatePlayerSkin (num - 1);
+                       R_TranslatePlayerSkin(num - 1);
        }
 
        ent->frame = ((bits & U_FRAME) ? MSG_ReadByte() : (baseline->frame & 0xFF));
@@ -521,12 +522,12 @@ void CL_ParseUpdate (int bits)
        i = bits & U_COLORMAP ? MSG_ReadByte() : baseline->colormap;
        ent->deltabaseline.colormap = i;
        if (!i)
-               ent->colormap = vid.colormap;
+               ent->colormap = 0; //vid.colormap;
        else
        {
                if (i > cl.maxclients)
                        Host_Error ("i >= cl.maxclients");
-               ent->colormap = vid.colormap; // cl.scores[i-1].translations;
+               ent->colormap = i; //vid.colormap; // cl.scores[i-1].translations;
        }
 
        skin = bits & U_SKIN ? MSG_ReadByte() : baseline->skin;
@@ -534,7 +535,7 @@ void CL_ParseUpdate (int bits)
        {
                ent->skinnum = skin;
                if (num > 0 && num <= cl.maxclients)
-                       R_TranslatePlayerSkin (num - 1);
+                       R_TranslatePlayerSkin(num - 1);
        }
        ent->deltabaseline.skin = skin;
 
@@ -765,7 +766,7 @@ void CL_ParseStatic (void)
 // copy it to the current state
        ent->model = cl.model_precache[ent->baseline.modelindex];
        ent->frame = ent->baseline.frame;
-       ent->colormap = vid.colormap;
+       ent->colormap = 0; //vid.colormap;
        ent->skinnum = ent->baseline.skin;
        ent->effects = ent->baseline.effects;
        ent->alpha = 1;
@@ -959,7 +960,7 @@ void CL_ParseServerMessage (void)
                        if (i >= cl.maxclients)
                                Host_Error ("CL_ParseServerMessage: svc_updatecolors > MAX_SCOREBOARD");
                        cl.scores[i].colors = MSG_ReadByte ();
-                       R_TranslatePlayerSkin (i);
+                       R_TranslatePlayerSkin(i);
                        break;
                        
                case svc_particle:
@@ -983,19 +984,9 @@ void CL_ParseServerMessage (void)
                                cl.paused = MSG_ReadByte ();
 
                                if (cl.paused)
-                               {
                                        CDAudio_Pause ();
-#ifdef _WIN32
-                                       VID_HandlePause (true);
-#endif
-                               }
                                else
-                               {
                                        CDAudio_Resume ();
-#ifdef _WIN32
-                                       VID_HandlePause (false);
-#endif
-                               }
                        }
                        break;
                        
@@ -1064,12 +1055,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:
-                       /*r_skyboxsize.value = */MSG_ReadCoord();
+               case svc_farclip:
+                       r_farclip.value = MSG_ReadCoord();
                        break;
                case svc_fog:
                        if (MSG_ReadByte())