Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fffe37aa
Commit
fffe37aa
authored
Sep 15, 2010
by
Misha Koshelev
Committed by
Alexandre Julliard
Sep 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9_36: Implement D3DXGetDeclLength with tests.
parent
c6f876f4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
1 deletion
+69
-1
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+1
-1
mesh.c
dlls/d3dx9_36/mesh.c
+16
-0
mesh.c
dlls/d3dx9_36/tests/mesh.c
+51
-0
d3dx9mesh.h
include/d3dx9mesh.h
+1
-0
No files found.
dlls/d3dx9_36/d3dx9_36.spec
View file @
fffe37aa
...
...
@@ -147,7 +147,7 @@
@ stub D3DXGatherFragmentsFromResourceW
@ stub D3DXGenerateOutputDecl
@ stub D3DXGeneratePMesh
@ st
ub D3DXGetDeclLength
@ st
dcall D3DXGetDeclLength(ptr)
@ stdcall D3DXGetDeclVertexSize(ptr long)
@ stdcall D3DXGetDriverLevel(ptr)
@ stdcall D3DXGetFVFVertexSize(long)
...
...
dlls/d3dx9_36/mesh.c
View file @
fffe37aa
...
...
@@ -521,6 +521,22 @@ UINT WINAPI D3DXGetDeclVertexSize(const D3DVERTEXELEMENT9 *decl, DWORD stream_id
}
/*************************************************************************
* D3DXGetDeclLength
*/
UINT
WINAPI
D3DXGetDeclLength
(
const
D3DVERTEXELEMENT9
*
decl
)
{
const
D3DVERTEXELEMENT9
*
element
;
TRACE
(
"decl %p
\n
"
,
decl
);
/* null decl results in exception on Windows XP */
for
(
element
=
decl
;
element
->
Stream
!=
0xff
;
++
element
);
return
element
-
decl
;
}
/*************************************************************************
* D3DXIntersectTri
*/
BOOL
WINAPI
D3DXIntersectTri
(
CONST
D3DXVECTOR3
*
p0
,
CONST
D3DXVECTOR3
*
p1
,
CONST
D3DXVECTOR3
*
p2
,
CONST
D3DXVECTOR3
*
praypos
,
CONST
D3DXVECTOR3
*
praydir
,
FLOAT
*
pu
,
FLOAT
*
pv
,
FLOAT
*
pdist
)
...
...
dlls/d3dx9_36/tests/mesh.c
View file @
fffe37aa
...
...
@@ -1407,6 +1407,56 @@ static void D3DXCreateSphereTest(void)
DestroyWindow
(
wnd
);
}
static
void
test_get_decl_length
(
void
)
{
static
const
D3DVERTEXELEMENT9
declaration1
[]
=
{
{
0
,
0
,
D3DDECLTYPE_FLOAT1
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
1
,
0
,
D3DDECLTYPE_FLOAT2
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
2
,
0
,
D3DDECLTYPE_FLOAT3
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
3
,
0
,
D3DDECLTYPE_FLOAT4
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
4
,
0
,
D3DDECLTYPE_D3DCOLOR
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
5
,
0
,
D3DDECLTYPE_UBYTE4
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
6
,
0
,
D3DDECLTYPE_SHORT2
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
7
,
0
,
D3DDECLTYPE_SHORT4
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
8
,
0
,
D3DDECLTYPE_UBYTE4N
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
9
,
0
,
D3DDECLTYPE_SHORT2N
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
10
,
0
,
D3DDECLTYPE_SHORT4N
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
11
,
0
,
D3DDECLTYPE_UDEC3
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
12
,
0
,
D3DDECLTYPE_DEC3N
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
13
,
0
,
D3DDECLTYPE_FLOAT16_2
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
14
,
0
,
D3DDECLTYPE_FLOAT16_4
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
D3DDECL_END
(),
};
static
const
D3DVERTEXELEMENT9
declaration2
[]
=
{
{
0
,
8
,
D3DDECLTYPE_FLOAT1
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
1
,
8
,
D3DDECLTYPE_FLOAT2
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
2
,
8
,
D3DDECLTYPE_FLOAT3
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
3
,
8
,
D3DDECLTYPE_FLOAT4
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
4
,
8
,
D3DDECLTYPE_D3DCOLOR
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
5
,
8
,
D3DDECLTYPE_UBYTE4
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
6
,
8
,
D3DDECLTYPE_SHORT2
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
7
,
8
,
D3DDECLTYPE_SHORT4
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
0
,
8
,
D3DDECLTYPE_UBYTE4N
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
1
,
8
,
D3DDECLTYPE_SHORT2N
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
2
,
8
,
D3DDECLTYPE_SHORT4N
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
3
,
8
,
D3DDECLTYPE_UDEC3
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
4
,
8
,
D3DDECLTYPE_DEC3N
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
5
,
8
,
D3DDECLTYPE_FLOAT16_2
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
6
,
8
,
D3DDECLTYPE_FLOAT16_4
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
{
7
,
8
,
D3DDECLTYPE_FLOAT1
,
D3DDECLMETHOD_DEFAULT
,
D3DDECLUSAGE_POSITION
,
0
},
D3DDECL_END
(),
};
UINT
size
;
size
=
D3DXGetDeclLength
(
declaration1
);
ok
(
size
==
15
,
"Got size %u, expected 15.
\n
"
,
size
);
size
=
D3DXGetDeclLength
(
declaration2
);
ok
(
size
==
16
,
"Got size %u, expected 16.
\n
"
,
size
);
}
static
void
test_get_decl_vertex_size
(
void
)
{
static
const
D3DVERTEXELEMENT9
declaration1
[]
=
...
...
@@ -1488,6 +1538,7 @@ START_TEST(mesh)
D3DXIntersectTriTest
();
D3DXCreateMeshTest
();
D3DXCreateSphereTest
();
test_get_decl_length
();
test_get_decl_vertex_size
();
test_fvf_decl_conversion
();
}
include/d3dx9mesh.h
View file @
fffe37aa
...
...
@@ -152,6 +152,7 @@ extern "C" {
HRESULT
WINAPI
D3DXCreateMesh
(
DWORD
,
DWORD
,
DWORD
,
CONST
D3DVERTEXELEMENT9
*
,
LPDIRECT3DDEVICE9
,
LPD3DXMESH
*
);
HRESULT
WINAPI
D3DXCreateBuffer
(
DWORD
,
LPD3DXBUFFER
*
);
UINT
WINAPI
D3DXGetDeclLength
(
const
D3DVERTEXELEMENT9
*
decl
);
UINT
WINAPI
D3DXGetDeclVertexSize
(
const
D3DVERTEXELEMENT9
*
decl
,
DWORD
stream_idx
);
UINT
WINAPI
D3DXGetFVFVertexSize
(
DWORD
);
BOOL
WINAPI
D3DXBoxBoundProbe
(
CONST
D3DXVECTOR3
*
,
CONST
D3DXVECTOR3
*
,
CONST
D3DXVECTOR3
*
,
CONST
D3DXVECTOR3
*
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment