Browse Source

fix bug in previous checkin

cxgeorge 25 years ago
parent
commit
f1f03d5f33
1 changed files with 4 additions and 22 deletions
  1. 4 22
      panda/src/dxgsg/dxGraphicsStateGuardian.cxx

+ 4 - 22
panda/src/dxgsg/dxGraphicsStateGuardian.cxx

@@ -2073,31 +2073,13 @@ draw_tri(const GeomTri *geom) {
 			dps_data.diffuse.lpvData = (VOID*)pConvertedColorArray;
 			dps_data.diffuse.lpvData = (VOID*)pConvertedColorArray;
 			dps_data.diffuse.dwStride = sizeof(D3DCOLOR);
 			dps_data.diffuse.dwStride = sizeof(D3DCOLOR);
 
 
-			// Geom nodes store floats for colors, drawprim requires ARGB dwords
-			// BUGBUG: eventually this hack every-frame all-colors conversion needs 
-			// to be done only once as part of a vertex buffer
-
-			if(_color_transform_enabled || _alpha_transform_enabled) {
-				for (int i=0;i<nPrims;i++) {
-					D3DCOLOR RGBA_color;
-					transform_color(colors[i],RGBA_color);
-					add_DWORD_to_FVFBuf(RGBA_color);
-				}
-			} else 
- 			 for (int i=0;i<nPrims;i++) {
-				Colorf out_color=colors[i];
-				add_DWORD_to_FVFBuf(Colorf_to_D3DCOLOR(out_color));
-			 }
-
 			if (ColorBinding==G_PER_PRIM) {
 			if (ColorBinding==G_PER_PRIM) {
 				// must use tmp array to expand per-prim info to per-vert info
 				// must use tmp array to expand per-prim info to per-vert info
 
 
+				// Geom nodes store floats for colors, drawprim requires ARGB dwords
+				// BUGBUG: eventually this hack every-frame all-colors conversion needs 
+				// to be done only once as part of a vertex buffer
 
 
-	// Geom nodes store floats for colors, drawprim requires ARGB dwords
-			// BUGBUG: eventually this hack every-frame all-colors conversion needs 
-			// to be done only once as part of a vertex buffer
-
-				// eventually want to do this conversion once in retained mode
 				if (NeededShadeMode!=D3DSHADE_FLAT) {
 				if (NeededShadeMode!=D3DSHADE_FLAT) {
 					// but if lighting enabled, we need to color every vert since shading will be GOURAUD
 					// but if lighting enabled, we need to color every vert since shading will be GOURAUD
 
 
@@ -2111,7 +2093,7 @@ draw_tri(const GeomTri *geom) {
 					 } else {
 					 } else {
 						for (int i=0;i<nPrims;i++,pInColor++,pOutColor+=dwVertsPerPrim) {
 						for (int i=0;i<nPrims;i++,pInColor++,pOutColor+=dwVertsPerPrim) {
 							D3DCOLOR newcolr;
 							D3DCOLOR newcolr;
-							transform_color((*pInColor),newcolr);
+							transform_color(*pInColor,newcolr);
 
 
 							*pOutColor     = newcolr;
 							*pOutColor     = newcolr;
 							*(pOutColor+1) = newcolr;
 							*(pOutColor+1) = newcolr;