Dylan Smith : d3dx9/tests: Add texture coordinates and vertex colors in X file.

Alexandre Julliard julliard at winehq.org
Tue Jun 7 12:02:38 CDT 2011


Module: wine
Branch: master
Commit: bbc009f452ad049d03e989f39ceceea0da77343f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bbc009f452ad049d03e989f39ceceea0da77343f

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Mon Jun  6 12:54:45 2011 -0400

d3dx9/tests: Add texture coordinates and vertex colors in X file.

---

 dlls/d3dx9_36/tests/mesh.c |   76 +++++++++++++++++++++++++++++--------------
 1 files changed, 51 insertions(+), 25 deletions(-)

diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
index d404073..ee15fdb 100644
--- a/dlls/d3dx9_36/tests/mesh.c
+++ b/dlls/d3dx9_36/tests/mesh.c
@@ -1994,6 +1994,30 @@ static void D3DXLoadMeshTest(void)
                 "TextureFilename { \"texture.jpg\"; }"
               "}"
             "}"
+            "MeshVertexColors {"
+              "8;" /* DWORD nVertexColors; */
+              /* array IndexedColor vertexColors[nVertexColors]; */
+              "0; 0.0; 0.0; 0.0; 0.0;;"
+              "1; 0.0; 0.0; 1.0; 0.1;;"
+              "2; 0.0; 1.0; 0.0; 0.2;;"
+              "3; 0.0; 1.0; 1.0; 0.3;;"
+              "4; 1.0; 0.0; 0.0; 0.4;;"
+              "5; 1.0; 0.0; 1.0; 0.5;;"
+              "6; 1.0; 1.0; 0.0; 0.6;;"
+              "7; 1.0; 1.0; 1.0; 0.7;;"
+            "}"
+            "MeshTextureCoords {"
+              "8;" /* DWORD nTextureCoords; */
+              /* array Coords2d textureCoords[nTextureCoords]; */
+              "0.0; 1.0;,"
+              "1.0; 1.0;,"
+              "0.0; 0.0;,"
+              "1.0; 0.0;,"
+              "1.0; 1.0;,"
+              "0.0; 1.0;,"
+              "1.0; 0.0;,"
+              "0.0; 0.0;;"
+            "}"
           "}";
     static const WORD box_index_buffer[] = {
         0, 1, 3,
@@ -2012,31 +2036,33 @@ static void D3DXLoadMeshTest(void)
     static const struct {
         D3DXVECTOR3 position;
         D3DXVECTOR3 normal;
+        D3DCOLOR diffuse;
+        D3DXVECTOR2 tex_coords;
     } box_vertex_buffer[] = {
-        {{0.0, 0.0, 0.0}, {-1.0, 0.0, 0.0}},
-        {{0.0, 0.0, 1.0}, {-1.0, 0.0, 0.0}},
-        {{0.0, 1.0, 0.0}, {-1.0, 0.0, 0.0}},
-        {{0.0, 1.0, 1.0}, {-1.0, 0.0, 0.0}},
-        {{1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}},
-        {{1.0, 0.0, 1.0}, {1.0, 0.0, 0.0}},
-        {{1.0, 1.0, 0.0}, {0.0, 1.0, 0.0}},
-        {{1.0, 1.0, 1.0}, {0.0, 1.0, 0.0}},
-        {{0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}},
-        {{0.0, 1.0, 1.0}, {0.0, 1.0, 0.0}},
-        {{1.0, 1.0, 0.0}, {1.0, 0.0, 0.0}},
-        {{1.0, 1.0, 1.0}, {1.0, 0.0, 0.0}},
-        {{0.0, 0.0, 1.0}, {0.0, -1.0, 0.0}},
-        {{0.0, 0.0, 0.0}, {0.0, -1.0, 0.0}},
-        {{1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}},
-        {{1.0, 0.0, 1.0}, {0.0, -1.0, 0.0}},
-        {{0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}},
-        {{1.0, 0.0, 1.0}, {0.0, 0.0, 1.0}},
-        {{1.0, 1.0, 1.0}, {0.0, 0.0, 1.0}},
-        {{0.0, 1.0, 1.0}, {0.0, 0.0, 1.0}},
-        {{0.0, 0.0, 0.0}, {0.0, 0.0, -1.0}},
-        {{0.0, 1.0, 0.0}, {0.0, 0.0, -1.0}},
-        {{1.0, 1.0, 0.0}, {0.0, 0.0, -1.0}},
-        {{1.0, 0.0, 0.0}, {0.0, 0.0, -1.0}},
+        {{0.0, 0.0, 0.0}, {-1.0, 0.0, 0.0}, 0x00000000, {0.0, 1.0}},
+        {{0.0, 0.0, 1.0}, {-1.0, 0.0, 0.0}, 0x1a0000ff, {1.0, 1.0}},
+        {{0.0, 1.0, 0.0}, {-1.0, 0.0, 0.0}, 0x3300ff00, {0.0, 0.0}},
+        {{0.0, 1.0, 1.0}, {-1.0, 0.0, 0.0}, 0x4d00ffff, {1.0, 0.0}},
+        {{1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, 0x66ff0000, {1.0, 1.0}},
+        {{1.0, 0.0, 1.0}, {1.0, 0.0, 0.0}, 0x80ff00ff, {0.0, 1.0}},
+        {{1.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, 0x99ffff00, {1.0, 0.0}},
+        {{1.0, 1.0, 1.0}, {0.0, 1.0, 0.0}, 0xb3ffffff, {0.0, 0.0}},
+        {{0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, 0x3300ff00, {0.0, 0.0}},
+        {{0.0, 1.0, 1.0}, {0.0, 1.0, 0.0}, 0x4d00ffff, {1.0, 0.0}},
+        {{1.0, 1.0, 0.0}, {1.0, 0.0, 0.0}, 0x99ffff00, {1.0, 0.0}},
+        {{1.0, 1.0, 1.0}, {1.0, 0.0, 0.0}, 0xb3ffffff, {0.0, 0.0}},
+        {{0.0, 0.0, 1.0}, {0.0, -1.0, 0.0}, 0x1a0000ff, {1.0, 1.0}},
+        {{0.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, 0x00000000, {0.0, 1.0}},
+        {{1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, 0x66ff0000, {1.0, 1.0}},
+        {{1.0, 0.0, 1.0}, {0.0, -1.0, 0.0}, 0x80ff00ff, {0.0, 1.0}},
+        {{0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, 0x1a0000ff, {1.0, 1.0}},
+        {{1.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, 0x80ff00ff, {0.0, 1.0}},
+        {{1.0, 1.0, 1.0}, {0.0, 0.0, 1.0}, 0xb3ffffff, {0.0, 0.0}},
+        {{0.0, 1.0, 1.0}, {0.0, 0.0, 1.0}, 0x4d00ffff, {1.0, 0.0}},
+        {{0.0, 0.0, 0.0}, {0.0, 0.0, -1.0}, 0x00000000, {0.0, 1.0}},
+        {{0.0, 1.0, 0.0}, {0.0, 0.0, -1.0}, 0x3300ff00, {0.0, 0.0}},
+        {{1.0, 1.0, 0.0}, {0.0, 0.0, -1.0}, 0x99ffff00, {1.0, 0.0}},
+        {{1.0, 0.0, 0.0}, {0.0, 0.0, -1.0}, 0x66ff0000, {1.0, 1.0}},
     };
     static const D3DXMATERIAL box_materials[] = {
         {
@@ -2060,7 +2086,7 @@ static void D3DXLoadMeshTest(void)
             (char *)"texture.jpg", /* pTextureFilename */
         },
     };
-    const DWORD box_fvf = D3DFVF_XYZ | D3DFVF_NORMAL;
+    const DWORD box_fvf = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX1;
     /*________________________*/
     HRESULT hr;
     HWND wnd = NULL;




More information about the wine-cvs mailing list