From: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Thu, 23 Feb 2006 10:34:56 +0000 (+0000)
Subject: changed r_speeds to only display timings with r_speeds 2, r_speeds 1 now only display... 
X-Git-Tag: xonotic-v0.1.0preview~4300
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5163fd73bd1c603f686adab6ec5ff6b4a35bbc89;p=xonotic%2Fdarkplaces.git

changed r_speeds to only display timings with r_speeds 2, r_speeds 1 now only displays statistics (no glFinish needed so this is much faster)


git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6013 d7cf8633-e32d-0410-b094-e92efae38249
---

diff --git a/cl_screen.c b/cl_screen.c
index 03fa3615..f4e11ba7 100644
--- a/cl_screen.c
+++ b/cl_screen.c
@@ -484,7 +484,7 @@ void R_TimeReport(char *desc)
 	int length;
 	int t;
 
-	if (!r_timereport_active || r_showtrispass)
+	if (r_speeds.integer < 2 || !r_timereport_active || r_showtrispass)
 		return;
 
 	qglFinish();
@@ -538,12 +538,16 @@ void R_TimeReport_Start(void)
 
 void R_TimeReport_End(void)
 {
+	int i, j, lines, y;
+
 	r_timereport_current = r_timereport_start;
 	R_TimeReport("total");
 
-	if (r_timereport_active)
+	j = (int)strlen(r_speeds_string);
+	if (r_timereport_active && j > 0)
 	{
-		int i, j, lines, y;
+		if (r_speeds_string[j-1] == '\n')
+			r_speeds_string[j-1] = 0;
 		lines = 1;
 		for (i = 0;r_speeds_string[i];i++)
 			if (r_speeds_string[i] == '\n')