From: havoc Date: Thu, 8 Jun 2006 12:35:10 +0000 (+0000) Subject: fixed r_drawportals X-Git-Tag: xonotic-v0.1.0preview~3937 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4fbf9b9a124a6dd55995266b93b0c02eaf3c6f5a;p=xonotic%2Fdarkplaces.git fixed r_drawportals git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6440 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index ec2dc227..88c6e0bf 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -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 diff --git a/gl_rsurf.c b/gl_rsurf.c index e02f0554..99c8b4c5 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -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);