]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
makefile: Add -Wc++11-compat-reserved-user-defined-literal
[xonotic/darkplaces.git] / gl_rmain.c
index a205c10ddec063b2a4a12160cc0bb5be39179d99..9773bdd3c46b0ab80b3171291c78ddf90f2a5f38 100644 (file)
@@ -1370,7 +1370,7 @@ static void R_SetupShader_SetPermutationGLSL(unsigned int mode, uint64_t permuta
                {
                        if (!r_glsl_permutation->compiled)
                        {
-                               Con_DPrintf("Compiling shader mode %u permutation %"PRIx64"\n", mode, permutation);
+                               Con_DPrintf("Compiling shader mode %u permutation %" PRIx64 "\n", mode, permutation);
                                R_GLSL_CompilePermutation(perm, mode, permutation);
                        }
                        if (!r_glsl_permutation->program)
@@ -1469,7 +1469,7 @@ static void R_GLSL_DumpShader_f(cmd_state_t *cmd)
                                Con_Printf("%s written\n", modeinfo[mode].filename);
                        }
                        else
-                               Con_Errorf("failed to write to %s\n", modeinfo[mode].filename);
+                               Con_Printf(CON_ERROR "failed to write to %s\n", modeinfo[mode].filename);
                }
        }
 }
@@ -1843,7 +1843,7 @@ void R_SetupShader_Surface(const float rtlightambient[3], const float rtlightdif
                // lightmapped wall
                if ((t->glowtexture || t->backgroundglowtexture) && r_hdr_glowintensity.value > 0 && !gl_lightmaps.integer)
                        permutation |= SHADERPERMUTATION_GLOW;
-               if (r_refdef.fogenabled)
+               if (r_refdef.fogenabled && !notrippy)
                        permutation |= r_texture_fogheighttexture ? SHADERPERMUTATION_FOGHEIGHTTEXTURE : (r_refdef.fogplaneviewabove ? SHADERPERMUTATION_FOGOUTSIDE : SHADERPERMUTATION_FOGINSIDE);
                if (t->colormapping)
                        permutation |= SHADERPERMUTATION_COLORMAPPING;
@@ -1966,7 +1966,7 @@ void R_SetupShader_Surface(const float rtlightambient[3], const float rtlightdif
                                if (r_glsl_permutation->loc_DeferredMod_Diffuse >= 0) qglUniform3f(r_glsl_permutation->loc_DeferredMod_Diffuse, t->render_rtlight_diffuse[0], t->render_rtlight_diffuse[1], t->render_rtlight_diffuse[2]);
                                if (r_glsl_permutation->loc_DeferredMod_Specular >= 0) qglUniform3f(r_glsl_permutation->loc_DeferredMod_Specular, t->render_rtlight_specular[0], t->render_rtlight_specular[1], t->render_rtlight_specular[2]);
                                if (r_glsl_permutation->loc_LightColor >= 0) qglUniform3f(r_glsl_permutation->loc_LightColor, 1, 1, 1); // DEPRECATED
-                               if (r_glsl_permutation->loc_LightDir >= 0) qglUniform3f(r_glsl_permutation->loc_LightDir, t->render_modellight_lightdir[0], t->render_modellight_lightdir[1], t->render_modellight_lightdir[2]);
+                               if (r_glsl_permutation->loc_LightDir >= 0) qglUniform3f(r_glsl_permutation->loc_LightDir, t->render_modellight_lightdir_local[0], t->render_modellight_lightdir_local[1], t->render_modellight_lightdir_local[2]);
                        }
                        else
                        {
@@ -4295,12 +4295,16 @@ void R_HDR_UpdateIrisAdaptation(const vec3_t point)
                Cvar_SetValueQuick(&r_hdr_irisadaptation_value, 1.0f);
 }
 
+extern cvar_t r_lockvisibility;
+extern cvar_t r_lockpvs;
+
 static void R_View_SetFrustum(const int *scissor)
 {
        int i;
        double fpx = +1, fnx = -1, fpy = +1, fny = -1;
        vec3_t forward, left, up, origin, v;
-
+       if(r_lockvisibility.integer || r_lockpvs.integer)
+               return;
        if(scissor)
        {
                // flipped x coordinates (because x points left here)
@@ -4728,7 +4732,7 @@ static void R_Water_StartFrame(int viewwidth, int viewheight)
        waterwidth = (int)bound(16, viewwidth * r_water_resolutionmultiplier.value, viewwidth);
        waterheight = (int)bound(16, viewheight * r_water_resolutionmultiplier.value, viewheight);
 
-       if (!r_water.integer || r_showsurfaces.integer)
+       if (!r_water.integer || r_showsurfaces.integer || r_lockvisibility.integer || r_lockpvs.integer)
                waterwidth = waterheight = 0;
 
        // set up variables that will be used in shader setup
@@ -6731,7 +6735,8 @@ texture_t *R_GetCurrentTexture(texture_t *t)
                for (q = 0; q < 3; q++)
                {
                        t->render_glowmod[q] = rsurface.entity->glowmod[q];
-                       t->render_modellight_lightdir[q] = q == 2;
+                       t->render_modellight_lightdir_world[q] = q == 2;
+                       t->render_modellight_lightdir_local[q] = q == 2;
                        t->render_modellight_ambient[q] = 1;
                        t->render_modellight_diffuse[q] = 0;
                        t->render_modellight_specular[q] = 0;
@@ -6750,7 +6755,8 @@ texture_t *R_GetCurrentTexture(texture_t *t)
                {
                        t->render_glowmod[q] = rsurface.entity->render_glowmod[q] * r_refdef.view.colorscale;
                        t->render_modellight_ambient[q] = rsurface.entity->render_fullbright[q] * r_refdef.view.colorscale;
-                       t->render_modellight_lightdir[q] = q == 2;
+                       t->render_modellight_lightdir_world[q] = q == 2;
+                       t->render_modellight_lightdir_local[q] = q == 2;
                        t->render_modellight_diffuse[q] = 0;
                        t->render_modellight_specular[q] = 0;
                        t->render_lightmap_ambient[q] = 0;
@@ -6766,7 +6772,8 @@ texture_t *R_GetCurrentTexture(texture_t *t)
                for (q = 0; q < 3; q++)
                {
                        t->render_glowmod[q] = rsurface.entity->render_glowmod[q] * r_refdef.view.colorscale;
-                       t->render_modellight_lightdir[q] = q == 2;
+                       t->render_modellight_lightdir_world[q] = q == 2;
+                       t->render_modellight_lightdir_local[q] = q == 2;
                        t->render_modellight_ambient[q] = 0;
                        t->render_modellight_diffuse[q] = 0;
                        t->render_modellight_specular[q] = 0;
@@ -6784,7 +6791,8 @@ texture_t *R_GetCurrentTexture(texture_t *t)
                for (q = 0; q < 3; q++)
                {
                        t->render_glowmod[q] = rsurface.entity->render_glowmod[q] * r_refdef.view.colorscale;
-                       t->render_modellight_lightdir[q] = rsurface.entity->render_modellight_lightdir[q];
+                       t->render_modellight_lightdir_world[q] = rsurface.entity->render_modellight_lightdir_world[q];
+                       t->render_modellight_lightdir_local[q] = rsurface.entity->render_modellight_lightdir_local[q];
                        t->render_modellight_ambient[q] = rsurface.entity->render_modellight_ambient[q] * r_refdef.view.colorscale;
                        t->render_modellight_diffuse[q] = rsurface.entity->render_modellight_diffuse[q] * r_refdef.view.colorscale;
                        t->render_modellight_specular[q] = rsurface.entity->render_modellight_specular[q] * r_refdef.view.colorscale;
@@ -6801,7 +6809,8 @@ texture_t *R_GetCurrentTexture(texture_t *t)
                for (q = 0; q < 3; q++)
                {
                        t->render_glowmod[q] = rsurface.entity->render_glowmod[q] * r_refdef.view.colorscale;
-                       t->render_modellight_lightdir[q] = q == 2;
+                       t->render_modellight_lightdir_world[q] = q == 2;
+                       t->render_modellight_lightdir_local[q] = q == 2;
                        t->render_modellight_ambient[q] = 0;
                        t->render_modellight_diffuse[q] = 0;
                        t->render_modellight_specular[q] = 0;
@@ -6825,7 +6834,8 @@ texture_t *R_GetCurrentTexture(texture_t *t)
                for (q = 0; q < 3; q++)
                {
                        t->render_glowmod[q] = rsurface.entity->render_glowmod[q] * r_refdef.view.colorscale;
-                       t->render_modellight_lightdir[q] = q == 2;
+                       t->render_modellight_lightdir_world[q] = q == 2;
+                       t->render_modellight_lightdir_local[q] = q == 2;
                        t->render_modellight_ambient[q] = 0;
                        t->render_modellight_diffuse[q] = 0;
                        t->render_modellight_specular[q] = 0;
@@ -6952,7 +6962,7 @@ texture_t *R_GetCurrentTexture(texture_t *t)
        // lightmaps mode looks bad with dlights using actual texturing, so turn
        // off the colormap and glossmap, but leave the normalmap on as it still
        // accurately represents the shading involved
-       if (gl_lightmaps.integer)
+       if (gl_lightmaps.integer && ent != &cl_meshentities[MESH_UI].render)
        {
                t->basetexture = r_texture_grey128;
                t->pantstexture = r_texture_black;