r4634 - trunk/data/qcsrc/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Oct 5 05:58:25 EDT 2008


Author: div0
Date: 2008-10-05 05:58:24 -0400 (Sun, 05 Oct 2008)
New Revision: 4634

Modified:
   trunk/data/qcsrc/client/Main.qc
   trunk/data/qcsrc/client/View.qc
   trunk/data/qcsrc/client/waypointsprites.qc
Log:
work around engine crash by drawing 2D polygons after R_RenderView() (i.e. forcing some DrawQ call before)


Modified: trunk/data/qcsrc/client/Main.qc
===================================================================
--- trunk/data/qcsrc/client/Main.qc	2008-10-04 21:46:08 UTC (rev 4633)
+++ trunk/data/qcsrc/client/Main.qc	2008-10-05 09:58:24 UTC (rev 4634)
@@ -55,7 +55,7 @@
 }
 
 string forcefog;
-void WaypointSprite_Init();
+void WaypointSprite_Load();
 void CSQC_Init(void)
 {
 #ifdef USE_FTE
@@ -135,7 +135,7 @@
 	if(v_y - 240 > -1)
 		cs_project_is_b0rked = FALSE;
 
-	WaypointSprite_Init();
+	WaypointSprite_Load();
 }
 
 // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)

Modified: trunk/data/qcsrc/client/View.qc
===================================================================
--- trunk/data/qcsrc/client/View.qc	2008-10-04 21:46:08 UTC (rev 4633)
+++ trunk/data/qcsrc/client/View.qc	2008-10-05 09:58:24 UTC (rev 4634)
@@ -189,6 +189,7 @@
 	entity e;
 	float fov;
 	dprint_load();
+	WaypointSprite_Load();
 
 	// Render the Scene
 	view_origin = pmove_org + '0 0 1' * getstati(STAT_VIEWHEIGHT);
@@ -299,6 +300,11 @@
 	self = e;
 	R_RenderScene();
 
+	// now switch to 2D drawing mode by calling a 2D drawing function
+	// then polygon drawing will draw as 2D stuff, and NOT get queued until the
+	// next R_RenderScene call
+	drawstring('0 0 0', "", '1 1 0', '1 1 1', 0, 0);
+
 	// Draw the mouse cursor
 	// NOTE: drawpic must happen after R_RenderScene for some reason
 	//drawpic(getmousepos(), "gfx/cursor.tga", '11 14 0', '1 1 1', 1, 0);
@@ -315,19 +321,14 @@
 		ctf_view();
 	} else */
 
-	if(!draw_enginesbar)
-	{
-		if(cvar("r_letterbox") == 0)
-		if(cvar("viewsize") < 120)
-			CSQC_common_hud();
-	}
-
+	// draw 2D entities
 	e = self;
 	for(self = world; (self = nextent(self)); )
 		if(self.draw2d)
 			self.draw2d();
 	self = e;
 	
+	// draw radar
 	if(gametype == GAME_ONSLAUGHT)
 	{
 		if(cvar("cl_teamradar") >= 2)
@@ -348,6 +349,14 @@
 			if(!scoreboard_active)
 				teamradar_view();
 	}
+
+	// draw sbar
+	if(!draw_enginesbar)
+	{
+		if(cvar("r_letterbox") == 0)
+		if(cvar("viewsize") < 120)
+			CSQC_common_hud();
+	}
 }
 
 void Sbar_Draw();

Modified: trunk/data/qcsrc/client/waypointsprites.qc
===================================================================
--- trunk/data/qcsrc/client/waypointsprites.qc	2008-10-04 21:46:08 UTC (rev 4633)
+++ trunk/data/qcsrc/client/waypointsprites.qc	2008-10-05 09:58:24 UTC (rev 4634)
@@ -17,6 +17,7 @@
 float waypointsprite_minalpha;
 float waypointsprite_distancealphaexponent;
 float waypointsprite_timealphaexponent;
+float waypointsprite_scale;
 
 .float rule;
 .string netname; // primary picture
@@ -169,7 +170,7 @@
 	}
 	o_z = 0;
 
-	drawrotpic(o, rot * 90 * DEG2RAD, strcat("models/sprites/", spriteimage), SPRITE_SIZE, SPRITE_HOTSPOT, '1 1 1', a, 0);
+	drawrotpic(o, rot * 90 * DEG2RAD, strcat("models/sprites/", spriteimage), SPRITE_SIZE * waypointsprite_scale, SPRITE_HOTSPOT * waypointsprite_scale, '1 1 1', a, 0);
 }
 
 void Ent_WaypointSprite()
@@ -245,7 +246,7 @@
 		strunzone(self.netname3);
 }
 
-void WaypointSprite_Init()
+void WaypointSprite_Load()
 {
 	waypointsprite_fadedistance = vlen(world.maxs - world.mins);
 	waypointsprite_normdistance = cvar("g_waypointsprite_normdistance");
@@ -253,4 +254,7 @@
 	waypointsprite_minalpha = cvar("g_waypointsprite_minalpha");
 	waypointsprite_distancealphaexponent = cvar("g_waypointsprite_distancealphaexponent");
 	waypointsprite_timealphaexponent = cvar("g_waypointsprite_timealphaexponent");
+	waypointsprite_scale = cvar("g_waypointsprite_scale");
+	if(!waypointsprite_scale)
+		waypointsprite_scale = 1.0;
 }




More information about the nexuiz-commits mailing list