]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
combined glClear calls, may be a speedup
[xonotic/darkplaces.git] / cl_parse.c
index e7b0cb74eda1d05862c971133abea6e25228a3fa..028dda200500bbcde5659ca024179f697ebab831 100644 (file)
@@ -81,12 +81,14 @@ char *svc_strings[] =
        "?", // 48
        "?", // 49
        "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_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
 
 /*
 ===============
@@ -103,7 +105,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 = 0; //vid.colormap;
+                       cl_entities[cl.num_entities].colormap = -1; // no special coloring
                        cl.num_entities++;
                }
        }
@@ -343,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 ();
@@ -513,8 +516,6 @@ void CL_ParseUpdate (int bits)
                        ent->syncbase = model->synctype == ST_RAND ? (float)(rand()&0x7fff) / 0x7fff : 0.0;
                else
                        forcelink = true;       // hack to make null model players work
-               if (num > 0 && num <= cl.maxclients)
-                       R_TranslatePlayerSkin(num - 1);
        }
 
        ent->frame = ((bits & U_FRAME) ? MSG_ReadByte() : (baseline->frame & 0xFF));
@@ -522,20 +523,18 @@ void CL_ParseUpdate (int bits)
        i = bits & U_COLORMAP ? MSG_ReadByte() : baseline->colormap;
        ent->deltabaseline.colormap = i;
        if (!i)
-               ent->colormap = 0; //vid.colormap;
+               ent->colormap = -1; // no special coloring
        else
        {
                if (i > cl.maxclients)
                        Host_Error ("i >= cl.maxclients");
-               ent->colormap = i; //vid.colormap; // cl.scores[i-1].translations;
+               ent->colormap = cl.scores[i-1].colors; // color it
        }
 
        skin = bits & U_SKIN ? MSG_ReadByte() : baseline->skin;
        if (skin != ent->skinnum)
        {
                ent->skinnum = skin;
-               if (num > 0 && num <= cl.maxclients)
-                       R_TranslatePlayerSkin(num - 1);
        }
        ent->deltabaseline.skin = skin;
 
@@ -573,7 +572,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);
@@ -766,7 +765,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 = 0; //vid.colormap;
+       ent->colormap = -1; // no special coloring
        ent->skinnum = ent->baseline.skin;
        ent->effects = ent->baseline.effects;
        ent->alpha = 1;
@@ -960,7 +959,6 @@ 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);
                        break;
                        
                case svc_particle: