Some fixes in capabilities

Lionel Ulmer lionel.ulmer at free.fr
Tue Nov 26 15:23:55 CST 2002


Hi all,

As long as we do not support multi-texturing in our D3D driver, fill the
caps properly. Now SS2 does not try to do multitexturing anymore (not that
it actually works now, it's just that it would break less :-) ).

Note: is there a way from DLL X to activate relay debugging ? What happens
      is that SS2 somehow freezes at one point and doing a relay trace from
      the start is about a 3 GB file... So what I would like to do is at a
      specific function in the D3D code that I know to be just before the
      freeze, call 'activate relay' and voila, I have relaying on :-) (to be
      able to do that for all DLLs would be even better).
      
      But well, considering DLL separation and all that, I doubt that this
      would be possible :-/

Changelog:
 - fix caps filling to be more in line with what we support
 - optimize a little bit the DrawPrimitve function

-- 
		 Lionel Ulmer - http://www.bbrox.org/
-------------- next part --------------
--- ../wine_work_base/dlls/ddraw/d3ddevice/mesa.c	Mon Nov 25 22:05:54 2002
+++ dlls/ddraw/d3ddevice/mesa.c	Tue Nov 26 22:19:14 2002
@@ -192,9 +192,22 @@
     d1->dwMinStippleHeight = 1;
     d1->dwMaxStippleWidth  = 32;
     d1->dwMaxStippleHeight = 32;
+    d1->dwMaxTextureRepeat = 16;
+    d1->dwMaxTextureAspectRatio = 1024;
+    d1->dwMaxAnisotropy = 0;
+    d1->dvGuardBandLeft = 0.0;
+    d1->dvGuardBandRight = 0.0;
+    d1->dvGuardBandTop = 0.0;
+    d1->dvGuardBandBottom = 0.0;
+    d1->dvExtentsAdjust = 0.0;
+    d1->dwStencilCaps = 0; /* TODO add proper caps according to what OpenGL can do */
+    d1->dwFVFCaps = D3DFVFCAPS_DONOTSTRIPELEMENTS | 1;
+    d1->dwTextureOpCaps = 0; /* TODO add proper caps according to OpenGL multi-texture stuff */
+    d1->wMaxTextureBlendStages = 1;  /* TODO add proper caps according to OpenGL multi-texture stuff */
+    d1->wMaxSimultaneousTextures = 1;  /* TODO add proper caps according to OpenGL multi-texture stuff */
 }
 
-#if 0 /* TODO : fix this... */
+#if 0 /* TODO : fix this and add multitexturing and other needed stuff */
 static void fill_device_capabilities(IDirectDrawImpl* ddraw)
 {
     x11_dd_private *private = (x11_dd_private *) ddraw->d->private;
@@ -601,8 +614,11 @@
   
     /* Puts GL in the correct lighting mode */
     if (glThis->vertex_type != d3dvt) {
-        if (glThis->vertex_type == D3DVT_TLVERTEX) {
-	    /* Need to put the correct transformation again */
+        if ((glThis->vertex_type == D3DVT_TLVERTEX) &&
+	     (d3dvt != D3DVT_TLVERTEX)) {
+	    /* Need to put the correct transformation again if we go from Transformed / Lighted
+	       vertices to non-transfromed ones.
+	    */
 	    glMatrixMode(GL_MODELVIEW);
 	    glLoadMatrixf((float *) glThis->world_mat);
 	    glMatrixMode(GL_PROJECTION);
@@ -625,14 +641,16 @@
 	        GLdouble height, width, minZ, maxZ;
 
 		TRACE("Transformed - Lighted Vertex\n");
-		/* First, disable lighting */
-		glDisable(GL_LIGHTING);
-
-		/* Then do not put any transformation matrixes */
-		glMatrixMode(GL_MODELVIEW);
-		glLoadIdentity();
-		glMatrixMode(GL_PROJECTION);
-		glLoadIdentity();
+		if (glThis->vertex_type != D3DVT_TLVERTEX) {
+		    /* First, disable lighting */
+		    glDisable(GL_LIGHTING);
+
+		    /* Then do not put any transformation matrixes */
+		    glMatrixMode(GL_MODELVIEW);
+		    glLoadIdentity();
+		    glMatrixMode(GL_PROJECTION);
+		    glLoadIdentity();
+		}
 
 		if (glThis->parent.current_viewport == NULL) {
 		    ERR("No current viewport !\n");


More information about the wine-patches mailing list