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
0201ddf2
Commit
0201ddf2
authored
Sep 17, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Add a separate function for index buffer initialization.
parent
de9b4792
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
35 deletions
+50
-35
d3d8_private.h
dlls/d3d8/d3d8_private.h
+3
-5
device.c
dlls/d3d8/device.c
+21
-28
indexbuffer.c
dlls/d3d8/indexbuffer.c
+26
-2
No files found.
dlls/d3d8/d3d8_private.h
View file @
0201ddf2
...
...
@@ -346,11 +346,6 @@ struct IDirect3DVertexBuffer8Impl
/* --------------------- */
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern
const
IDirect3DIndexBuffer8Vtbl
Direct3DIndexBuffer8_Vtbl
DECLSPEC_HIDDEN
;
/*****************************************************************************
* IDirect3DIndexBuffer8 implementation structure
*/
struct
IDirect3DIndexBuffer8Impl
...
...
@@ -368,6 +363,9 @@ struct IDirect3DIndexBuffer8Impl
WINED3DFORMAT
format
;
};
HRESULT
indexbuffer_init
(
IDirect3DIndexBuffer8Impl
*
buffer
,
IDirect3DDevice8Impl
*
device
,
UINT
size
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
)
DECLSPEC_HIDDEN
;
/* --------------------- */
/* IDirect3DBaseTexture8 */
/* --------------------- */
...
...
dlls/d3d8/device.c
View file @
0201ddf2
...
...
@@ -787,42 +787,35 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexBuffer(LPDIRECT3DDEVICE8
return
hrc
;
}
static
HRESULT
WINAPI
IDirect3DDevice8Impl_CreateIndexBuffer
(
LPDIRECT3DDEVICE8
iface
,
UINT
Length
,
DWORD
Usage
,
D3DFORMAT
Format
,
D3DPOOL
Pool
,
IDirect3DIndexBuffer8
**
ppIndexBuffer
)
{
IDirect3DIndexBuffer8Impl
*
object
;
static
HRESULT
WINAPI
IDirect3DDevice8Impl_CreateIndexBuffer
(
IDirect3DDevice8
*
iface
,
UINT
size
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
,
IDirect3DIndexBuffer8
**
buffer
)
{
IDirect3DDevice8Impl
*
This
=
(
IDirect3DDevice8Impl
*
)
iface
;
HRESULT
hrc
=
D3D_OK
;
IDirect3DIndexBuffer8Impl
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, size %u, usage %#x, format %#x, pool %#x, buffer %p.
\n
"
,
iface
,
size
,
usage
,
format
,
pool
,
buffer
);
TRACE
(
"(%p) Relay
\n
"
,
This
);
/* Allocate the storage for the device */
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
NULL
==
object
)
{
FIXME
(
"Allocation of memory failed
\n
"
);
*
ppIndexBuffer
=
NULL
;
if
(
!
object
)
{
ERR
(
"Failed to allocate buffer memory.
\n
"
)
;
return
D3DERR_OUTOFVIDEOMEMORY
;
}
object
->
lpVtbl
=
&
Direct3DIndexBuffer8_Vtbl
;
object
->
ref
=
1
;
object
->
format
=
wined3dformat_from_d3dformat
(
Format
);
TRACE
(
"Calling wined3d create index buffer
\n
"
);
wined3d_mutex_lock
();
hrc
=
IWineD3DDevice_CreateIndexBuffer
(
This
->
WineD3DDevice
,
Length
,
Usage
&
WINED3DUSAGE_MASK
,
(
WINED3DPOOL
)
Pool
,
&
object
->
wineD3DIndexBuffer
,
(
IUnknown
*
)
object
);
wined3d_mutex_unlock
();
if
(
D3D_OK
!=
hrc
)
{
/* free up object */
FIXME
(
"(%p) call to IWineD3DDevice_CreateIndexBuffer failed
\n
"
,
This
);
hr
=
indexbuffer_init
(
object
,
This
,
size
,
usage
,
format
,
pool
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize index buffer, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
ppIndexBuffer
=
NULL
;
}
else
{
IUnknown_AddRef
(
iface
);
object
->
parentDevice
=
iface
;
*
ppIndexBuffer
=
(
LPDIRECT3DINDEXBUFFER8
)
object
;
return
hr
;
}
return
hrc
;
TRACE
(
"Created index buffer %p.
\n
"
,
object
);
*
buffer
=
(
IDirect3DIndexBuffer8
*
)
object
;
return
D3D_OK
;
}
static
HRESULT
IDirect3DDevice8Impl_CreateSurface
(
LPDIRECT3DDEVICE8
iface
,
UINT
Width
,
UINT
Height
,
...
...
dlls/d3d8/indexbuffer.c
View file @
0201ddf2
...
...
@@ -207,8 +207,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDesc(LPDIRECT3DINDEXBUFFER8 i
return
hr
;
}
const
IDirect3DIndexBuffer8Vtbl
Direct3DIndexBuffer8_Vtbl
=
static
const
IDirect3DIndexBuffer8Vtbl
Direct3DIndexBuffer8_Vtbl
=
{
/* IUnknown */
IDirect3DIndexBuffer8Impl_QueryInterface
,
...
...
@@ -228,3 +227,28 @@ const IDirect3DIndexBuffer8Vtbl Direct3DIndexBuffer8_Vtbl =
IDirect3DIndexBuffer8Impl_Unlock
,
IDirect3DIndexBuffer8Impl_GetDesc
};
HRESULT
indexbuffer_init
(
IDirect3DIndexBuffer8Impl
*
buffer
,
IDirect3DDevice8Impl
*
device
,
UINT
size
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
)
{
HRESULT
hr
;
buffer
->
lpVtbl
=
&
Direct3DIndexBuffer8_Vtbl
;
buffer
->
ref
=
1
;
buffer
->
format
=
wined3dformat_from_d3dformat
(
format
);
wined3d_mutex_lock
();
hr
=
IWineD3DDevice_CreateIndexBuffer
(
device
->
WineD3DDevice
,
size
,
usage
&
WINED3DUSAGE_MASK
,
(
WINED3DPOOL
)
pool
,
&
buffer
->
wineD3DIndexBuffer
,
(
IUnknown
*
)
buffer
);
wined3d_mutex_unlock
();
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d buffer, hr %#x.
\n
"
,
hr
);
return
hr
;
}
buffer
->
parentDevice
=
(
IDirect3DDevice8
*
)
device
;
IUnknown_AddRef
(
buffer
->
parentDevice
);
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