Changed: [dx74] dxt1/3/5 support fixed]

Jason Edmeades us at the-edmeades.demon.co.uk
Thu Aug 14 17:53:22 CDT 2003


Please use this version instead

Changelog

DXT1/3/5 support was broken, but unnoticable since we also indicated it 
wasnt supported.

Note it also fixes the logic bug I put in with my last patch.
Jason
-------------- next part --------------
Index: dlls/d3d8/d3d8_main.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/d3d8_main.c,v
retrieving revision 1.11
diff -u -r1.11 d3d8_main.c
--- dlls/d3d8/d3d8_main.c	8 Aug 2003 21:07:23 -0000	1.11
+++ dlls/d3d8/d3d8_main.c	14 Aug 2003 22:45:27 -0000
@@ -50,6 +50,7 @@
     IDirect3D8Impl *object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D8Impl));
 
     object->lpVtbl = &Direct3D8_Vtbl;
+    object->direct3d8 = object;
     object->ref = 1;
 
     TRACE("SDKVersion = %x, Created Direct3D object at %p\n", SDKVersion, object);
Index: dlls/d3d8/d3d8_private.h
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/d3d8_private.h,v
retrieving revision 1.43
diff -u -r1.43 d3d8_private.h
--- dlls/d3d8/d3d8_private.h	5 Aug 2003 19:18:58 -0000	1.43
+++ dlls/d3d8/d3d8_private.h	14 Aug 2003 22:45:29 -0000
@@ -249,6 +249,7 @@
 
     /* IDirect3D8 fields */
     GL_Info                 gl_info;
+    IDirect3D8Impl         *direct3d8;
 };
 
 /* IUnknown: */
Index: dlls/d3d8/device.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/device.c,v
retrieving revision 1.78
diff -u -r1.78 device.c
--- dlls/d3d8/device.c	5 Aug 2003 19:18:58 -0000	1.78
+++ dlls/d3d8/device.c	14 Aug 2003 22:45:34 -0000
@@ -2813,8 +2813,7 @@
        /* If Alpha arg1 is texture then handle the special case when there changes between a
           texture and no texture - See comments in set_tex_op                                  */
        if ((This->StateBlock->texture_state[Stage][D3DTSS_ALPHAARG1] == D3DTA_TEXTURE) && 
-           ((oldTxt == NULL) && (pTexture != NULL)) || 
-           ((pTexture == NULL) && (oldTxt != NULL))) 
+           (((oldTxt == NULL) && (pTexture != NULL)) || ((pTexture == NULL) && (oldTxt != NULL))))
        {
            reapplyFlags |= REAPPLY_ALPHAOP;
        }
@@ -3096,6 +3095,7 @@
 	      glDisable(GL_TEXTURE_GEN_S);
 	      glDisable(GL_TEXTURE_GEN_T);
 	      glDisable(GL_TEXTURE_GEN_R);
+              checkGLcall("glDisable(GL_TEXTURE_GEN_S,T,R)");
               break;
 
             case D3DTSS_TCI_CAMERASPACEPOSITION:
Index: dlls/d3d8/directx.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/directx.c,v
retrieving revision 1.46
diff -u -r1.46 directx.c
--- dlls/d3d8/directx.c	5 Aug 2003 18:29:20 -0000	1.46
+++ dlls/d3d8/directx.c	14 Aug 2003 22:45:36 -0000
@@ -320,6 +320,15 @@
 	  RType, debug_d3dressourcetype(RType), 
 	  CheckFormat, debug_d3dformat(CheckFormat));
 
+    if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) {
+        switch (CheckFormat) {
+        case D3DFMT_DXT1:
+        case D3DFMT_DXT3:
+        case D3DFMT_DXT5:
+            return D3D_OK;
+        }
+    }
+
     switch (CheckFormat) {
     case D3DFMT_UYVY:
     case D3DFMT_YUY2:
Index: dlls/d3d8/utils.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/utils.c,v
retrieving revision 1.9
diff -u -r1.9 utils.c
--- dlls/d3d8/utils.c	3 Jul 2003 18:10:22 -0000	1.9
+++ dlls/d3d8/utils.c	14 Aug 2003 22:45:39 -0000
@@ -409,22 +409,8 @@
 }
 
 GLint D3DFmt2GLIntFmt(IDirect3DDevice8Impl* This, D3DFORMAT fmt) {
-    GLint retVal;
+    GLint retVal = 0;
 
-    switch (fmt) {
-    case D3DFMT_P8:               retVal = GL_COLOR_INDEX8_EXT; break;
-    case D3DFMT_A8P8:             retVal = GL_COLOR_INDEX8_EXT; break;
-
-    case D3DFMT_A4R4G4B4:         retVal = GL_RGBA4; break;
-    case D3DFMT_A8R8G8B8:         retVal = GL_RGBA8; break;
-    case D3DFMT_X8R8G8B8:         retVal = GL_RGB8; break;
-    case D3DFMT_R8G8B8:           retVal = GL_RGB8; break;
-    case D3DFMT_R5G6B5:           retVal = GL_RGB5; break; /* fixme: internal format 6 for g? */
-    case D3DFMT_A1R5G5B5:         retVal = GL_RGB5_A1; break;
-    default:
-        FIXME("Unhandled fmt(%u,%s)\n", fmt, debug_d3dformat(fmt));
-        retVal = GL_RGB8;
-    }
 #if defined(GL_EXT_texture_compression_s3tc)
     if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) {
       switch (fmt) {
@@ -437,6 +423,22 @@
       }
     }
 #endif
+    if (retVal == 0) {
+        switch (fmt) {
+        case D3DFMT_P8:               retVal = GL_COLOR_INDEX8_EXT; break;
+        case D3DFMT_A8P8:             retVal = GL_COLOR_INDEX8_EXT; break;
+
+        case D3DFMT_A4R4G4B4:         retVal = GL_RGBA4; break;
+        case D3DFMT_A8R8G8B8:         retVal = GL_RGBA8; break;
+        case D3DFMT_X8R8G8B8:         retVal = GL_RGB8; break;
+        case D3DFMT_R8G8B8:           retVal = GL_RGB8; break;
+        case D3DFMT_R5G6B5:           retVal = GL_RGB5; break; /* fixme: internal format 6 for g? */
+        case D3DFMT_A1R5G5B5:         retVal = GL_RGB5_A1; break;
+        default:
+            FIXME("Unhandled fmt(%u,%s)\n", fmt, debug_d3dformat(fmt));
+            retVal = GL_RGB8;
+        }
+    }
     TRACE("fmt2glintFmt for fmt(%u,%s) = %x\n", fmt, debug_d3dformat(fmt), retVal);
     return retVal;
 }


More information about the wine-patches mailing list