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
ba67df7a
Commit
ba67df7a
authored
Apr 11, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Introduce a separate function for vertex declaration creation.
parent
0fccc41c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
22 deletions
+34
-22
d3d9_private.h
dlls/d3d9/d3d9_private.h
+2
-2
device.c
dlls/d3d9/device.c
+4
-19
vertexdeclaration.c
dlls/d3d9/vertexdeclaration.c
+28
-1
No files found.
dlls/d3d9/d3d9_private.h
View file @
ba67df7a
...
...
@@ -395,8 +395,8 @@ typedef struct IDirect3DVertexDeclaration9Impl {
}
IDirect3DVertexDeclaration9Impl
;
void
IDirect3DVertexDeclaration9Impl_Destroy
(
LPDIRECT3DVERTEXDECLARATION9
iface
)
DECLSPEC_HIDDEN
;
HRESULT
vertexdeclaration_init
(
IDirect3DVertexDeclaration9Impl
*
declaration
,
IDirect3DDevice9Impl
*
device
,
const
D3DVERTEXELEMENT9
*
elements
)
DECLSPEC_HIDDEN
;
HRESULT
d3d9_vertex_declaration_create
(
IDirect3DDevice9Impl
*
device
,
const
D3DVERTEXELEMENT9
*
elements
,
IDirect3DVertexDeclaration9Impl
**
declaration
)
DECLSPEC_HIDDEN
;
/* ---------------------- */
/* IDirect3DVertexShader9 */
...
...
dlls/d3d9/device.c
View file @
ba67df7a
...
...
@@ -2073,7 +2073,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_ProcessVertices(IDirect3DDevice9Ex *i
static
HRESULT
WINAPI
IDirect3DDevice9Impl_CreateVertexDeclaration
(
IDirect3DDevice9Ex
*
iface
,
const
D3DVERTEXELEMENT9
*
elements
,
IDirect3DVertexDeclaration9
**
declaration
)
{
IDirect3DDevice9Impl
*
This
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DDevice9Impl
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DVertexDeclaration9Impl
*
object
;
HRESULT
hr
;
...
...
@@ -2085,25 +2085,10 @@ static HRESULT WINAPI IDirect3DDevice9Impl_CreateVertexDeclaration(IDirect3DDevi
return
D3DERR_INVALIDCALL
;
}
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
ERR
(
"Failed to allocate vertex declaration memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
hr
=
vertexdeclaration_init
(
object
,
This
,
elements
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize vertex declaration, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created vertex declaration %p.
\n
"
,
object
);
*
declaration
=
(
IDirect3DVertexDeclaration9
*
)
object
;
if
(
SUCCEEDED
(
hr
=
d3d9_vertex_declaration_create
(
device
,
elements
,
&
object
)))
*
declaration
=
(
IDirect3DVertexDeclaration9
*
)
object
;
return
D3D_OK
;
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DDevice9Impl_SetVertexDeclaration
(
IDirect3DDevice9Ex
*
iface
,
...
...
dlls/d3d9/vertexdeclaration.c
View file @
ba67df7a
...
...
@@ -367,7 +367,7 @@ static HRESULT convert_to_wined3d_declaration(const D3DVERTEXELEMENT9 *d3d9_elem
return
D3D_OK
;
}
HRESULT
vertexdeclaration_init
(
IDirect3DVertexDeclaration9Impl
*
declaration
,
static
HRESULT
vertexdeclaration_init
(
IDirect3DVertexDeclaration9Impl
*
declaration
,
IDirect3DDevice9Impl
*
device
,
const
D3DVERTEXELEMENT9
*
elements
)
{
struct
wined3d_vertex_element
*
wined3d_elements
;
...
...
@@ -413,3 +413,30 @@ HRESULT vertexdeclaration_init(IDirect3DVertexDeclaration9Impl *declaration,
return
D3D_OK
;
}
HRESULT
d3d9_vertex_declaration_create
(
IDirect3DDevice9Impl
*
device
,
const
D3DVERTEXELEMENT9
*
elements
,
IDirect3DVertexDeclaration9Impl
**
declaration
)
{
IDirect3DVertexDeclaration9Impl
*
object
;
HRESULT
hr
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
ERR
(
"Failed to allocate vertex declaration memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
hr
=
vertexdeclaration_init
(
object
,
device
,
elements
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize vertex declaration, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created vertex declaration %p.
\n
"
,
object
);
*
declaration
=
object
;
return
D3D_OK
;
}
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