CFILE, graphics patch

Taylor Richards mtrs at bellsouth.net
Mon May 26 23:44:28 EDT 2003


I just committed a cfile patch to fix a problem with the userdir patch
that was previously put in.  I've mentioned it here before but forgot to
put it in for some reason.  The basics were that the game was designed
to have only one primary root and we're using two.  The patch makes sure
that all of the files in the second root (the game directory) are
scanned and used.

The attached patch fixes a problem with weapon transparency that I
complained about once upon a time ago.  It showed up with any weapons
that use the green color, a black line could be seen as that color was
made transparent.  I've been using this for almost a month now without
side effects but other than the weapon problem there doesn't seem to be
any other benefit either.  I'll commit tomorrow night unless told
otherwise.


Taylor

-- 
Taylor Richards <mtrs at bellsouth.net>
-------------- next part --------------
? weapon_trans.patch
Index: src/bmpman/bmpman.cpp
===================================================================
RCS file: /cvs/cvsroot/freespace2/src/bmpman/bmpman.cpp,v
retrieving revision 1.9
diff -u -r1.9 bmpman.cpp
--- src/bmpman/bmpman.cpp	2002/06/09 04:41:15	1.9
+++ src/bmpman/bmpman.cpp	2003/05/27 03:29:52
@@ -2407,13 +2407,12 @@
 	} else if(gr_screen.mode == GR_SOFTWARE){
 		bm_set_components = bm_set_components_argb;
 	} else if(gr_screen.mode == GR_OPENGL){
-		bm_set_components = bm_set_components_argb;
+		bm_set_components = bm_set_components_argb_d3d_32_screen;
 	}
 }
 
 void BM_SELECT_TEX_FORMAT()
 {
-#ifndef PLAT_UNIX
 	Gr_current_red = &Gr_t_red; 
 	Gr_current_green = &Gr_t_green; 
 	Gr_current_blue = &Gr_t_blue; 
@@ -2422,9 +2421,7 @@
 	// setup pointers
 	if(gr_screen.mode == GR_GLIDE){
 		bm_set_components = bm_set_components_argb;
-	} else
-#endif
-	if(gr_screen.mode == GR_DIRECT3D){
+	} else if(gr_screen.mode == GR_DIRECT3D){
 		if(Bm_pixel_format == BM_PIXEL_FORMAT_D3D){
 			bm_set_components = bm_set_components_d3d;
 		} else {
@@ -2437,7 +2434,7 @@
 	} else if(gr_screen.mode == GR_SOFTWARE){
 		bm_set_components = bm_set_components_argb;
 	} else if(gr_screen.mode == GR_OPENGL){
-		bm_set_components = bm_set_components_argb;
+		bm_set_components = bm_set_components_argb_d3d_32_tex;
 	}
 }
 
@@ -2464,7 +2461,7 @@
 	} else if(gr_screen.mode == GR_SOFTWARE){
 		bm_set_components = bm_set_components_argb;
 	} else if(gr_screen.mode == GR_OPENGL){
-		bm_set_components = bm_set_components_argb;
+		bm_set_components = bm_set_components_argb_d3d_32_tex;
 	}
 }
 
Index: src/graphics/gropengl.cpp
===================================================================
RCS file: /cvs/cvsroot/freespace2/src/graphics/gropengl.cpp,v
retrieving revision 1.63
diff -u -r1.63 gropengl.cpp
--- src/graphics/gropengl.cpp	2003/05/09 05:05:52	1.63
+++ src/graphics/gropengl.cpp	2003/05/27 03:29:53
@@ -2947,6 +2947,22 @@
 	}
 
 	// DDOI - set these so no one else does!
+	Gr_t_red.mask = Gr_red.mask;
+	Gr_t_red.shift = Gr_red.shift;
+	Gr_t_red.scale = Gr_red.scale;
+
+	Gr_t_green.mask = Gr_green.mask;
+	Gr_t_green.shift = Gr_green.shift;
+	Gr_t_green.scale = Gr_green.scale;
+	
+	Gr_t_blue.mask = Gr_blue.mask;
+	Gr_t_blue.shift = Gr_blue.shift;
+	Gr_t_blue.scale = Gr_blue.scale;
+	
+	Gr_t_alpha.mask = 0x8000;
+	Gr_t_alpha.scale = 255;
+	Gr_t_alpha.shift = 15;
+
 	Gr_ta_red.mask = 0x0f00;
 	Gr_ta_red.shift = 8;
 	Gr_ta_red.scale = 16;


More information about the freespace2 mailing list