]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_screen.c
added back r_speeds2, with masses of information (6 lines high), and made it print...
[xonotic/darkplaces.git] / gl_screen.c
index 09e5ae0346bf637610fa1e6691d2681db2f52c8f..0e593950b467a474dcdc4ab275f31dabb3c0f0cf 100644 (file)
@@ -541,14 +541,14 @@ void SCR_SetUpToDrawConsole (void)
        
        if (scr_conlines < scr_con_current)
        {
-               scr_con_current -= scr_conspeed.value*host_frametime;
+               scr_con_current -= scr_conspeed.value*host_realframetime;
                if (scr_conlines > scr_con_current)
                        scr_con_current = scr_conlines;
 
        }
        else if (scr_conlines > scr_con_current)
        {
-               scr_con_current += scr_conspeed.value*host_frametime;
+               scr_con_current += scr_conspeed.value*host_realframetime;
                if (scr_conlines < scr_con_current)
                        scr_con_current = scr_conlines;
        }
@@ -583,11 +583,11 @@ void SCR_DrawConsole (void)
 ============================================================================== 
 */ 
 
-/* 
+/*
 ================== 
 SCR_ScreenShot_f
 ================== 
-*/  
+*/
 void SCR_ScreenShot_f (void) 
 {
        byte            *buffer;
@@ -615,13 +615,13 @@ void SCR_ScreenShot_f (void)
                return;
        }
 
-       buffer = malloc(glwidth*glheight*3);
+       buffer = qmalloc(glwidth*glheight*3);
        glReadPixels (glx, gly, glwidth, glheight, GL_RGB, GL_UNSIGNED_BYTE, buffer); 
-       Image_WriteTGARGB(filename, glwidth, glheight, buffer);
+       Image_WriteTGARGB_preflipped(filename, glwidth, glheight, buffer);
 
-       free (buffer);
+       qfree(buffer);
        Con_Printf ("Wrote %s\n", filename);
-} 
+}
 
 
 //=============================================================================
@@ -750,7 +750,7 @@ int SCR_ModalMessage (char *text)
 ===============
 SCR_BringDownConsole
 
-Brings the console down and fades the palettes back to normal
+Brings the console down and fades the blends back to normal
 ================
 */
 void SCR_BringDownConsole (void)
@@ -762,7 +762,7 @@ void SCR_BringDownConsole (void)
        for (i=0 ; i<20 && scr_conlines != scr_con_current ; i++)
                SCR_UpdateScreen ();
 
-       cl.cshifts[0].percent = 0;              // no area contents palette on next frame
+       cl.cshifts[0].percent = 0;              // no area contents blend on next frame
 }
 
 void DrawCrosshair(int num);
@@ -772,6 +772,7 @@ extern void SHOWLMP_drawall();
 extern cvar_t contrast;
 extern cvar_t brightness;
 extern cvar_t gl_lightmode;
+extern cvar_t r_speeds2;
 
 void GL_BrightenScreen()
 {
@@ -916,7 +917,7 @@ void SCR_UpdateScreen (void)
        else
        {
                if (crosshair.value)
-                       DrawCrosshair(crosshair.value);
+                       DrawCrosshair(crosshair.value - 1);
                
                SCR_DrawRam ();
                SCR_DrawNet ();
@@ -936,13 +937,24 @@ void SCR_UpdateScreen (void)
                char temp[32];
                int calc;
                newtime = Sys_FloatTime();
-               calc = (int) (100.0 / (newtime - currtime));
-               sprintf(temp, "% 4i.%02i fps", calc / 100, calc % 100);
+               calc = (int) ((1.0 / (newtime - currtime)) + 0.5);
+               sprintf(temp, "%4i fps", calc);
                currtime = newtime;
-               Draw_String(vid.width - (12*8), 0, temp, 9999);
+               Draw_String(vid.width - (8*8), vid.height - sb_lines - 8, temp, 9999);
+       }
+
+       if (r_speeds2.value)
+       {
+               extern char r_speeds2_string1[81], r_speeds2_string2[81], r_speeds2_string3[81], r_speeds2_string4[81], r_speeds2_string5[81], r_speeds2_string6[81];
+               Draw_String(0, vid.height - sb_lines - 48, r_speeds2_string1, 80);
+               Draw_String(0, vid.height - sb_lines - 40, r_speeds2_string2, 80);
+               Draw_String(0, vid.height - sb_lines - 32, r_speeds2_string3, 80);
+               Draw_String(0, vid.height - sb_lines - 24, r_speeds2_string4, 80);
+               Draw_String(0, vid.height - sb_lines - 16, r_speeds2_string5, 80);
+               Draw_String(0, vid.height - sb_lines -  8, r_speeds2_string6, 80);
        }
 
-       V_UpdatePalette ();
+       V_UpdateBlends ();
 
        GL_BrightenScreen();
 
@@ -951,7 +963,7 @@ void SCR_UpdateScreen (void)
        if (r_speeds.value)
        {
                time2 = Sys_FloatTime ();
-               Con_Printf ("%3i ms  %4i wpoly %4i epoly %4i transpoly %4i lightpoly %4i BSPnodes %4i BSPleafs\n", (int)((time2-time1)*1000), c_brush_polys, c_alias_polys, currenttranspoly, c_light_polys, c_nodes, c_leafs);
+               Con_Printf ("%3i ms  %4i wpoly %4i epoly %4i transpoly %4i lightpoly %4i BSPnodes %4i BSPleafs %4i BSPfaces %4i models %4i bmodels %4i sprites %4i particles %3i dlights\n", (int)((time2-time1)*1000), c_brush_polys, c_alias_polys, currenttranspoly, c_light_polys, c_nodes, c_leafs, c_faces, c_models, c_bmodels, c_sprites, c_particles, c_dlights);
        }
        GL_EndRendering ();
 }