]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fixed r_drawportals
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 8 Jun 2006 12:35:10 +0000 (12:35 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 8 Jun 2006 12:35:10 +0000 (12:35 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6440 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c
gl_rsurf.c

index ec2dc227f46bece8c1e9d4f6a4c615e36d6192b8..88c6e0bf63faee98fc84eaf6e3593efe7daf8f62 100644 (file)
@@ -43,6 +43,7 @@ cvar_t r_showcollisionbrushes = {0, "r_showcollisionbrushes", "0", "draws collis
 cvar_t r_showcollisionbrushes_polygonfactor = {0, "r_showcollisionbrushes_polygonfactor", "-1", "expands outward the brush polygons a little bit, used to make collision brushes appear infront of walls"};
 cvar_t r_showcollisionbrushes_polygonoffset = {0, "r_showcollisionbrushes_polygonoffset", "0", "nudges brush polygon depth in hardware depth units, used to make collision brushes appear infront of walls"};
 cvar_t r_showdisabledepthtest = {0, "r_showdisabledepthtest", "0", "disables depth testing on r_show* cvars, allowing you to see what hidden geometry the graphics card is processing"};
+cvar_t r_drawportals = {0, "r_drawportals", "0", "shows portals (separating polygons) in world interior in quake1 maps"};
 cvar_t r_drawentities = {0, "r_drawentities","1", "draw entities (doors, players, projectiles, etc)"};
 cvar_t r_drawviewmodel = {0, "r_drawviewmodel","1", "draw your weapon model"};
 cvar_t r_speeds = {0, "r_speeds","0", "displays rendering statistics and per-subsystem timings"};
@@ -983,6 +984,7 @@ void GL_Main_Init(void)
        Cvar_RegisterVariable(&r_showcollisionbrushes_polygonfactor);
        Cvar_RegisterVariable(&r_showcollisionbrushes_polygonoffset);
        Cvar_RegisterVariable(&r_showdisabledepthtest);
+       Cvar_RegisterVariable(&r_drawportals);
        Cvar_RegisterVariable(&r_drawentities);
        Cvar_RegisterVariable(&r_drawviewmodel);
        Cvar_RegisterVariable(&r_speeds);
@@ -1701,6 +1703,7 @@ void CSQC_R_RenderScene (void)
 
 extern void R_DrawLightningBeams (void);
 extern void VM_AddPolygonsToMeshQueue (void);
+extern void R_DrawPortals (void);
 void R_RenderScene(void)
 {
        // don't let sound skip if going slow
@@ -1796,6 +1799,13 @@ void R_RenderScene(void)
        }
        VM_AddPolygonsToMeshQueue();
 
+       if (r_drawportals.integer)
+       {
+               R_DrawPortals();
+               if (r_timereport_active)
+                       R_TimeReport("portals");
+       }
+
        if (gl_support_fragment_shader)
        {
                qglUseProgramObjectARB(0);CHECKGLERROR
index e02f0554cd643efad14c26637a7704b4bbed6d56..99c8b4c52e2cdaccaf13dee4ea5211f0cdb81512 100644 (file)
@@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #define MAX_LIGHTMAP_SIZE 256
 
 cvar_t r_ambient = {0, "r_ambient", "0", "brighter world cheat (not allowed in multiplayer), value is 0-128"};
-cvar_t r_drawportals = {0, "r_drawportals", "0", "shows portals (separating polygons) in world interior in quake1 maps"};
 cvar_t r_lockpvs = {0, "r_lockpvs", "0", "disables pvs switching, allows you to walk around and inspect what is visible from a given location in the map (anything not visible from your current location will not be drawn)"};
 cvar_t r_lockvisibility = {0, "r_lockvisibility", "0", "disables visibility updates, allows you to walk around and inspect what is visible from a given viewpoint in the map (anything offscreen at the moment this is enabled will not be drawn)"};
 cvar_t r_useportalculling = {0, "r_useportalculling", "1", "use advanced portal culling visibility method to improve performance over just Potentially Visible Set, provides an even more significant speed improvement in unvised maps"};
@@ -360,7 +359,7 @@ static void R_DrawPortal_Callback(const entity_render_t *ent, const rtlight_t *r
 }
 
 // LordHavoc: this is just a nice debugging tool, very slow
-static void R_DrawPortals(void)
+void R_DrawPortals(void)
 {
        int i, leafnum;
        mportal_t *portal;
@@ -497,9 +496,6 @@ void R_View_WorldVisibility(void)
                        }
                }
        }
-
-       if (r_drawportals.integer)
-               R_DrawPortals();
 }
 
 void R_Q1BSP_DrawSky(entity_render_t *ent)
@@ -956,7 +952,6 @@ void GL_Surf_Init(void)
 {
 
        Cvar_RegisterVariable(&r_ambient);
-       Cvar_RegisterVariable(&r_drawportals);
        Cvar_RegisterVariable(&r_lockpvs);
        Cvar_RegisterVariable(&r_lockvisibility);
        Cvar_RegisterVariable(&r_useportalculling);