Fix build in d3d8 #1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First patch, should fix Stefans problems.

By copy Raphael, we prob need to use the new GL_SUPPORT for the
subtract, but I am trying to get people compiling again!

Changelog

Make sure constants are referred to correctly if not gl 1.3 in headers

Jason
Index: dlls/d3d8/utils.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/utils.c,v
retrieving revision 1.4
diff -u -r1.4 utils.c
--- dlls/d3d8/utils.c	4 Jun 2003 22:20:47 -0000	1.4
+++ dlls/d3d8/utils.c	5 Jun 2003 21:47:36 -0000
@@ -579,7 +579,7 @@
 		opr0_target = useext(GL_OPERAND0_ALPHA);
 		opr1_target = useext(GL_OPERAND1_ALPHA);
 		opr2_target = useext(GL_OPERAND2_ALPHA);
-		scal_target = useext(GL_ALPHA_SCALE);
+		scal_target = GL_ALPHA_SCALE;
 	}
 	else {
 		comb_target = useext(GL_COMBINE_RGB);
@@ -713,9 +713,17 @@
 		checkGLcall("GL_TEXTURE_ENV, scal_target, 2");
 		break;
         case D3DTOP_SUBTRACT:
-#if defined(GL_VERSION_1_3) || defined (GL_ARB_texture_env_combine)
-		glTexEnvi(GL_TEXTURE_ENV, comb_target, useext(GL_SUBTRACT));
+#if defined(GL_VERSION_1_3) 
+		glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_SUBTRACT);
+                checkGLcall("GL_TEXTURE_ENV, comb_target, useext(GL_SUBTRACT)");
+#elif defined (GL_ARB_texture_env_combine)
+                glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_SUBTRACT_ARB);
 		checkGLcall("GL_TEXTURE_ENV, comb_target, useext(GL_SUBTRACT)");
+#else
+                FIXME("D3DTOP_SUBTRACT not supported on this opengl implementation\n");
+		glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_ADD);
+		checkGLcall("GL_TEXTURE_ENV, comb_target, GL_ADD");
+#endif
 		glTexEnvi(GL_TEXTURE_ENV, src0_target, src1);
 		checkGLcall("GL_TEXTURE_ENV, src0_target, src1");
 		glTexEnvi(GL_TEXTURE_ENV, opr0_target, opr1);
@@ -726,9 +734,6 @@
 		checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
 		glTexEnvi(GL_TEXTURE_ENV, scal_target, 1);
 		checkGLcall("GL_TEXTURE_ENV, scal_target, 1");
-#else
-                FIXME("This version of opengl does not support GL_SUBTRACT\n");
-#endif
 		break;
 	case D3DTOP_BLENDDIFFUSEALPHA:
 		glTexEnvi(GL_TEXTURE_ENV, comb_target, useext(GL_INTERPOLATE));
@@ -741,7 +746,7 @@
 		checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
 		glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
 		checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
-		glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_PRIMARY_COLOR);
+		glTexEnvi(GL_TEXTURE_ENV, src2_target, useext(GL_PRIMARY_COLOR));
 		checkGLcall("GL_TEXTURE_ENV, src2_target, GL_PRIMARY_COLOR");
 		glTexEnvi(GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA);
 		checkGLcall("GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA");
@@ -777,7 +782,7 @@
 		checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
 		glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
 		checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
-		glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_CONSTANT);
+		glTexEnvi(GL_TEXTURE_ENV, src2_target, useext(GL_CONSTANT));
 		checkGLcall("GL_TEXTURE_ENV, src2_target, GL_CONSTANT");
 		glTexEnvi(GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA);
 		checkGLcall("GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA");
@@ -795,7 +800,7 @@
 		checkGLcall("GL_TEXTURE_ENV, src1_target, src2");
 		glTexEnvi(GL_TEXTURE_ENV, opr1_target, opr2);
 		checkGLcall("GL_TEXTURE_ENV, opr1_target, opr2");
-		glTexEnvi(GL_TEXTURE_ENV, src2_target, GL_PREVIOUS);
+		glTexEnvi(GL_TEXTURE_ENV, src2_target, useext(GL_PREVIOUS));
 		checkGLcall("GL_TEXTURE_ENV, src2_target, GL_PREVIOUS");
 		glTexEnvi(GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA);
 		checkGLcall("GL_TEXTURE_ENV, opr2_target, GL_SRC_ALPHA");

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux