r5485 - trunk/data/qcsrc/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jan 10 15:03:47 EST 2009


Author: div0
Date: 2009-01-10 15:03:46 -0500 (Sat, 10 Jan 2009)
New Revision: 5485

Modified:
   trunk/data/qcsrc/client/Defs.qc
   trunk/data/qcsrc/client/Main.qc
   trunk/data/qcsrc/client/View.qc
   trunk/data/qcsrc/client/sbar.qc
Log:
add a test csse for the blur: "blurtest" (only when compiled with -DBLURTEST)
example:
cl_cmd blurtest 1 100 0.3


Modified: trunk/data/qcsrc/client/Defs.qc
===================================================================
--- trunk/data/qcsrc/client/Defs.qc	2009-01-10 18:15:51 UTC (rev 5484)
+++ trunk/data/qcsrc/client/Defs.qc	2009-01-10 20:03:46 UTC (rev 5485)
@@ -209,3 +209,7 @@
 // database for misc stuff
 float tempdb;
 vector hook_shotorigin;
+
+#ifdef BLURTEST
+float blurtest_time0, blurtest_time1, blurtest_radius, blurtest_power;
+#endif

Modified: trunk/data/qcsrc/client/Main.qc
===================================================================
--- trunk/data/qcsrc/client/Main.qc	2009-01-10 18:15:51 UTC (rev 5484)
+++ trunk/data/qcsrc/client/Main.qc	2009-01-10 20:03:46 UTC (rev 5485)
@@ -319,6 +319,14 @@
 	else if(cmd == "sbar_columns_help") {
 		Cmd_Sbar_Help(argc);
 	}
+#ifdef BLURTEST
+	else if(cmd == "blurtest") {
+		blurtest_time0 = time;
+		blurtest_time1 = time + stof(argv(1));
+		blurtest_radius = stof(argv(2));
+		blurtest_power = stof(argv(3));
+	}
+#endif
 	
 	return false;
 }

Modified: trunk/data/qcsrc/client/View.qc
===================================================================
--- trunk/data/qcsrc/client/View.qc	2009-01-10 18:15:51 UTC (rev 5484)
+++ trunk/data/qcsrc/client/View.qc	2009-01-10 20:03:46 UTC (rev 5485)
@@ -231,6 +231,25 @@
 		vid_height = h;
 	}
 
+#ifdef BLURTEST
+	if(time > blurtest_time0 && time < blurtest_time1)
+	{
+		float r, t;
+
+		t = (time - blurtest_time0) / (blurtest_time1 - blurtest_time0);
+		r = t * blurtest_radius;
+		f = 1 / pow(t, blurtest_power) - 1;
+
+		cvar_set("r_glsl_postprocess", "1");
+		cvar_set("r_glsl_postprocess_uservec1", strcat(ftos(r), " ", ftos(f), " 0 0"));
+	}
+	else
+	{
+		cvar_set("r_glsl_postprocess", "0");
+		cvar_set("r_glsl_postprocess_uservec1", "0 0 0 0");
+	}
+#endif
+
 	Fog_Force();
 
 	drawframetime = max(0.000001, time - drawtime);

Modified: trunk/data/qcsrc/client/sbar.qc
===================================================================
--- trunk/data/qcsrc/client/sbar.qc	2009-01-10 18:15:51 UTC (rev 5484)
+++ trunk/data/qcsrc/client/sbar.qc	2009-01-10 20:03:46 UTC (rev 5485)
@@ -1567,7 +1567,7 @@
 	if(teamplay)
 	{
 		entity tm;
-		float size;
+		float teamsize;
 		tm = teams.sort_next;
 		if (tm)
 		{
@@ -1575,14 +1575,14 @@
 			{
 				if(!tm.team_size || tm.team == COLOR_SPECTATOR)
 					continue;
-				if(!size)
-					size = tm.team_size;
-				size = min(size, tm.team_size);
+				if(!teamsize)
+					teamsize = tm.team_size;
+				teamsize = min(teamsize, tm.team_size);
 			}
-			if (size)
+			if (teamsize)
 			{
 				tm = GetTeam(GetPlayerColor(player_localentnum), false);
-				if (tm && tm.team != COLOR_SPECTATOR && (tm.team_size - size) > 1)
+				if (tm && tm.team != COLOR_SPECTATOR && (tm.team_size - teamsize) > 1)
 				{
 					s = strcat(blinkcolor, "Teamnumbers are unbalanced! Press ^3", getcommandkey("team menu", "menu_showteamselect"), blinkcolor, " to adjust");
 					o = Sbar_DrawNoteLine(o, s);




More information about the nexuiz-commits mailing list