]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
don't allow stencil without bitsperpixel 32
[xonotic/darkplaces.git] / gl_rmain.c
index fcc9f67184eb664ee13733d73e0e44fc6e5270c4..fe186d79b67fd36bba3114638f82e9b55258cb59 100644 (file)
@@ -52,7 +52,7 @@ unsigned short d_lightstylevalue[256];
 cvar_t r_drawentities = {0, "r_drawentities","1"};
 cvar_t r_drawviewmodel = {0, "r_drawviewmodel","1"};
 cvar_t r_shadows = {CVAR_SAVE, "r_shadows", "1"};
-cvar_t r_staticworldlights = {0, "r_staticworldlights", "1"};
+cvar_t r_shadow_staticworldlights = {0, "r_shadow_staticworldlights", "1"};
 cvar_t r_speeds = {0, "r_speeds","0"};
 cvar_t r_fullbright = {0, "r_fullbright","0"};
 cvar_t r_wateralpha = {CVAR_SAVE, "r_wateralpha","1"};
@@ -221,7 +221,7 @@ void GL_Main_Init(void)
        Cvar_RegisterVariable (&r_drawentities);
        Cvar_RegisterVariable (&r_drawviewmodel);
        Cvar_RegisterVariable (&r_shadows);
-       Cvar_RegisterVariable (&r_staticworldlights);
+       Cvar_RegisterVariable (&r_shadow_staticworldlights);
        Cvar_RegisterVariable (&r_speeds);
        Cvar_RegisterVariable (&r_fullbrights);
        Cvar_RegisterVariable (&r_wateralpha);
@@ -892,7 +892,7 @@ void R_ShadowVolumeLighting (int visiblevolumes)
                if (!visiblevolumes)
                        R_Shadow_Stage_ShadowVolumes();
                ent = &cl_entities[0].render;
-               if (wl->shadowvolume && r_staticworldlights.integer)
+               if (wl->shadowvolume && r_shadow_staticworldlights.integer)
                        R_Shadow_DrawWorldLightShadowVolume(&ent->matrix, wl);
                else
                        R_TestAndDrawShadowVolume(ent, wl->origin, cullradius / ent->scale, lightradius / ent->scale, clipmins, clipmaxs);
@@ -939,27 +939,6 @@ void R_ShadowVolumeLighting (int visiblevolumes)
                                        }
                                }
                        }
-
-                       if (R_Shadow_Stage_EraseShadowVolumes())
-                       {
-                               ent = &cl_entities[0].render;
-                               if (wl->shadowvolume && r_staticworldlights.integer)
-                                       R_Shadow_DrawWorldLightShadowVolume(&ent->matrix, wl);
-                               else
-                                       R_TestAndDrawShadowVolume(ent, wl->origin, cullradius / ent->scale, lightradius / ent->scale, clipmins, clipmaxs);
-                               if (r_drawentities.integer)
-                               {
-                                       for (i = 0;i < r_refdef.numentities;i++)
-                                       {
-                                               ent = r_refdef.entities[i];
-                                               if (ent->maxs[0] >= wl->mins[0] && ent->mins[0] <= wl->maxs[0]
-                                                && ent->maxs[1] >= wl->mins[1] && ent->mins[1] <= wl->maxs[1]
-                                                && ent->maxs[2] >= wl->mins[2] && ent->mins[2] <= wl->maxs[2]
-                                                && !(ent->effects & EF_ADDITIVE) && ent->alpha == 1)
-                                                       R_TestAndDrawShadowVolume(r_refdef.entities[i], wl->origin, cullradius / ent->scale, lightradius / ent->scale, clipmins, clipmaxs);
-                                       }
-                               }
-                       }
                }
        }
        /*
@@ -979,7 +958,7 @@ void R_ShadowVolumeLighting (int visiblevolumes)
 
                if (!visiblevolumes)
                        R_Shadow_Stage_ShadowVolumes();
-               if (sl->shadowvolume && r_staticworldlights.integer)
+               if (sl->shadowvolume && r_shadow_staticworldlights.integer)
                        R_DrawWorldLightShadowVolume(&cl_entities[0].render.matrix, sl->shadowvolume);
                else
                        R_TestAndDrawShadowVolume(&cl_entities[0].render, sl->origin, cullradius, lightradius);
@@ -1023,24 +1002,6 @@ void R_ShadowVolumeLighting (int visiblevolumes)
                                        }
                                }
                        }
-
-                       R_Shadow_Stage_EraseShadowVolumes();
-                       if (sl->shadowvolume && r_staticworldlights.integer)
-                               R_DrawWorldLightShadowVolume(&cl_entities[0].render.matrix, sl->shadowvolume);
-                       else
-                               R_TestAndDrawShadowVolume(&cl_entities[0].render, sl->origin, cullradius, lightradius);
-                       if (r_drawentities.integer)
-                       {
-                               for (i = 0;i < r_refdef.numentities;i++)
-                               {
-                                       ent = r_refdef.entities[i];
-                                       if (ent->maxs[0] >= sl->mins[0] && ent->mins[0] <= sl->maxs[0]
-                                       && ent->maxs[1] >= sl->mins[1] && ent->mins[1] <= sl->maxs[1]
-                                       && ent->maxs[2] >= sl->mins[2] && ent->mins[2] <= sl->maxs[2]
-                                       && !(ent->effects & EF_ADDITIVE) && ent->alpha == 1)
-                                               R_TestAndDrawShadowVolume(r_refdef.entities[i], sl->origin, cullradius, lightradius);
-                               }
-                       }
                }
        }
        */
@@ -1100,21 +1061,6 @@ void R_ShadowVolumeLighting (int visiblevolumes)
                                        }
                                }
                        }
-
-                       if (R_Shadow_Stage_EraseShadowVolumes())
-                       {
-                               ent = &cl_entities[0].render;
-                               R_TestAndDrawShadowVolume(ent, rd->origin, cullradius / ent->scale, lightradius / ent->scale, clipmins, clipmaxs);
-                               if (r_drawentities.integer)
-                               {
-                                       for (i = 0;i < r_refdef.numentities;i++)
-                                       {
-                                               ent = r_refdef.entities[i];
-                                               if (ent != rd->ent && !(ent->effects & EF_ADDITIVE) && ent->alpha == 1)
-                                                       R_TestAndDrawShadowVolume(ent, rd->origin, cullradius / ent->scale, lightradius / ent->scale, clipmins, clipmaxs);
-                                       }
-                               }
-                       }
                }
        }