]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rsurf.c
implemented r_glsl_water cvar (refraction and reflection rendering)
[xonotic/darkplaces.git] / gl_rsurf.c
index 0ce09f6ca9e9cf46781118c2e1ccec5a012d8b76..cdd439266453dcd5171cf8685559cde40d4eff6f 100644 (file)
@@ -404,7 +404,7 @@ void R_DrawPortals(void)
        }
 }
 
-void R_View_WorldVisibility(void)
+void R_View_WorldVisibility(qboolean forcenovis)
 {
        int i, j, *mark;
        mleaf_t *leaf;
@@ -430,7 +430,7 @@ void R_View_WorldVisibility(void)
 
                // if floating around in the void (no pvs data available, and no
                // portals available), simply use all on-screen leafs.
-               if (!viewleaf || viewleaf->clusterindex < 0)
+               if (!viewleaf || viewleaf->clusterindex < 0 || forcenovis)
                {
                        // no visibility method: (used when floating around in the void)
                        // simply cull each leaf to the frustum (view pyramid)
@@ -524,9 +524,20 @@ void R_Q1BSP_DrawSky(entity_render_t *ent)
        if (ent->model == NULL)
                return;
        if (ent == r_refdef.worldentity)
-               R_DrawWorldSurfaces(true, true, false);
+               R_DrawWorldSurfaces(true, true, false, false);
        else
-               R_DrawModelSurfaces(ent, true, true, false);
+               R_DrawModelSurfaces(ent, true, true, false, false);
+}
+
+void R_Q1BSP_DrawAddWaterPlanes(entity_render_t *ent)
+{
+       model_t *model = ent->model;
+       if (model == NULL)
+               return;
+       if (ent == r_refdef.worldentity)
+               R_DrawWorldSurfaces(false, false, false, true);
+       else
+               R_DrawModelSurfaces(ent, false, false, false, true);
 }
 
 void R_Q1BSP_Draw(entity_render_t *ent)
@@ -535,9 +546,9 @@ void R_Q1BSP_Draw(entity_render_t *ent)
        if (model == NULL)
                return;
        if (ent == r_refdef.worldentity)
-               R_DrawWorldSurfaces(false, true, false);
+               R_DrawWorldSurfaces(false, true, false, false);
        else
-               R_DrawModelSurfaces(ent, false, true, false);
+               R_DrawModelSurfaces(ent, false, true, false, false);
 }
 
 void R_Q1BSP_DrawDepth(entity_render_t *ent)
@@ -546,9 +557,9 @@ void R_Q1BSP_DrawDepth(entity_render_t *ent)
        if (model == NULL)
                return;
        if (ent == r_refdef.worldentity)
-               R_DrawWorldSurfaces(false, false, true);
+               R_DrawWorldSurfaces(false, false, true, false);
        else
-               R_DrawModelSurfaces(ent, false, false, true);
+               R_DrawModelSurfaces(ent, false, false, true, false);
 }
 
 typedef struct r_q1bsp_getlightinfo_s
@@ -1144,6 +1155,11 @@ void R_ReplaceWorldTexture (void)
        int                     i;
        const char      *r, *newt;
        skinframe_t *skinframe;
+       if (!r_refdef.worldmodel)
+       {
+               Con_Printf("There is no worldmodel\n");
+               return;
+       }
        m = r_refdef.worldmodel;
 
        if(Cmd_Argc() < 2)
@@ -1186,6 +1202,11 @@ void R_ListWorldTextures (void)
        model_t         *m;
        texture_t       *t;
        int                     i;
+       if (!r_refdef.worldmodel)
+       {
+               Con_Printf("There is no worldmodel\n");
+               return;
+       }
        m = r_refdef.worldmodel;
 
        Con_Print("Worldmodel textures :\n");