d3d: Fix the D3DFMT_XXX constant declarations.

Francois Gouget fgouget at free.fr
Wed Jan 17 10:32:09 CST 2007


Don't test D3DFMT_W11V11U10 in d3d9/tests/device.c because it is not defined by d3d9types.h. Add a couple of missing D3DFMT_XXX tests.
This fixes the d3d9 test compilation with the Direct X SDK.
---

In the previous patch I missed that the D3DFMT_R5G6B5 test did not pass 
because the failure was lost in other traces. So I have disabled it this 
time so that all the tests should pass now.


 dlls/d3d9/tests/device.c     |    9 +++++----
 dlls/ddraw/utils.c           |    2 +-
 dlls/wined3d/utils.c         |    4 ++--
 include/d3d8types.h          |    3 +++
 include/d3d9types.h          |    5 ++---
 include/wine/wined3d_types.h |    4 ++--
 6 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c
index 91fbfd5..34108d5 100644
--- a/dlls/d3d9/tests/device.c
+++ b/dlls/d3d9/tests/device.c
@@ -868,9 +868,11 @@ static void test_display_modes(void)
     ok(res==(r), "EnumAdapterModes("#x") did not return "#r" (got %s)!\n", DXGetErrorString9(res)); \
 } while(0)
 
-    TEST_FMT(D3DFMT_X1R5G5B5, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_R8G8B8, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_A8R8G8B8, D3DERR_INVALIDCALL);
+    TEST_FMT(D3DFMT_X8B8G8R8, D3DERR_INVALIDCALL);
+    /* D3DFMT_R5G6B5 */
+    TEST_FMT(D3DFMT_X1R5G5B5, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_A1R5G5B5, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_A4R4G4B4, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_R3G3B2, D3DERR_INVALIDCALL);
@@ -896,7 +898,6 @@ static void test_display_modes(void)
     TEST_FMT(D3DFMT_X8L8V8U8, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_Q8W8V8U8, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_V16U16, D3DERR_INVALIDCALL);
-    TEST_FMT(D3DFMT_W11V11U10, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_A2W10V10U10, D3DERR_INVALIDCALL);
 
     TEST_FMT(D3DFMT_UYVY, D3DERR_INVALIDCALL);
@@ -906,7 +907,7 @@ static void test_display_modes(void)
     TEST_FMT(D3DFMT_DXT3, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_DXT4, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_DXT5, D3DERR_INVALIDCALL);
-    TEST_FMT(D3DFMT_MULTI2_ARGB, D3DERR_INVALIDCALL);
+    TEST_FMT(D3DFMT_MULTI2_ARGB8, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_G8R8_G8B8, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_R8G8_B8G8, D3DERR_INVALIDCALL);
 
@@ -925,7 +926,7 @@ static void test_display_modes(void)
     TEST_FMT(D3DFMT_INDEX16, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_INDEX32, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_Q16W16V16U16, D3DERR_INVALIDCALL);
-    /* Flaoting point formats */
+    /* Floating point formats */
     TEST_FMT(D3DFMT_R16F, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_G16R16F, D3DERR_INVALIDCALL);
     TEST_FMT(D3DFMT_A16B16G16R16F, D3DERR_INVALIDCALL);
