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
31e8a20d
Commit
31e8a20d
authored
Aug 24, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9_36: Use a lookup table in D3DXGetDeclVertexSize().
parent
e237369b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
22 deletions
+25
-22
mesh.c
dlls/d3dx9_36/mesh.c
+25
-22
No files found.
dlls/d3dx9_36/mesh.c
View file @
31e8a20d
...
@@ -169,6 +169,27 @@ HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWOR
...
@@ -169,6 +169,27 @@ HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWOR
return
D3D_OK
;
return
D3D_OK
;
}
}
static
const
UINT
d3dx_decltype_size
[
D3DDECLTYPE_UNUSED
]
=
{
/* D3DDECLTYPE_FLOAT1 */
1
*
4
,
/* D3DDECLTYPE_FLOAT2 */
2
*
4
,
/* D3DDECLTYPE_FLOAT3 */
3
*
4
,
/* D3DDECLTYPE_FLOAT4 */
4
*
4
,
/* D3DDECLTYPE_D3DCOLOR */
4
*
1
,
/* D3DDECLTYPE_UBYTE4 */
4
*
1
,
/* D3DDECLTYPE_SHORT2 */
2
*
2
,
/* D3DDECLTYPE_SHORT4 */
4
*
2
,
/* D3DDECLTYPE_UBYTE4N */
4
*
1
,
/* D3DDECLTYPE_SHORT2N */
2
*
2
,
/* D3DDECLTYPE_SHORT4N */
4
*
2
,
/* D3DDECLTYPE_USHORT2N */
2
*
2
,
/* D3DDECLTYPE_USHORT4N */
4
*
2
,
/* D3DDECLTYPE_UDEC3 */
4
,
/* 3 * 10 bits + 2 padding */
/* D3DDECLTYPE_DEC3N */
4
,
/* D3DDECLTYPE_FLOAT16_2 */
2
*
2
,
/* D3DDECLTYPE_FLOAT16_4 */
4
*
2
,
};
/*************************************************************************
/*************************************************************************
* D3DXDeclaratorFromFVF
* D3DXDeclaratorFromFVF
*/
*/
...
@@ -246,31 +267,13 @@ UINT WINAPI D3DXGetDeclVertexSize(const D3DVERTEXELEMENT9 *decl, DWORD stream_id
...
@@ -246,31 +267,13 @@ UINT WINAPI D3DXGetDeclVertexSize(const D3DVERTEXELEMENT9 *decl, DWORD stream_id
if
(
element
->
Stream
!=
stream_idx
)
continue
;
if
(
element
->
Stream
!=
stream_idx
)
continue
;
switch
(
element
->
Type
)
if
(
element
->
Type
>=
sizeof
(
d3dx_decltype_size
)
/
sizeof
(
*
d3dx_decltype_size
)
)
{
{
case
D3DDECLTYPE_FLOAT1
:
type_size
=
1
*
4
;
break
;
FIXME
(
"Unhandled element type %#x, size will be incorrect.
\n
"
,
element
->
Type
);
case
D3DDECLTYPE_FLOAT2
:
type_size
=
2
*
4
;
break
;
continue
;
case
D3DDECLTYPE_FLOAT3
:
type_size
=
3
*
4
;
break
;
case
D3DDECLTYPE_FLOAT4
:
type_size
=
4
*
4
;
break
;
case
D3DDECLTYPE_D3DCOLOR
:
type_size
=
4
*
1
;
break
;
case
D3DDECLTYPE_UBYTE4
:
type_size
=
4
*
1
;
break
;
case
D3DDECLTYPE_SHORT2
:
type_size
=
2
*
2
;
break
;
case
D3DDECLTYPE_SHORT4
:
type_size
=
4
*
2
;
break
;
case
D3DDECLTYPE_UBYTE4N
:
type_size
=
4
*
1
;
break
;
case
D3DDECLTYPE_SHORT2N
:
type_size
=
2
*
2
;
break
;
case
D3DDECLTYPE_SHORT4N
:
type_size
=
4
*
2
;
break
;
case
D3DDECLTYPE_USHORT2N
:
type_size
=
2
*
2
;
break
;
case
D3DDECLTYPE_USHORT4N
:
type_size
=
4
*
2
;
break
;
case
D3DDECLTYPE_UDEC3
:
type_size
=
4
;
break
;
/* 3 * 10 bits + 2 padding */
case
D3DDECLTYPE_DEC3N
:
type_size
=
4
;
break
;
case
D3DDECLTYPE_FLOAT16_2
:
type_size
=
2
*
2
;
break
;
case
D3DDECLTYPE_FLOAT16_4
:
type_size
=
4
*
2
;
break
;
default
:
FIXME
(
"Unhandled element type %#x, size will be incorrect.
\n
"
,
element
->
Type
);
type_size
=
0
;
break
;
}
}
type_size
=
d3dx_decltype_size
[
element
->
Type
];
if
(
element
->
Offset
+
type_size
>
size
)
size
=
element
->
Offset
+
type_size
;
if
(
element
->
Offset
+
type_size
>
size
)
size
=
element
->
Offset
+
type_size
;
}
}
...
...
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