]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
rollback that shadowmesh fix, I was thinking about it incorrectly
[xonotic/darkplaces.git] / cl_main.c
index 268a05fa5134bf339ebe85a6920f620e925b081d..16c8a2cc7650926d856d681119b95e1834baea97 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -63,6 +63,8 @@ cvar_t cl_noplayershadow = {CVAR_SAVE, "cl_noplayershadow", "0"};
 
 cvar_t cl_prydoncursor = {0, "cl_prydoncursor", "0"};
 
+cvar_t cl_deathnoviewmodel = {0, "cl_deathnoviewmodel", "1"};
+
 vec3_t cl_playerstandmins;
 vec3_t cl_playerstandmaxs;
 vec3_t cl_playercrouchmins;
@@ -97,6 +99,10 @@ int cl_num_static_entities;
 int cl_num_temp_entities;
 int cl_num_brushmodel_entities;
 
+// keep track of quake entities because they need to be killed if they get stale
+extern int cl_lastquakeentity;
+extern qbyte cl_isquakeentity[MAX_EDICTS];
+
 /*
 =====================
 CL_ClearState
@@ -155,6 +161,9 @@ void CL_ClearState(void)
        cl_lightstyle = Mem_Alloc(cl_mempool, cl_max_lightstyle * sizeof(lightstyle_t));
        cl_brushmodel_entities = Mem_Alloc(cl_mempool, cl_max_brushmodel_entities * sizeof(int));
 
+       cl_lastquakeentity = 0;
+       memset(cl_isquakeentity, 0, sizeof(cl_isquakeentity));
+
        // LordHavoc: have to set up the baseline info for alpha and other stuff
        for (i = 0;i < cl_max_entities;i++)
        {
@@ -190,7 +199,7 @@ void CL_ExpandEntities(int num)
        if (num >= cl_max_entities)
        {
                if (!cl_entities)
-                       Host_Error("CL_ExpandEntities: cl_entities not initialized\n");
+                       Sys_Error("CL_ExpandEntities: cl_entities not initialized\n");
                if (num >= MAX_EDICTS)
                        Host_Error("CL_ExpandEntities: num %i >= %i\n", num, MAX_EDICTS);
                oldmaxentities = cl_max_entities;
@@ -331,7 +340,7 @@ static void CL_PrintEntities_f(void)
                        strlcpy (name, ent->render.model->name, 25);
                else
                        strcpy(name, "--no model--");
-               for (j = strlen(name);j < 25;j++)
+               for (j = (int)strlen(name);j < 25;j++)
                        name[j] = ' ';
                Con_Printf("%3i: %s:%4i (%5i %5i %5i) [%3i %3i %3i] %4.2f %5.3f\n", i, name, ent->render.frame, (int) ent->render.origin[0], (int) ent->render.origin[1], (int) ent->render.origin[2], (int) ent->render.angles[0] % 360, (int) ent->render.angles[1] % 360, (int) ent->render.angles[2] % 360, ent->render.scale, ent->render.alpha);
        }
@@ -1010,7 +1019,7 @@ static void CL_RelinkNetworkEntities(void)
        ent->state_current.modelindex = cl.stats[STAT_WEAPON];
        ent->state_current.frame = cl.stats[STAT_WEAPONFRAME];
        ent->state_current.flags = RENDER_VIEWMODEL;
-       if (cl.stats[STAT_HEALTH] <= 0 || cl.intermission)
+       if ((cl.stats[STAT_HEALTH] <= 0 && cl_deathnoviewmodel.integer) || cl.intermission)
                ent->state_current.modelindex = 0;
        else if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
        {
@@ -1247,6 +1256,7 @@ CL_ReadFromServer
 Read all incoming data from the server
 ===============
 */
+extern void CL_ClientMovement_Replay();
 int CL_ReadFromServer(void)
 {
        CL_ReadDemoMessage();
@@ -1267,6 +1277,7 @@ int CL_ReadFromServer(void)
                V_FadeViewFlashs();
 
                // relink network entities (note: this sets up the view!)
+               CL_ClientMovement_Replay();
                CL_RelinkNetworkEntities();
 
                // move particles
@@ -1463,6 +1474,8 @@ void CL_Init (void)
 
        Cvar_RegisterVariable(&cl_prydoncursor);
 
+       Cvar_RegisterVariable(&cl_deathnoviewmodel);
+
        Cmd_AddCommand("timerefresh", CL_TimeRefresh_f);
 
        CL_Parse_Init();