[nexuiz-commits] r7228 - trunk/data/qcsrc/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Jul 17 04:16:41 EDT 2009


Author: div0
Date: 2009-07-17 04:16:33 -0400 (Fri, 17 Jul 2009)
New Revision: 7228

Modified:
   trunk/data/qcsrc/client/Main.qc
   trunk/data/qcsrc/client/miscfunctions.qc
Log:
cs_*project: check if DP supports them in console coordinate space


Modified: trunk/data/qcsrc/client/Main.qc
===================================================================
--- trunk/data/qcsrc/client/Main.qc	2009-07-16 14:58:19 UTC (rev 7227)
+++ trunk/data/qcsrc/client/Main.qc	2009-07-17 08:16:33 UTC (rev 7228)
@@ -126,6 +126,11 @@
 
 
 	cs_project_is_b0rked = TRUE;
+	string w0, h0;
+	w0 = cvar_string("vid_conwidth");
+	h0 = cvar_string("vid_conheight");
+	cvar_set("vid_conwidth", "800");
+	cvar_set("vid_conheight", "600");
 	R_SetView(VF_VIEWPORT, '0 0 0', '640 480 0');
 	R_SetView(VF_FOV, '90 90 0');
 	R_SetView(VF_ORIGIN, '0 0 0');
@@ -134,11 +139,13 @@
 	makevectors('0 0 0');
 	vector v;
 	v = cs_project(v_forward);
-	if(v_x - 320 < +1)
-	if(v_x - 320 > -1)
-	if(v_y - 240 < +1)
-	if(v_y - 240 > -1)
+	if(v_x - 400 < +1)
+	if(v_x - 400 > -1)
+	if(v_y - 300 < +1)
+	if(v_y - 300 > -1)
 		cs_project_is_b0rked = FALSE;
+	cvar_set("vid_conwidth", w0);
+	cvar_set("vid_conheight", h0);
 
 	RegisterWeapons();
 

Modified: trunk/data/qcsrc/client/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/client/miscfunctions.qc	2009-07-16 14:58:19 UTC (rev 7227)
+++ trunk/data/qcsrc/client/miscfunctions.qc	2009-07-17 08:16:33 UTC (rev 7228)
@@ -293,11 +293,9 @@
 	vec = cs_project(vec);
 	if(cs_project_is_b0rked)
 	{
-		vec_x += vid_width / 2;
-		vec_y += vid_height / 2;
+		vec_x *= vid_conwidth / vid_width;
+		vec_y *= vid_conheight / vid_height;
 	}
-	vec_x *= vid_conwidth / vid_width;
-	vec_y *= vid_conheight / vid_height;
 	return vec;
 }
 



More information about the nexuiz-commits mailing list