]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_shadow.c
fix lagged prydon cursor trace bug (it was using renderer variables, now uses V_CalcR...
[xonotic/darkplaces.git] / r_shadow.c
index 45de930d4cb99fd54ab88c156f260de0fd0deda3..523457a00cd92508c2a057bbb5fc15761103e262 100644 (file)
@@ -451,8 +451,8 @@ void r_shadow_start(void)
                int fragstrings_count;
                const char *vertstrings_list[SHADERPERMUTATION_COUNT];
                const char *fragstrings_list[SHADERPERMUTATION_COUNT];
-               vertstring = FS_LoadFile("glsl/light.vert", tempmempool, false);
-               fragstring = FS_LoadFile("glsl/light.frag", tempmempool, false);
+               vertstring = (char *)FS_LoadFile("glsl/light.vert", tempmempool, false);
+               fragstring = (char *)FS_LoadFile("glsl/light.frag", tempmempool, false);
                for (i = 0;i < SHADERPERMUTATION_COUNT;i++)
                {
                        vertstrings_count = 0;
@@ -673,7 +673,7 @@ void R_Shadow_Init(void)
        R_RegisterModule("R_Shadow", r_shadow_start, r_shadow_shutdown, r_shadow_newmap);
 }
 
-static matrix4x4_t matrix_attenuationxyz =
+matrix4x4_t matrix_attenuationxyz =
 {
        {
                {0.5, 0.0, 0.0, 0.5},
@@ -683,7 +683,7 @@ static matrix4x4_t matrix_attenuationxyz =
        }
 };
 
-static matrix4x4_t matrix_attenuationz =
+matrix4x4_t matrix_attenuationz =
 {
        {
                {0.0, 0.0, 0.5, 0.5},
@@ -1221,7 +1221,7 @@ void R_Shadow_Stage_Lighting(int stenciltest)
                        qglUniform1fARB(qglGetUniformLocationARB(r_shadow_lightprog, "OffsetMapping_Bias"), r_shadow_glsl_offsetmapping_bias.value);CHECKGLERROR
                }
        }
-       else if (gl_dot3arb && gl_texturecubemap && gl_combine.integer && gl_stencil)
+       else if (gl_dot3arb && gl_texturecubemap && r_textureunits.integer >= 2 && gl_combine.integer && gl_stencil)
                r_shadowstage = R_SHADOWSTAGE_LIGHT_DOT3;
        else
                r_shadowstage = R_SHADOWSTAGE_LIGHT_VERTEX;
@@ -1368,7 +1368,7 @@ qboolean R_Shadow_ScissorForBBox(const float *mins, const float *maxs)
                return true;
 
        // the light area is visible, set up the scissor rectangle
-       GL_Scissor(ix1, vid.realheight - iy2, ix2 - ix1, iy2 - iy1);
+       GL_Scissor(ix1, vid.height - iy2, ix2 - ix1, iy2 - iy1);
        //qglScissor(ix1, iy1, ix2 - ix1, iy2 - iy1);
        //qglEnable(GL_SCISSOR_TEST);
        c_rt_scissored++;
@@ -1572,7 +1572,7 @@ void R_Shadow_RenderLighting(int firstvertex, int numvertices, int numtriangles,
        int renders;
        float color[3], color2[3], colorscale, specularscale;
        rmeshstate_t m;
-       // FIXME: support EF_NODEPTHTEST
+       // FIXME: support MATERIALFLAG_NODEPTHTEST
        if (!basetexture)
                basetexture = r_texture_white;
        if (!bumptexture)
@@ -1600,7 +1600,7 @@ void R_Shadow_RenderLighting(int firstvertex, int numvertices, int numtriangles,
                int passes = 0;
                if (r_shadow_glsl.integer && r_shadow_program_light[0])
                        passes++; // GLSL shader path (GFFX5200, Radeon 9500)
-               else if (gl_dot3arb && gl_texturecubemap && gl_combine.integer && gl_stencil)
+               else if (gl_dot3arb && gl_texturecubemap && r_textureunits.integer >= 2 && gl_combine.integer && gl_stencil)
                {
                        // TODO: add direct pants/shirt rendering
                        if (pantstexture && (r_shadow_rtlight->ambientscale + r_shadow_rtlight->diffusescale) * VectorLength2(lightcolorpants) > 0.001)
@@ -3252,7 +3252,7 @@ void R_Shadow_LoadWorldLights(void)
        }
        FS_StripExtension (r_refdef.worldmodel->name, name, sizeof (name));
        strlcat (name, ".rtlights", sizeof (name));
-       lightsstring = FS_LoadFile(name, tempmempool, false);
+       lightsstring = (char *)FS_LoadFile(name, tempmempool, false);
        if (lightsstring)
        {
                s = lightsstring;
@@ -3395,7 +3395,7 @@ void R_Shadow_LoadLightsFile(void)
        }
        FS_StripExtension (r_refdef.worldmodel->name, name, sizeof (name));
        strlcat (name, ".lights", sizeof (name));
-       lightsstring = FS_LoadFile(name, tempmempool, false);
+       lightsstring = (char *)FS_LoadFile(name, tempmempool, false);
        if (lightsstring)
        {
                s = lightsstring;
@@ -3451,7 +3451,7 @@ void R_Shadow_LoadWorldLightsFromMap_LightArghliteTyrlite(void)
        // try to load a .ent file first
        FS_StripExtension (r_refdef.worldmodel->name, key, sizeof (key));
        strlcat (key, ".ent", sizeof (key));
-       data = entfiledata = FS_LoadFile(key, tempmempool, true);
+       data = entfiledata = (char *)FS_LoadFile(key, tempmempool, true);
        // and if that is not found, fall back to the bsp file entity string
        if (!data)
                data = r_refdef.worldmodel->brush.entities;