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
c8f4ca31
Commit
c8f4ca31
authored
Sep 06, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Just return the buffer from wined3d_device_get_index_buffer().
parent
a3e28f6c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
30 deletions
+12
-30
device.c
dlls/d3d8/device.c
+3
-8
device.c
dlls/d3d9/device.c
+4
-9
device.c
dlls/wined3d/device.c
+3
-10
wined3d.spec
dlls/wined3d/wined3d.spec
+1
-1
wined3d.h
include/wine/wined3d.h
+1
-2
No files found.
dlls/d3d8/device.c
View file @
c8f4ca31
...
...
@@ -2367,9 +2367,8 @@ static HRESULT WINAPI d3d8_device_GetIndices(IDirect3DDevice8 *iface,
IDirect3DIndexBuffer8
**
buffer
,
UINT
*
base_vertex_index
)
{
struct
d3d8_device
*
device
=
impl_from_IDirect3DDevice8
(
iface
);
struct
wined3d_buffer
*
wined3d_buffer
=
NULL
;
struct
wined3d_buffer
*
wined3d_buffer
;
struct
d3d8_indexbuffer
*
buffer_impl
;
HRESULT
hr
;
TRACE
(
"iface %p, buffer %p, base_vertex_index %p.
\n
"
,
iface
,
buffer
,
base_vertex_index
);
...
...
@@ -2379,23 +2378,19 @@ static HRESULT WINAPI d3d8_device_GetIndices(IDirect3DDevice8 *iface,
/* The case from UINT to INT is safe because d3d8 will never set negative values */
wined3d_mutex_lock
();
*
base_vertex_index
=
wined3d_device_get_base_vertex_index
(
device
->
wined3d_device
);
hr
=
wined3d_device_get_index_buffer
(
device
->
wined3d_device
,
&
wined3d_buffer
);
if
(
SUCCEEDED
(
hr
)
&&
wined3d_buffer
)
if
((
wined3d_buffer
=
wined3d_device_get_index_buffer
(
device
->
wined3d_device
)))
{
buffer_impl
=
wined3d_buffer_get_parent
(
wined3d_buffer
);
*
buffer
=
&
buffer_impl
->
IDirect3DIndexBuffer8_iface
;
IDirect3DIndexBuffer8_AddRef
(
*
buffer
);
wined3d_buffer_decref
(
wined3d_buffer
);
}
else
{
if
(
FAILED
(
hr
))
ERR
(
"Failed to get wined3d index buffer, hr %#x.
\n
"
,
hr
);
*
buffer
=
NULL
;
}
wined3d_mutex_unlock
();
return
hr
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
d3d8_device_CreatePixelShader
(
IDirect3DDevice8
*
iface
,
...
...
dlls/d3d9/device.c
View file @
c8f4ca31
...
...
@@ -2539,9 +2539,8 @@ static HRESULT WINAPI d3d9_device_SetIndices(IDirect3DDevice9Ex *iface, IDirect3
static
HRESULT
WINAPI
d3d9_device_GetIndices
(
IDirect3DDevice9Ex
*
iface
,
IDirect3DIndexBuffer9
**
buffer
)
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
struct
wined3d_buffer
*
retIndexData
=
NULL
;
struct
wined3d_buffer
*
wined3d_buffer
;
struct
d3d9_indexbuffer
*
buffer_impl
;
HRESULT
hr
;
TRACE
(
"iface %p, buffer %p.
\n
"
,
iface
,
buffer
);
...
...
@@ -2549,23 +2548,19 @@ static HRESULT WINAPI d3d9_device_GetIndices(IDirect3DDevice9Ex *iface, IDirect3
return
D3DERR_INVALIDCALL
;
wined3d_mutex_lock
();
hr
=
wined3d_device_get_index_buffer
(
device
->
wined3d_device
,
&
retIndexData
);
if
(
SUCCEEDED
(
hr
)
&&
retIndexData
)
if
((
wined3d_buffer
=
wined3d_device_get_index_buffer
(
device
->
wined3d_device
)))
{
buffer_impl
=
wined3d_buffer_get_parent
(
retIndexData
);
buffer_impl
=
wined3d_buffer_get_parent
(
wined3d_buffer
);
*
buffer
=
&
buffer_impl
->
IDirect3DIndexBuffer9_iface
;
IDirect3DIndexBuffer9_AddRef
(
*
buffer
);
wined3d_buffer_decref
(
retIndexData
);
}
else
{
if
(
FAILED
(
hr
))
FIXME
(
"Call to GetIndices failed
\n
"
);
*
buffer
=
NULL
;
}
wined3d_mutex_unlock
();
return
hr
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
d3d9_device_CreatePixelShader
(
IDirect3DDevice9Ex
*
iface
,
...
...
dlls/wined3d/device.c
View file @
c8f4ca31
...
...
@@ -2256,18 +2256,11 @@ void CDECL wined3d_device_set_index_buffer(struct wined3d_device *device,
}
}
HRESULT
CDECL
wined3d_device_get_index_buffer
(
const
struct
wined3d_device
*
device
,
struct
wined3d_buffer
**
buffer
)
struct
wined3d_buffer
*
CDECL
wined3d_device_get_index_buffer
(
const
struct
wined3d_device
*
device
)
{
TRACE
(
"device %p, buffer %p.
\n
"
,
device
,
buffer
);
*
buffer
=
device
->
stateBlock
->
state
.
index_buffer
;
if
(
*
buffer
)
wined3d_buffer_incref
(
*
buffer
);
TRACE
(
"Returning %p.
\n
"
,
*
buffer
);
TRACE
(
"device %p.
\n
"
,
device
);
return
WINED3D_OK
;
return
device
->
stateBlock
->
state
.
index_buffer
;
}
/* Method to offer d3d9 a simple way to set the base vertex index without messing with the index buffer */
...
...
dlls/wined3d/wined3d.spec
View file @
c8f4ca31
...
...
@@ -64,7 +64,7 @@
@ cdecl wined3d_device_get_display_mode(ptr long ptr ptr)
@ cdecl wined3d_device_get_front_buffer_data(ptr long ptr)
@ cdecl wined3d_device_get_gamma_ramp(ptr long ptr)
@ cdecl wined3d_device_get_index_buffer(ptr
ptr
)
@ cdecl wined3d_device_get_index_buffer(ptr)
@ cdecl wined3d_device_get_light(ptr long ptr)
@ cdecl wined3d_device_get_light_enable(ptr long ptr)
@ cdecl wined3d_device_get_material(ptr ptr)
...
...
include/wine/wined3d.h
View file @
c8f4ca31
...
...
@@ -2125,8 +2125,7 @@ HRESULT __cdecl wined3d_device_get_front_buffer_data(const struct wined3d_device
UINT
swapchain_idx
,
struct
wined3d_surface
*
dst_surface
);
void
__cdecl
wined3d_device_get_gamma_ramp
(
const
struct
wined3d_device
*
device
,
UINT
swapchain_idx
,
struct
wined3d_gamma_ramp
*
ramp
);
HRESULT
__cdecl
wined3d_device_get_index_buffer
(
const
struct
wined3d_device
*
device
,
struct
wined3d_buffer
**
index_buffer
);
struct
wined3d_buffer
*
__cdecl
wined3d_device_get_index_buffer
(
const
struct
wined3d_device
*
device
);
HRESULT
__cdecl
wined3d_device_get_light
(
const
struct
wined3d_device
*
device
,
UINT
light_idx
,
struct
wined3d_light
*
light
);
HRESULT
__cdecl
wined3d_device_get_light_enable
(
const
struct
wined3d_device
*
device
,
UINT
light_idx
,
BOOL
*
enable
);
...
...
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