{
if (gl_state.blendfunc1 != blendfunc1 || gl_state.blendfunc2 != blendfunc2)
{
+ if (r_showtrispass)
+ return;
qglBlendFunc(gl_state.blendfunc1 = blendfunc1, gl_state.blendfunc2 = blendfunc2);CHECKGLERROR
if (gl_state.blendfunc2 == GL_ZERO)
{
{
if (gl_state.depthmask != state)
{
+ if (r_showtrispass)
+ return;
qglDepthMask(gl_state.depthmask = state);CHECKGLERROR
}
}
{
if (gl_state.depthtest != state)
{
+ if (r_showtrispass)
+ return;
gl_state.depthtest = state;
if (gl_state.depthtest)
{
{
if (gl_state.pointer_color != p)
{
+ if (r_showtrispass)
+ return;
CHECKGLERROR
if (!gl_state.pointer_color)
{
{
if (gl_state.pointer_color || gl_state.color4f[0] != cr || gl_state.color4f[1] != cg || gl_state.color4f[2] != cb || gl_state.color4f[3] != ca)
{
+ if (r_showtrispass)
+ return;
GL_ColorPointer(NULL);
gl_state.color4f[0] = cr;
gl_state.color4f[1] = cg;
Con_Printf("R_Mesh_Draw(%d, %d, %08p);\n", numverts, numtriangles, elements);
return;
}
+ if (r_showtrispass)
+ {
+ R_Mesh_Draw_ShowTris(numverts, numtriangles, elements);
+ return;
+ }
c_meshs++;
c_meshelements += numelements;
CHECKGLERROR
{
int i;
BACKENDACTIVECHECK
- CHECKGLERROR
+ CHECKGLERROR
GL_LockArrays(0, 0);
- CHECKGLERROR
+ CHECKGLERROR
for (i = backendunits - 1;i >= 0;i--)
{
GL_SetupTextureState();
}
+ if (r_showtrispass)
+ return;
for (i = 0, unit = gl_state.units;i < backendunits;i++, unit++)
{
if (unit->t1d != m->tex1d[i])
}
}
-void R_Mesh_Draw_ShowTris(int numverts, int numtriangles, int *elements)
+void R_Mesh_Draw_ShowTris(int numverts, int numtriangles, const int *elements)
{
qglBegin(GL_LINES);
for (;numtriangles;numtriangles--, elements += 3)
// renders a mesh
void R_Mesh_Draw(int numverts, int numtriangles, const int *elements);
// renders a mesh as lines
-void R_Mesh_Draw_ShowTris(int numverts, int numtriangles, int *elements);
+void R_Mesh_Draw_ShowTris(int numverts, int numtriangles, const int *elements);
// saves a section of the rendered frame to a .tga or .jpg file
qboolean SCR_ScreenShot(char *filename, int x, int y, int width, int height, qboolean jpeg);
float r_farclip;
+// forces all rendering to draw triangle outlines
+int r_showtrispass;
+
// view origin
vec3_t r_vieworigin;
vec3_t r_viewforward;
// 8.8 fraction of base light value
unsigned short d_lightstylevalue[256];
+cvar_t r_showtris = {0, "r_showtris", "0"};
cvar_t r_drawentities = {0, "r_drawentities","1"};
cvar_t r_drawviewmodel = {0, "r_drawviewmodel","1"};
cvar_t r_speeds = {0, "r_speeds","0"};
// FIXME: move this to client?
FOG_registercvars();
Cmd_AddCommand("timerefresh", R_TimeRefresh_f);
+ Cvar_RegisterVariable(&r_showtris);
Cvar_RegisterVariable(&r_drawentities);
Cvar_RegisterVariable(&r_drawviewmodel);
Cvar_RegisterVariable(&r_speeds);
qglEnable(GL_POLYGON_OFFSET_FILL);
R_RenderScene();
+ if (r_showtris.integer)
+ {
+ rmeshstate_t m;
+ GL_Color(1,1,1,1);
+ GL_BlendFunc(GL_ONE, GL_ZERO);
+ GL_DepthTest(GL_FALSE);
+ GL_DepthMask(GL_FALSE);
+ memset(&m, 0, sizeof(m));
+ R_Mesh_State_Texture(&m);
+ r_showtrispass = true;
+ R_RenderScene();
+ r_showtrispass = false;
+ }
qglPolygonOffset(0, 0);
qglDisable(GL_POLYGON_OFFSET_FILL);
void R_RenderScene(void)
{
entity_render_t *world;
-
+
// don't let sound skip if going slow
if (!intimerefresh && !r_speeds.integer)
S_ExtraUpdate ();
extern mplane_t frustum[4];
extern int c_alias_polys, c_light_polys, c_faces, c_nodes, c_leafs, c_models, c_bmodels, c_sprites, c_particles, c_dlights;
+// forces all rendering to draw triangle outlines
+extern int r_showtrispass;
//
// view origin
-n darkplaces: typing ip in join game menu should show 'trying' and 'no response' after a while, or 'no network' if networking is not initialized (yummyluv)
d darkplaces: make light_lev dlights from qc require PFLAGS_FULLDYNAMIC flag
d darkplaces: improve tenebrae compatibility by handling EF_FULLDYNAMIC flag in tenebrae mode, also make all sprites render additive
+d darkplaces: add r_showtris cvar (Riot)
3 darkplaces: figure out BoxOnPlaneSide crash that happens in dpmod dpdm2 deathmatch 7 occasionally
2 darkplaces: add q2 sprite support sometime
0 dpmod: fix tilted corpse bug