r_dlightmap 0 mode removed (vertex dlights on lightmapped walls)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 21 Sep 2003 23:08:36 +0000 (23:08 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 21 Sep 2003 23:08:36 +0000 (23:08 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3498 d7cf8633-e32d-0410-b094-e92efae38249

gl_rsurf.c
menu.c
r_light.c
render.h

index c5ed09e..5eb98d3 100644 (file)
@@ -30,7 +30,6 @@ static float floatblocklights[MAX_LIGHTMAP_SIZE*MAX_LIGHTMAP_SIZE*3]; // LordHav
 static qbyte templight[MAX_LIGHTMAP_SIZE*MAX_LIGHTMAP_SIZE*4];
 
 cvar_t r_ambient = {0, "r_ambient", "0"};
-cvar_t r_dlightmap = {CVAR_SAVE, "r_dlightmap", "1"};
 cvar_t r_drawportals = {0, "r_drawportals", "0"};
 cvar_t r_testvis = {0, "r_testvis", "0"};
 cvar_t r_floatbuildlightmap = {0, "r_floatbuildlightmap", "0"};
@@ -267,7 +266,7 @@ static void R_BuildLightMap (const entity_render_t *ent, msurface_t *surf)
                        else
                                memset(bl, 0, size*3*sizeof(unsigned int));
 
-                       if (surf->dlightframe == r_framecount && r_dlightmap.integer)
+                       if (surf->dlightframe == r_framecount)
                        {
                                surf->cached_dlight = R_IntAddDynamicLights(&ent->inversematrix, surf);
                                if (surf->cached_dlight)
@@ -350,7 +349,7 @@ static void R_BuildLightMap (const entity_render_t *ent, msurface_t *surf)
                else
                        memset(bl, 0, size*3*sizeof(float));
 
-               if (surf->dlightframe == r_framecount && r_dlightmap.integer)
+               if (surf->dlightframe == r_framecount)
                {
                        surf->cached_dlight = R_FloatAddDynamicLights(&ent->inversematrix, surf);
                        if (surf->cached_dlight)
@@ -1156,45 +1155,6 @@ static void RSurfShader_OpaqueWall_Pass_BaseLightmap(const entity_render_t *ent,
        }
 }
 
-static void RSurfShader_OpaqueWall_Pass_Light(const entity_render_t *ent, const texture_t *texture, msurface_t **surfchain)
-{
-       const msurface_t *surf;
-       const surfmesh_t *mesh;
-       float colorscale;
-       rmeshstate_t m;
-
-       memset(&m, 0, sizeof(m));
-       GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
-       GL_DepthMask(false);
-       GL_DepthTest(true);
-       m.tex[0] = R_GetTexture(texture->skin.base);
-       colorscale = 1;
-       if (gl_combine.integer)
-       {
-               m.texrgbscale[0] = 4;
-               colorscale *= 0.25f;
-       }
-       GL_ColorPointer(varray_color4f);
-       while((surf = *surfchain++) != NULL)
-       {
-               if (surf->visframe == r_framecount && surf->dlightframe == r_framecount)
-               {
-                       for (mesh = surf->mesh;mesh;mesh = mesh->chain)
-                       {
-                               if (RSurf_LightCheck(&ent->inversematrix, surf->dlightbits, mesh))
-                               {
-                                       GL_VertexPointer(mesh->vertex3f);
-                                       m.pointer_texcoord[0] = mesh->texcoordtexture2f;
-                                       R_FillColors(varray_color4f, mesh->numverts, 0, 0, 0, 1);
-                                       R_Mesh_State_Texture(&m);
-                                       RSurf_LightSeparate_Vertex3f_Color4f(&ent->inversematrix, surf->dlightbits, mesh->numverts, mesh->vertex3f, varray_color4f, colorscale);
-                                       R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
-                               }
-                       }
-               }
-       }
-}
-
 static void RSurfShader_OpaqueWall_Pass_Fog(const entity_render_t *ent, const texture_t *texture, msurface_t **surfchain)
 {
        const msurface_t *surf;
@@ -1374,8 +1334,6 @@ static void RSurfShader_Wall_Lightmap(const entity_render_t *ent, const texture_
                        if (r_detailtextures.integer)
                                RSurfShader_OpaqueWall_Pass_BaseDetail(ent, texture, surfchain);
                }
-               if (!r_dlightmap.integer && !(ent->effects & EF_FULLBRIGHT))
-                       RSurfShader_OpaqueWall_Pass_Light(ent, texture, surfchain);
                if (texture->skin.glow)
                        RSurfShader_OpaqueWall_Pass_Glow(ent, texture, surfchain);
                if (fogenabled)
@@ -2146,7 +2104,6 @@ void GL_Surf_Init(void)
                dlightdivtable[i] = 4194304 / (i << 7);
 
        Cvar_RegisterVariable(&r_ambient);
-       Cvar_RegisterVariable(&r_dlightmap);
        Cvar_RegisterVariable(&r_drawportals);
        Cvar_RegisterVariable(&r_testvis);
        Cvar_RegisterVariable(&r_floatbuildlightmap);
diff --git a/menu.c b/menu.c
index c618eb5..eb91659 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -1356,7 +1356,7 @@ void M_Options_Key (int k)
        }
 }
 
-#define        OPTIONS_EFFECTS_ITEMS   21
+#define        OPTIONS_EFFECTS_ITEMS   20
 
 int options_effects_cursor;
 
@@ -1374,7 +1374,6 @@ extern cvar_t cl_explosions;
 extern cvar_t cl_stainmaps;
 extern cvar_t cl_decals;
 extern cvar_t r_explosionclip;
-extern cvar_t r_dlightmap;
 extern cvar_t r_modellights;
 extern cvar_t r_coronas;
 extern cvar_t gl_flashblend;
@@ -1395,8 +1394,6 @@ void M_Menu_Options_Effects_AdjustSliders (int dir)
        if (options_effects_cursor == optnum++)
                Cvar_SetValueQuick (&r_modellights, bound(0, r_modellights.value + dir, 8));
        else if (options_effects_cursor == optnum++)
-               Cvar_SetValueQuick (&r_dlightmap, !r_dlightmap.integer);
-       else if (options_effects_cursor == optnum++)
                Cvar_SetValueQuick (&r_coronas, !r_coronas.integer);
        else if (options_effects_cursor == optnum++)
                Cvar_SetValueQuick (&gl_flashblend, !gl_flashblend.integer);
@@ -1453,7 +1450,6 @@ void M_Options_Effects_Draw (void)
        opty = 32 - bound(0, optcursor - (visible >> 1), max(0, OPTIONS_EFFECTS_ITEMS - visible)) * 8;
 
        M_Options_PrintSlider(  "      Lights Per Model", true, r_modellights.value, 0, 8);
-       M_Options_PrintCheckbox(" Fast Dynamic Lighting", true, !r_dlightmap.integer);
        M_Options_PrintCheckbox("               Coronas", true, r_coronas.integer);
        M_Options_PrintCheckbox("      Use Only Coronas", true, gl_flashblend.integer);
        M_Options_PrintCheckbox("             Particles", true, cl_particles.integer);
index f5bbc46..c393f55 100644 (file)
--- a/r_light.c
+++ b/r_light.c
@@ -252,8 +252,7 @@ static void R_RecursiveMarkLights(entity_render_t *ent, vec3_t lightorigin, rdli
                        {
                                surf->dlightbits[0] = surf->dlightbits[1] = surf->dlightbits[2] = surf->dlightbits[3] = surf->dlightbits[4] = surf->dlightbits[5] = surf->dlightbits[6] = surf->dlightbits[7] = 0;
                                surf->dlightframe = r_framecount;
-                               if (r_dlightmap.integer)
-                                       surf->cached_dlight = true;
+                               surf->cached_dlight = true;
                        }
                        surf->dlightbits[bitindex] |= bit;
                }
index 96c2c67..0438bab 100644 (file)
--- a/render.h
+++ b/render.h
@@ -106,7 +106,6 @@ extern cvar_t r_speeds;
 extern cvar_t r_fullbright;
 extern cvar_t r_wateralpha;
 extern cvar_t r_dynamic;
-extern cvar_t r_dlightmap;
 extern cvar_t r_drawcollisionbrushes;
 
 void R_Init (void);