]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
make r_render skip the 3D rendering code (I forgot this before? ick)
[xonotic/darkplaces.git] / cl_parse.c
index 3a821a2ce7e42f0e665311e2eeb68d12e264f3c9..ef85680cfaccdfed4d598f712b8c6797041e868a 100644 (file)
@@ -81,7 +81,7 @@ char *svc_strings[128] =
        "", // 48
        "", // 49
        "svc_cgame", //                         50              // [short] length [bytes] data
-       "svc_fog", //                           51              // unfinished and obsolete
+       "svc_unusedlh1", //                     51              // unused
        "svc_effect", //                        52              // [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate
        "svc_effect2", //                       53              // [vector] org [short] modelindex [short] startframe [byte] framecount [byte] framerate
        "svc_sound2", //                        54              // short soundindex instead of byte
@@ -116,19 +116,6 @@ This error checks and tracks the total number of entities
 */
 entity_t       *CL_EntityNum (int num)
 {
-       /*
-       if (num >= cl.num_entities)
-       {
-               if (num >= MAX_EDICTS)
-                       Host_Error ("CL_EntityNum: %i is an invalid number",num);
-               cl.num_entities = num;
-//             while (cl.num_entities <= num)
-//             {
-//                     cl_entities[cl.num_entities].colormap = -1; // no special coloring
-//                     cl.num_entities++;
-//             }
-       }
-       */
        if (num >= MAX_EDICTS)
                Host_Error ("CL_EntityNum: %i is an invalid number",num);
                
@@ -182,7 +169,7 @@ void CL_ParseStartSoundPacket(int largesoundindex)
                pos[i] = MSG_ReadCoord ();
 
     S_StartSound (ent, channel, cl.sound_precache[sound_num], pos, volume/255.0, attenuation);
-}       
+}
 
 /*
 ==================
@@ -197,6 +184,7 @@ void CL_KeepaliveMessage (void)
        float   time;
        static float lastmsg;
        int             ret;
+       int             c;
        sizebuf_t       old;
        qbyte           olddata[8192];
        
@@ -215,14 +203,15 @@ void CL_KeepaliveMessage (void)
                switch (ret)
                {
                default:
-                       Host_Error ("CL_KeepaliveMessage: CL_GetMessage failed");               
+                       Host_Error ("CL_KeepaliveMessage: CL_GetMessage failed");
                case 0:
                        break;  // nothing waiting
                case 1:
                        Host_Error ("CL_KeepaliveMessage: received a message");
                        break;
                case 2:
-                       if (MSG_ReadByte() != svc_nop)
+                       c = MSG_ReadByte();
+                       if (c != svc_nop)
                                Host_Error ("CL_KeepaliveMessage: datagram wasn't a nop");
                        break;
                }
@@ -339,7 +328,6 @@ Con_DPrintf ("CL_SignonReply: %i\n", cls.signon);
                break;
 
        case 4:
-               SCR_EndLoadingPlaque ();                // allow normal screen updates
                Con_ClearNotify();
                break;
        }
@@ -595,12 +583,8 @@ void CL_ParseUpdate (int bits)
        if (bits & U_EFFECTS2)  new.effects = (new.effects & 0x00FF) | (MSG_ReadByte() << 8);
        if (bits & U_GLOWSIZE)  new.glowsize = MSG_ReadByte();
        if (bits & U_GLOWCOLOR) new.glowcolor = MSG_ReadByte();
-#if 0
-       if (bits & U_COLORMOD)  {int i = MSG_ReadByte();float r = (((int) i >> 5) & 7) * 1.0 / 7, g = (((int) i >> 2) & 7) * 1.0 / 7, b = ((int) i & 3) * 1.0 / 3;Con_Printf("warning: U_COLORMOD %i (%1.2f %1.2f %1.2f) ignored\n", i, r, g, b);}
-#else
        // apparently the dpcrush demo uses this (unintended, and it uses white anyway)
        if (bits & U_COLORMOD)  MSG_ReadByte();
-#endif
        if (bits & U_GLOWTRAIL) new.flags |= RENDER_GLOWTRAIL;
        if (bits & U_FRAME2)    new.frame = (new.frame & 0x00FF) | (MSG_ReadByte() << 8);
        if (bits & U_MODEL2)    new.modelindex = (new.modelindex & 0x00FF) | (MSG_ReadByte() << 8);
@@ -615,7 +599,8 @@ void CL_ParseUpdate (int bits)
                int j = MSG_ReadFloat() * 255.0f;
                if (i == 2)
                {
-                       if (MSG_ReadFloat())
+                       i = MSG_ReadFloat();
+                       if (i)
                                new.effects |= EF_FULLBRIGHT;
                }
                if (j < 0)
@@ -719,8 +704,7 @@ void CL_BitProfile_f(void)
        Con_Printf("bitprofile: %i updates\n");
        if (bitprofilecount)
                for (i = 0;i < 32;i++)
-//                     if (bitprofile[i])
-                               Con_Printf("%s: %i %3.2f%%\n", bitprofilenames[i], bitprofile[i], bitprofile[i] * 100.0 / bitprofilecount);
+                       Con_Printf("%s: %i %3.2f%%\n", bitprofilenames[i], bitprofile[i], bitprofile[i] * 100.0 / bitprofilecount);
        Con_Printf("\n");
        for (i = 0;i < 32;i++)
                bitprofile[i] = 0;
@@ -1055,7 +1039,6 @@ void CL_ParseServerMessage (void)
                        break;
 
                case svc_nop:
-//                     Con_Printf ("svc_nop\n");
                        break;
 
                case svc_time:
@@ -1105,7 +1088,6 @@ void CL_ParseServerMessage (void)
 
                case svc_serverinfo:
                        CL_ParseServerInfo ();
-//                     vid.recalc_refdef = true;       // leave intermission full screen
                        break;
 
                case svc_setangle:
@@ -1243,20 +1225,17 @@ void CL_ParseServerMessage (void)
                case svc_intermission:
                        cl.intermission = 1;
                        cl.completed_time = cl.time;
-//                     vid.recalc_refdef = true;       // go to full screen
                        break;
 
                case svc_finale:
                        cl.intermission = 2;
                        cl.completed_time = cl.time;
-//                     vid.recalc_refdef = true;       // go to full screen
                        SCR_CenterPrint (MSG_ReadString ());
                        break;
 
                case svc_cutscene:
                        cl.intermission = 3;
                        cl.completed_time = cl.time;
-//                     vid.recalc_refdef = true;       // go to full screen
                        SCR_CenterPrint (MSG_ReadString ());
                        break;
 
@@ -1276,15 +1255,6 @@ void CL_ParseServerMessage (void)
                        {
                                int length;
                                length = (int) ((unsigned short) MSG_ReadShort());
-                               /*
-                               if (cgamenetbuffersize < length)
-                               {
-                                       cgamenetbuffersize = length;
-                                       if (cgamenetbuffer)
-                                               Mem_Free(cgamenetbuffer);
-                                       cgamenetbuffer = Mem_Alloc(cgamenetbuffersize);
-                               }
-                               */
                                for (i = 0;i < length;i++)
                                        cgamenetbuffer[i] = MSG_ReadByte();
                                if (!msg_badread)
@@ -1305,3 +1275,4 @@ void CL_ParseServerMessage (void)
        if (entitiesupdated)
                CL_EntityUpdateEnd();
 }
+