R_Speeds De-Spammification

 

Copyright info

All code in this tutorial is protected by the [GPL License].
All text in this tutorial is protected by the [FDL License].

 

Tutorial by: Echon

Mailto: n_blast@hotmail.com

open up ref_gl\gl_rmain.c and goto where 'void R_RenderView (refdef_t *fd)' is at at the bottom of it, change this:

 
 
    if (r_speeds->value)
    {
        ri.Con_Printf (PRINT_ALL, "%4i wpoly %4i epoly %i tex %i lmaps\n",
            c_brush_polys, 
            c_alias_polys, 
            c_visible_textures, 
            c_visible_lightmaps); 
    }
 
     

to this:

 
 
/* ECHON {  removed the annoying console spam - newer drawchar version around here somewhere
    if (r_speeds->value)
    {
        ri.Con_Printf (PRINT_ALL, "%4i wpoly %4i epoly %i tex %i lmaps\n",
            c_brush_polys, 
            c_alias_polys, 
            c_visible_textures, 
            c_visible_lightmaps); 
    }
ECHON } */
 
     


you're commenting it out so that it wont spammify the console anymore....
scroll down to where 'void R_SetGL2D (void)' is and put this just above it:

 
 
int R_DrawRSpeeds(char* S) {
    return sprintf (S,"%4i wpoly %4i epoly %i tex %i lmaps",
    c_brush_polys, 
    c_alias_polys, 
      c_visible_textures, 
    c_visible_lightmaps);
}
 
     

then inside of 'void R_SetGL2D (void)' underneath this:

 
 
    qglDisable (GL_DEPTH_TEST);
    qglDisable (GL_CULL_FACE);
    qglDisable (GL_BLEND);
    qglEnable (GL_ALPHA_TEST);
    qglColor4f (1,1,1,1);
 
     

add this:

 
 
    // ECHON {
    if (r_speeds->value)
    {
        char S[128];
        int n=0;
        int i;
            n=R_DrawRSpeeds(S);
        for (i=0;i< FONT>
     

there you go! now when you set r_speeds 1, it won't spam the hell out of the console, it will drawchar it to the bottom right of the screen
make sure you edit its current position if you want it somewhere else...
- Echon (irc.telefragged.com #openquake regularly)

 

 

Tutorial Originally found at: