]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
now supports GL_EXT_stencil_two_side extension (found on NV30/R300 class cards),...
[xonotic/darkplaces.git] / cl_main.c
index 42b01de1846b8194feaa63155b5202635d077190..e98a93216bb152ff7ed6c63168834325d19f5161 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -177,7 +177,7 @@ void CL_Disconnect(void)
                if (cls.demorecording)
                        CL_Stop_f();
 
-               Con_DPrintf("Sending clc_disconnect\n");
+               Con_DPrint("Sending clc_disconnect\n");
                SZ_Clear(&cls.message);
                MSG_WriteByte(&cls.message, clc_disconnect);
                NetConn_SendUnreliableMessage(cls.netcon, &cls.message);
@@ -248,7 +248,7 @@ void CL_EstablishConnection(const char *host)
        }
        else
        {
-               Con_Printf("Unable to find a suitable network socket to connect to server.\n");
+               Con_Print("Unable to find a suitable network socket to connect to server.\n");
                strcpy(m_return_reason, "No network");
        }
 }
@@ -275,7 +275,7 @@ static void CL_PrintEntities_f(void)
                        strcpy(name, "--no model--");
                for (j = strlen(name);j < 25;j++)
                        name[j] = ' ';
-               Con_Printf ("%3i: %s:%04i (%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);
+               Con_Printf("%3i: %s:%04i (%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);
        }
 }
 
@@ -742,7 +742,7 @@ void CL_LinkNetworkEntity(entity_t *e)
                        tempmatrix.m[0][3] = v[0];
                        tempmatrix.m[1][3] = v[1];
                        tempmatrix.m[2][3] = v[2];
-                       CL_AllocDlight(NULL, &tempmatrix, e->persistent.muzzleflash, 1, 1, 1, 0, 0, 0, 0, true, 1);
+                       CL_AllocDlight(NULL, &tempmatrix, e->persistent.muzzleflash, 1, 1, 1, 0, 0, 0, 0, true, 0);
                        e->persistent.muzzleflash -= cl.frametime * 1000;
                }
                // LordHavoc: if the model has no flags, don't check each
@@ -798,9 +798,12 @@ void CL_LinkNetworkEntity(entity_t *e)
                        dlightradius = max(dlightradius, e->state_current.glowsize * 4);
                        VectorMA(dlightcolor, (1.0f / 255.0f), (qbyte *)&palette_complete[e->state_current.glowcolor], dlightcolor);
                }
-               if (e->state_current.light[3])
+               if (e->state_current.lightpflags & PFLAGS_FULLDYNAMIC)
                {
-                       dlightradius = max(dlightradius, e->state_current.light[3]);
+                       if (e->state_current.light[3])
+                               dlightradius = max(dlightradius, e->state_current.light[3]);
+                       else
+                               dlightradius = max(dlightradius, 350);
                        if (VectorLength2(dlightcolor) == 0)
                                (dlightcolor[0] += 1, dlightcolor[1] += 1, dlightcolor[2] += 1);
                        else
@@ -813,7 +816,7 @@ void CL_LinkNetworkEntity(entity_t *e)
                        // hack to make glowing player light shine on their gun
                        if ((e - cl_entities) == cl.viewentity/* && !chase_active.integer*/)
                                dlightmatrix.m[2][3] += 30;
-                       CL_AllocDlight(&e->render, &dlightmatrix, dlightradius, dlightcolor[0], dlightcolor[1], dlightcolor[2], 0, 0, e->state_current.skin >= 16 ? e->state_current.skin : 0, e->state_current.lightstyle, !(e->state_current.lightpflags & 1), 1);
+                       CL_AllocDlight(&e->render, &dlightmatrix, dlightradius, dlightcolor[0], dlightcolor[1], dlightcolor[2], 0, 0, e->state_current.skin >= 16 ? e->state_current.skin : 0, e->state_current.lightstyle, !(e->state_current.lightpflags & PFLAGS_NOSHADOW), (e->state_current.lightpflags & PFLAGS_FULLDYNAMIC) ? ((e->state_current.lightpflags & PFLAGS_CORONA) != 0) : 1);
                }
                // trails need the previous frame
                if (e->state_previous.active && e->state_previous.modelindex == e->state_current.modelindex)
@@ -832,11 +835,15 @@ void CL_LinkNetworkEntity(entity_t *e)
                 && !(e->render.flags & RENDER_VIEWMODEL)
                 && ((e - cl_entities) != cl.viewentity || (!cl.intermission && cl.protocol != PROTOCOL_NEHAHRAMOVIE && !cl_noplayershadow.integer)))
                        e->render.flags |= RENDER_SHADOW;
+               if (!(e->render.effects & EF_FULLBRIGHT))
+                       e->render.flags |= RENDER_LIGHT;
                // as soon as player is known we can call V_CalcRefDef
                if ((e - cl_entities) == cl.viewentity)
                        V_CalcRefdef();
                if (e->render.model && e->render.model->name[0] == '*' && e->render.model->TraceBox)
                        cl_brushmodel_entities[cl_num_brushmodel_entities++] = &e->render;
+               if (gamemode == GAME_TENEBRAE && e->render.model && e->render.model->type == mod_sprite)
+                       e->render.effects |= EF_ADDITIVE;
                // don't show entities with no modelindex (note: this still shows
                // entities which have a modelindex that resolved to a NULL model)
                if (e->render.model && !(e->render.effects & EF_NODRAW) && r_refdef.numentities < r_refdef.maxentities)
@@ -1133,6 +1140,7 @@ int CL_ReadFromServer(void)
 
                // move particles
                CL_MoveParticles();
+               R_MoveExplosions();
 
                // link stuff
                CL_RelinkWorld();
@@ -1171,7 +1179,7 @@ void CL_SendCmd(usercmd_t *cmd)
        {
                if (developer.integer)
                {
-                       Con_Printf("CL_SendCmd: sending reliable message:\n");
+                       Con_Print("CL_SendCmd: sending reliable message:\n");
                        SZ_HexDumpToConsole(&cls.message);
                }
                if (NetConn_SendReliableMessage(cls.netcon, &cls.message) == -1)
@@ -1185,9 +1193,9 @@ static void CL_PauseDemo_f (void)
 {
        cls.demopaused = !cls.demopaused;
        if (cls.demopaused)
-               Con_Printf("Demo paused\n");
+               Con_Print("Demo paused\n");
        else
-               Con_Printf("Demo unpaused\n");
+               Con_Print("Demo unpaused\n");
 }
 
 /*
@@ -1199,7 +1207,7 @@ static void CL_Fog_f (void)
 {
        if (Cmd_Argc () == 1)
        {
-               Con_Printf ("\"fog\" is \"%f %f %f %f\"\n", fog_density, fog_red, fog_green, fog_blue);
+               Con_Printf("\"fog\" is \"%f %f %f %f\"\n", fog_density, fog_red, fog_green, fog_blue);
                return;
        }
        fog_density = atof(Cmd_Argv(1));