Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c622cd7c
Commit
c622cd7c
authored
Nov 28, 2005
by
Oliver Stieber
Committed by
Alexandre Julliard
Nov 28, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct some errors in the way vertex declarations for directx 8 are
parsed and add offset support.
parent
0991687d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
vertexdeclaration.c
dlls/wined3d/vertexdeclaration.c
+19
-14
No files found.
dlls/wined3d/vertexdeclaration.c
View file @
c622cd7c
...
...
@@ -270,25 +270,26 @@ IWineD3DVertexDeclarationImpl *This = (IWineD3DVertexDeclarationImpl *)iface;
DWORD
tokenlen
;
DWORD
tokentype
;
DWORD
nTokens
=
0
;
DWORD
offset
=
0
;
D3DVERTEXELEMENT9
convTo9
[
128
];
/* TODO: find out where rhw (or positionT) is for declaration8 */
Decl8to9Lookup
decl8to9Lookup
[
MAX_D3DVSDE
];
MAKE_LOOKUP
(
D3DVSDE_POSITION
,
D3DDECLUSAGE_POSITION
,
0
);
MAKE_LOOKUP
(
D3DVSDE_POSITION2
,
D3DDECLUSAGE_POSITION
,
1
);
MAKE_LOOKUP
(
D3DVSDE_BLENDWEIGHT
,
D3DDECLUSAGE_BLENDWEIGHT
,
0
);
MAKE_LOOKUP
(
D3DVSDE_BLENDINDICES
,
D3DDECLUSAGE_BLEND
WEIGHT
,
0
);
MAKE_LOOKUP
(
D3DVSDE_B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XCOORD4
,
D3DDECLUSAGE_
TEXCOORD
,
4
);
MAKE_LOOKUP
(
D3DVSDE_TEXCOORD5
,
D3DDECLUSAGE_
TEXCOORD
,
5
);
MAKE_LOOKUP
(
D3DVSDE_TEXCOORD6
,
D3DDECLUSAGE_
TEXCOORD
,
6
);
MAKE_LOOKUP
(
D3DVSDE_TEXCOORD7
,
D3DDECLUSAGE_
TEXCOORD
,
7
);
#undef MAKE_LOOKUP
TRACE
(
"(%p) : pDecl(%p)
\n
"
,
This
,
pDecl
);
...
...
@@ -299,11 +300,12 @@ IWineD3DVertexDeclarationImpl *This = (IWineD3DVertexDeclarationImpl *)iface;
tokentype
=
((
token
&
D3DVSD_TOKENTYPEMASK
)
>>
D3DVSD_TOKENTYPESHIFT
);
if
(
D3DVSD_TOKEN_STREAM
==
tokentype
&&
0
==
(
D3DVSD_STREAMTESSMASK
&
token
))
{
/**
* how really works streams,
* in DolphinVS dx8 dsk sample they seems to decal reg numbers !!!
*/
stream
=
((
token
&
D3DVSD_STREAMNUMBERMASK
)
>>
D3DVSD_STREAMNUMBERSHIFT
);
/**
* how really works streams,
* in DolphinVS dx8 dsk sample they seems to decal reg numbers !!!
*/
stream
=
((
token
&
D3DVSD_STREAMNUMBERMASK
)
>>
D3DVSD_STREAMNUMBERSHIFT
);
offset
=
0
;
}
else
if
(
D3DVSD_TOKEN_STREAMDATA
==
tokentype
&&
0
==
(
0x10000000
&
tokentype
))
{
DWORD
type
=
((
token
&
D3DVSD_DATATYPEMASK
)
>>
D3DVSD_DATATYPESHIFT
);
...
...
@@ -314,6 +316,8 @@ IWineD3DVertexDeclarationImpl *This = (IWineD3DVertexDeclarationImpl *)iface;
convTo9
[
nTokens
].
Usage
=
decl8to9Lookup
[
reg
].
usage
;
convTo9
[
nTokens
].
UsageIndex
=
decl8to9Lookup
[
reg
].
usageIndex
;
convTo9
[
nTokens
].
Type
=
type
;
convTo9
[
nTokens
].
Offset
=
offset
;
offset
+=
glTypeLookup
[
type
][
1
]
*
glTypeLookup
[
type
][
4
];
++
nTokens
;
}
/* TODO: Constants. */
len
+=
tokenlen
;
...
...
@@ -325,6 +329,7 @@ IWineD3DVertexDeclarationImpl *This = (IWineD3DVertexDeclarationImpl *)iface;
convTo9
[
nTokens
].
Stream
=
0xFF
;
convTo9
[
nTokens
].
Type
=
D3DDECLTYPE_UNUSED
;
++
nTokens
;
/* compute size */
This
->
declaration8Length
=
len
*
sizeof
(
DWORD
);
...
...
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