]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_backend.c
Elric's changes:
[xonotic/darkplaces.git] / gl_backend.c
index 9ce7459d2c5de3376f994ca4626ee63d49bec9b9..a664871194278840e92390c2a540b353d52f50c1 100644 (file)
@@ -323,8 +323,8 @@ void GL_SetupView_Mode_Ortho (double x1, double y1, double x2, double y2, double
 
 typedef struct gltextureunit_s
 {
-       unsigned int t1d, t2d, t3d, tcubemap;
-       unsigned int arrayenabled;
+       int t1d, t2d, t3d, tcubemap;
+       int arrayenabled;
        float rgbscale, alphascale;
        int combinergb, combinealpha;
        // FIXME: add more combine stuff
@@ -882,7 +882,10 @@ void R_ClearScreen(void)
                qglClearDepth(1);CHECKGLERROR
                if (gl_stencil)
                {
-                       qglClearStencil(0);CHECKGLERROR
+                       // LordHavoc: we use a stencil centered around 128 instead of 0,
+                       // to avoid clamping interfering with strange shadow volume
+                       // drawing orders
+                       qglClearStencil(128);CHECKGLERROR
                }
                // clear the screen
                qglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | (gl_stencil ? GL_STENCIL_BUFFER_BIT : 0));CHECKGLERROR