diff --git a/dlls/ddraw/utils.c b/dlls/ddraw/utils.c
index a80688c..e1f02bb 100644
--- a/dlls/ddraw/utils.c
+++ b/dlls/ddraw/utils.c
@@ -255,7 +255,7 @@ PixelFormat_WineD3DtoDD(DDPIXELFORMAT *DDPixelFormat,
         case WINED3DFMT_DXT3:
         case WINED3DFMT_DXT4:
         case WINED3DFMT_DXT5:
-        case WINED3DFMT_MULTI2_ARGB:
+        case WINED3DFMT_MULTI2_ARGB8:
         case WINED3DFMT_G8R8_G8B8:
         case WINED3DFMT_R8G8_B8G8:
             DDPixelFormat->dwFlags = DDPF_FOURCC;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 94a29d2..6670c18 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -43,7 +43,7 @@ static const PixelFormatDesc formats[] = {
     {WINED3DFMT_DXT3        ,0x0        ,0x0        ,0x0        ,0x0        ,1      ,TRUE       ,GL_COMPRESSED_RGBA_S3TC_DXT3_EXT,GL_RGBA   ,GL_UNSIGNED_BYTE               },
     {WINED3DFMT_DXT4        ,0x0        ,0x0        ,0x0        ,0x0        ,1      ,TRUE       ,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,GL_RGBA   ,GL_UNSIGNED_BYTE               },
     {WINED3DFMT_DXT5        ,0x0        ,0x0        ,0x0        ,0x0        ,1      ,TRUE       ,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT,GL_RGBA   ,GL_UNSIGNED_BYTE               },
-    {WINED3DFMT_MULTI2_ARGB ,0x0        ,0x0        ,0x0        ,0x0        ,1/*?*/ ,TRUE       ,0                      ,0                  ,0                              },
+    {WINED3DFMT_MULTI2_ARGB8,0x0        ,0x0        ,0x0        ,0x0        ,1/*?*/ ,TRUE       ,0                      ,0                  ,0                              },
     {WINED3DFMT_G8R8_G8B8   ,0x0        ,0x0        ,0x0        ,0x0        ,1/*?*/ ,TRUE       ,0                      ,0                  ,0                              },
     {WINED3DFMT_R8G8_B8G8   ,0x0        ,0x0        ,0x0        ,0x0        ,1/*?*/ ,TRUE       ,0                      ,0                  ,0                              },
     /* IEEE formats */
@@ -174,7 +174,7 @@ const char* debug_d3dformat(WINED3DFORMAT fmt) {
     FMT_TO_STR(WINED3DFMT_DXT3);
     FMT_TO_STR(WINED3DFMT_DXT4);
     FMT_TO_STR(WINED3DFMT_DXT5);
-    FMT_TO_STR(WINED3DFMT_MULTI2_ARGB);
+    FMT_TO_STR(WINED3DFMT_MULTI2_ARGB8);
     FMT_TO_STR(WINED3DFMT_G8R8_G8B8);
     FMT_TO_STR(WINED3DFMT_R8G8_B8G8);
     FMT_TO_STR(WINED3DFMT_D16_LOCKABLE);
diff --git a/include/d3d8types.h b/include/d3d8types.h
index 6f9dc58..9f7f984 100644
--- a/include/d3d8types.h
+++ b/include/d3d8types.h
@@ -613,6 +613,8 @@ typedef enum _D3DFORMAT {
     D3DFMT_A8                   =  28,
     D3DFMT_A8R3G3B2             =  29,
     D3DFMT_X4R4G4B4             =  30,
+    D3DFMT_A2B10G10R10          =  31,
+    D3DFMT_G16R16               =  34,
 
     D3DFMT_A8P8                 =  40,
     D3DFMT_P8                   =  41,
@@ -627,6 +629,7 @@ typedef enum _D3DFORMAT {
     D3DFMT_Q8W8V8U8             =  63,
     D3DFMT_V16U16               =  64,
     D3DFMT_W11V11U10            =  65,
+    D3DFMT_A2W10V10U10          =  67,
 
     D3DFMT_UYVY                 =  MAKEFOURCC('U', 'Y', 'V', 'Y'),
     D3DFMT_YUY2                 =  MAKEFOURCC('Y', 'U', 'Y', '2'),
diff --git a/include/d3d9types.h b/include/d3d9types.h
index c986169..d1f58b9 100644
--- a/include/d3d9types.h
+++ b/include/d3d9types.h
@@ -797,7 +797,6 @@ typedef enum _D3DFORMAT {
     D3DFMT_X8L8V8U8             =  62,
     D3DFMT_Q8W8V8U8             =  63,
     D3DFMT_V16U16               =  64,
-    D3DFMT_W11V11U10            =  65,
     D3DFMT_A2W10V10U10          =  67,
 
     D3DFMT_UYVY                 =  MAKEFOURCC('U', 'Y', 'V', 'Y'),
@@ -807,7 +806,7 @@ typedef enum _D3DFORMAT {
     D3DFMT_DXT3                 =  MAKEFOURCC('D', 'X', 'T', '3'),
     D3DFMT_DXT4                 =  MAKEFOURCC('D', 'X', 'T', '4'),
     D3DFMT_DXT5                 =  MAKEFOURCC('D', 'X', 'T', '5'),
-    D3DFMT_MULTI2_ARGB          =  MAKEFOURCC('M', 'E', 'T', '1'),
+    D3DFMT_MULTI2_ARGB8         =  MAKEFOURCC('M', 'E', 'T', '1'),
     D3DFMT_G8R8_G8B8            =  MAKEFOURCC('G', 'R', 'G', 'B'),
     D3DFMT_R8G8_B8G8            =  MAKEFOURCC('R', 'G', 'B', 'G'),
 
@@ -826,7 +825,7 @@ typedef enum _D3DFORMAT {
     D3DFMT_INDEX16              = 101,
     D3DFMT_INDEX32              = 102,
     D3DFMT_Q16W16V16U16         = 110,
-    /* Flaoting point formats */
+    /* Floating point formats */
     D3DFMT_R16F                 = 111,
     D3DFMT_G16R16F              = 112,
     D3DFMT_A16B16G16R16F        = 113,
diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h
index a75c4d4..587b7cd 100644
--- a/include/wine/wined3d_types.h
+++ b/include/wine/wined3d_types.h
@@ -267,7 +267,7 @@ typedef enum _WINED3DFORMAT {
     WINED3DFMT_DXT3                 =  MAKEFOURCC('D', 'X', 'T', '3'),
     WINED3DFMT_DXT4                 =  MAKEFOURCC('D', 'X', 'T', '4'),
     WINED3DFMT_DXT5                 =  MAKEFOURCC('D', 'X', 'T', '5'),
-    WINED3DFMT_MULTI2_ARGB          =  MAKEFOURCC('M', 'E', 'T', '1'),
+    WINED3DFMT_MULTI2_ARGB8         =  MAKEFOURCC('M', 'E', 'T', '1'),
     WINED3DFMT_G8R8_G8B8            =  MAKEFOURCC('G', 'R', 'G', 'B'),
     WINED3DFMT_R8G8_B8G8            =  MAKEFOURCC('R', 'G', 'B', 'G'),
 
@@ -286,7 +286,7 @@ typedef enum _WINED3DFORMAT {
     WINED3DFMT_INDEX16              = 101,
     WINED3DFMT_INDEX32              = 102,
     WINED3DFMT_Q16W16V16U16         = 110,
-    /* Flaoting point formats */
+    /* Floating point formats */
     WINED3DFMT_R16F                 = 111,
     WINED3DFMT_G16R16F              = 112,
     WINED3DFMT_A16B16G16R16F        = 113,
-- 
1.4.4.3




More information about the wine-patches mailing list