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
513a493f
Commit
513a493f
authored
Apr 06, 2009
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 08, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Merge IWineD3DIndexBuffer and IWineD3DBuffer.
parent
2a7a2371
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
70 additions
and
90 deletions
+70
-90
d3d8_private.h
dlls/d3d8/d3d8_private.h
+1
-1
device.c
dlls/d3d8/device.c
+3
-3
indexbuffer.c
dlls/d3d8/indexbuffer.c
+11
-11
d3d9_private.h
dlls/d3d9/d3d9_private.h
+1
-1
device.c
dlls/d3d9/device.c
+3
-3
indexbuffer.c
dlls/d3d9/indexbuffer.c
+11
-11
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-1
device.c
dlls/ddraw/device.c
+10
-10
direct3d.c
dlls/ddraw/direct3d.c
+1
-1
vertexbuffer.c
dlls/ddraw/vertexbuffer.c
+2
-2
device.c
dlls/wined3d/device.c
+17
-17
stateblock.c
dlls/wined3d/stateblock.c
+5
-5
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
wined3d.idl
include/wine/wined3d.idl
+3
-23
No files found.
dlls/d3d8/d3d8_private.h
View file @
513a493f
...
...
@@ -347,7 +347,7 @@ struct IDirect3DIndexBuffer8Impl
LONG
ref
;
/* IDirect3DResource8 fields */
IWineD3D
IndexBuffer
*
wineD3DIndexBuffer
;
IWineD3D
Buffer
*
wineD3DIndexBuffer
;
/* Parent reference */
LPDIRECT3DDEVICE8
parentDevice
;
...
...
dlls/d3d8/device.c
View file @
513a493f
...
...
@@ -2099,7 +2099,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetIndices(LPDIRECT3DDEVICE8 iface, I
static
HRESULT
WINAPI
IDirect3DDevice8Impl_GetIndices
(
LPDIRECT3DDEVICE8
iface
,
IDirect3DIndexBuffer8
**
ppIndexData
,
UINT
*
pBaseVertexIndex
)
{
IDirect3DDevice8Impl
*
This
=
(
IDirect3DDevice8Impl
*
)
iface
;
IWineD3D
Index
Buffer
*
retIndexData
=
NULL
;
IWineD3DBuffer
*
retIndexData
=
NULL
;
HRESULT
rc
=
D3D_OK
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
...
...
@@ -2113,8 +2113,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface, I
IWineD3DDevice_GetBaseVertexIndex
(
This
->
WineD3DDevice
,
(
INT
*
)
pBaseVertexIndex
);
rc
=
IWineD3DDevice_GetIndices
(
This
->
WineD3DDevice
,
&
retIndexData
);
if
(
SUCCEEDED
(
rc
)
&&
retIndexData
)
{
IWineD3D
Index
Buffer_GetParent
(
retIndexData
,
(
IUnknown
**
)
ppIndexData
);
IWineD3D
Index
Buffer_Release
(
retIndexData
);
IWineD3DBuffer_GetParent
(
retIndexData
,
(
IUnknown
**
)
ppIndexData
);
IWineD3DBuffer_Release
(
retIndexData
);
}
else
{
if
(
FAILED
(
rc
))
FIXME
(
"Call to GetIndices failed
\n
"
);
*
ppIndexData
=
NULL
;
...
...
dlls/d3d8/indexbuffer.c
View file @
513a493f
...
...
@@ -57,7 +57,7 @@ static ULONG WINAPI IDirect3DIndexBuffer8Impl_Release(LPDIRECT3DINDEXBUFFER8 ifa
if
(
ref
==
0
)
{
EnterCriticalSection
(
&
d3d8_cs
);
IWineD3D
Index
Buffer_Release
(
This
->
wineD3DIndexBuffer
);
IWineD3DBuffer_Release
(
This
->
wineD3DIndexBuffer
);
LeaveCriticalSection
(
&
d3d8_cs
);
IUnknown_Release
(
This
->
parentDevice
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
...
@@ -73,7 +73,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDevice(LPDIRECT3DINDEXBUFFER8
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d8_cs
);
hr
=
IWineD3D
Index
Buffer_GetDevice
(
This
->
wineD3DIndexBuffer
,
&
wined3d_device
);
hr
=
IWineD3DBuffer_GetDevice
(
This
->
wineD3DIndexBuffer
,
&
wined3d_device
);
if
(
SUCCEEDED
(
hr
))
{
IWineD3DDevice_GetParent
(
wined3d_device
,
(
IUnknown
**
)
ppDevice
);
...
...
@@ -89,7 +89,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer8Impl_SetPrivateData(LPDIRECT3DINDEXBU
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d8_cs
);
hr
=
IWineD3D
Index
Buffer_SetPrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
,
pData
,
SizeOfData
,
Flags
);
hr
=
IWineD3DBuffer_SetPrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
,
pData
,
SizeOfData
,
Flags
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
hr
;
}
...
...
@@ -100,7 +100,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetPrivateData(LPDIRECT3DINDEXBU
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d8_cs
);
hr
=
IWineD3D
Index
Buffer_GetPrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
,
pData
,
pSizeOfData
);
hr
=
IWineD3DBuffer_GetPrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
,
pData
,
pSizeOfData
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
hr
;
}
...
...
@@ -111,7 +111,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer8Impl_FreePrivateData(LPDIRECT3DINDEXB
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d8_cs
);
hr
=
IWineD3D
Index
Buffer_FreePrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
);
hr
=
IWineD3DBuffer_FreePrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
hr
;
}
...
...
@@ -122,7 +122,7 @@ static DWORD WINAPI IDirect3DIndexBuffer8Impl_SetPriority(LPDIRECT3DINDEXBUFFER8
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d8_cs
);
ret
=
IWineD3D
Index
Buffer_SetPriority
(
This
->
wineD3DIndexBuffer
,
PriorityNew
);
ret
=
IWineD3DBuffer_SetPriority
(
This
->
wineD3DIndexBuffer
,
PriorityNew
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
ret
;
}
...
...
@@ -133,7 +133,7 @@ static DWORD WINAPI IDirect3DIndexBuffer8Impl_GetPriority(LPDIRECT3DINDEXBUFFER8
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d8_cs
);
ret
=
IWineD3D
Index
Buffer_GetPriority
(
This
->
wineD3DIndexBuffer
);
ret
=
IWineD3DBuffer_GetPriority
(
This
->
wineD3DIndexBuffer
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
ret
;
}
...
...
@@ -143,7 +143,7 @@ static void WINAPI IDirect3DIndexBuffer8Impl_PreLoad(LPDIRECT3DINDEXBUFFER8 ifac
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d8_cs
);
IWineD3D
Index
Buffer_PreLoad
(
This
->
wineD3DIndexBuffer
);
IWineD3DBuffer_PreLoad
(
This
->
wineD3DIndexBuffer
);
LeaveCriticalSection
(
&
d3d8_cs
);
}
...
...
@@ -161,7 +161,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer8Impl_Lock(LPDIRECT3DINDEXBUFFER8 ifac
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d8_cs
);
hr
=
IWineD3D
Index
Buffer_Map
(
This
->
wineD3DIndexBuffer
,
OffsetToLock
,
SizeToLock
,
ppbData
,
Flags
);
hr
=
IWineD3DBuffer_Map
(
This
->
wineD3DIndexBuffer
,
OffsetToLock
,
SizeToLock
,
ppbData
,
Flags
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
hr
;
}
...
...
@@ -172,7 +172,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer8Impl_Unlock(LPDIRECT3DINDEXBUFFER8 if
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d8_cs
);
hr
=
IWineD3D
Index
Buffer_Unmap
(
This
->
wineD3DIndexBuffer
);
hr
=
IWineD3DBuffer_Unmap
(
This
->
wineD3DIndexBuffer
);
LeaveCriticalSection
(
&
d3d8_cs
);
return
hr
;
}
...
...
@@ -184,7 +184,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDesc(LPDIRECT3DINDEXBUFFER8 i
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d8_cs
);
hr
=
IWineD3D
Index
Buffer_GetDesc
(
This
->
wineD3DIndexBuffer
,
&
desc
);
hr
=
IWineD3DBuffer_GetDesc
(
This
->
wineD3DIndexBuffer
,
&
desc
);
LeaveCriticalSection
(
&
d3d8_cs
);
if
(
SUCCEEDED
(
hr
))
{
...
...
dlls/d3d9/d3d9_private.h
View file @
513a493f
...
...
@@ -345,7 +345,7 @@ typedef struct IDirect3DIndexBuffer9Impl
LONG
ref
;
/* IDirect3DResource9 fields */
IWineD3D
IndexBuffer
*
wineD3DIndexBuffer
;
IWineD3D
Buffer
*
wineD3DIndexBuffer
;
/* Parent reference */
LPDIRECT3DDEVICE9EX
parentDevice
;
...
...
dlls/d3d9/device.c
View file @
513a493f
...
...
@@ -1649,7 +1649,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetIndices(LPDIRECT3DDEVICE9EX ifac
static
HRESULT
WINAPI
IDirect3DDevice9Impl_GetIndices
(
LPDIRECT3DDEVICE9EX
iface
,
IDirect3DIndexBuffer9
**
ppIndexData
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
IWineD3D
Index
Buffer
*
retIndexData
=
NULL
;
IWineD3DBuffer
*
retIndexData
=
NULL
;
HRESULT
rc
=
D3D_OK
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
...
...
@@ -1661,8 +1661,8 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetIndices(LPDIRECT3DDEVICE9EX ifac
EnterCriticalSection
(
&
d3d9_cs
);
rc
=
IWineD3DDevice_GetIndices
(
This
->
WineD3DDevice
,
&
retIndexData
);
if
(
SUCCEEDED
(
rc
)
&&
retIndexData
)
{
IWineD3D
Index
Buffer_GetParent
(
retIndexData
,
(
IUnknown
**
)
ppIndexData
);
IWineD3D
Index
Buffer_Release
(
retIndexData
);
IWineD3DBuffer_GetParent
(
retIndexData
,
(
IUnknown
**
)
ppIndexData
);
IWineD3DBuffer_Release
(
retIndexData
);
}
else
{
if
(
FAILED
(
rc
))
FIXME
(
"Call to GetIndices failed
\n
"
);
*
ppIndexData
=
NULL
;
...
...
dlls/d3d9/indexbuffer.c
View file @
513a493f
...
...
@@ -58,7 +58,7 @@ static ULONG WINAPI IDirect3DIndexBuffer9Impl_Release(LPDIRECT3DINDEXBUFFER9 ifa
if
(
ref
==
0
)
{
EnterCriticalSection
(
&
d3d9_cs
);
IWineD3D
Index
Buffer_Release
(
This
->
wineD3DIndexBuffer
);
IWineD3DBuffer_Release
(
This
->
wineD3DIndexBuffer
);
LeaveCriticalSection
(
&
d3d9_cs
);
IDirect3DDevice9Ex_Release
(
This
->
parentDevice
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
...
@@ -74,7 +74,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer9Impl_GetDevice(LPDIRECT3DINDEXBUFFER9
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3D
Index
Buffer_GetDevice
(
This
->
wineD3DIndexBuffer
,
&
wined3d_device
);
hr
=
IWineD3DBuffer_GetDevice
(
This
->
wineD3DIndexBuffer
,
&
wined3d_device
);
if
(
SUCCEEDED
(
hr
))
{
IWineD3DDevice_GetParent
(
wined3d_device
,
(
IUnknown
**
)
ppDevice
);
...
...
@@ -90,7 +90,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer9Impl_SetPrivateData(LPDIRECT3DINDEXBU
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3D
Index
Buffer_SetPrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
,
pData
,
SizeOfData
,
Flags
);
hr
=
IWineD3DBuffer_SetPrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
,
pData
,
SizeOfData
,
Flags
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
...
...
@@ -101,7 +101,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer9Impl_GetPrivateData(LPDIRECT3DINDEXBU
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3D
Index
Buffer_GetPrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
,
pData
,
pSizeOfData
);
hr
=
IWineD3DBuffer_GetPrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
,
pData
,
pSizeOfData
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
...
...
@@ -112,7 +112,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer9Impl_FreePrivateData(LPDIRECT3DINDEXB
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3D
Index
Buffer_FreePrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
);
hr
=
IWineD3DBuffer_FreePrivateData
(
This
->
wineD3DIndexBuffer
,
refguid
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
...
...
@@ -123,7 +123,7 @@ static DWORD WINAPI IDirect3DIndexBuffer9Impl_SetPriority(LPDIRECT3DINDEXBUFFER9
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
ret
=
IWineD3D
Index
Buffer_SetPriority
(
This
->
wineD3DIndexBuffer
,
PriorityNew
);
ret
=
IWineD3DBuffer_SetPriority
(
This
->
wineD3DIndexBuffer
,
PriorityNew
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
ret
;
}
...
...
@@ -134,7 +134,7 @@ static DWORD WINAPI IDirect3DIndexBuffer9Impl_GetPriority(LPDIRECT3DINDEXBUFFER9
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
ret
=
IWineD3D
Index
Buffer_GetPriority
(
This
->
wineD3DIndexBuffer
);
ret
=
IWineD3DBuffer_GetPriority
(
This
->
wineD3DIndexBuffer
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
ret
;
}
...
...
@@ -144,7 +144,7 @@ static void WINAPI IDirect3DIndexBuffer9Impl_PreLoad(LPDIRECT3DINDEXBUFFER9 ifac
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
IWineD3D
Index
Buffer_PreLoad
(
This
->
wineD3DIndexBuffer
);
IWineD3DBuffer_PreLoad
(
This
->
wineD3DIndexBuffer
);
LeaveCriticalSection
(
&
d3d9_cs
);
}
...
...
@@ -162,7 +162,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer9Impl_Lock(LPDIRECT3DINDEXBUFFER9 ifac
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3D
Index
Buffer_Map
(
This
->
wineD3DIndexBuffer
,
OffsetToLock
,
SizeToLock
,
(
BYTE
**
)
ppbData
,
Flags
);
hr
=
IWineD3DBuffer_Map
(
This
->
wineD3DIndexBuffer
,
OffsetToLock
,
SizeToLock
,
(
BYTE
**
)
ppbData
,
Flags
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
...
...
@@ -173,7 +173,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer9Impl_Unlock(LPDIRECT3DINDEXBUFFER9 if
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3D
Index
Buffer_Unmap
(
This
->
wineD3DIndexBuffer
);
hr
=
IWineD3DBuffer_Unmap
(
This
->
wineD3DIndexBuffer
);
LeaveCriticalSection
(
&
d3d9_cs
);
return
hr
;
}
...
...
@@ -185,7 +185,7 @@ static HRESULT WINAPI IDirect3DIndexBuffer9Impl_GetDesc(LPDIRECT3DINDEXB
TRACE
(
"(%p) Relay
\n
"
,
This
);
EnterCriticalSection
(
&
d3d9_cs
);
hr
=
IWineD3D
Index
Buffer_GetDesc
(
This
->
wineD3DIndexBuffer
,
&
desc
);
hr
=
IWineD3DBuffer_GetDesc
(
This
->
wineD3DIndexBuffer
,
&
desc
);
LeaveCriticalSection
(
&
d3d9_cs
);
if
(
SUCCEEDED
(
hr
))
{
...
...
dlls/ddraw/ddraw_private.h
View file @
513a493f
...
...
@@ -385,7 +385,7 @@ struct IDirect3DDeviceImpl
/* Other object connections */
IWineD3DDevice
*
wineD3DDevice
;
IDirectDrawImpl
*
ddraw
;
IWineD3D
IndexBuffer
*
indexbuffer
;
IWineD3D
Buffer
*
indexbuffer
;
IDirectDrawSurfaceImpl
*
target
;
BOOL
OffScreenTarget
;
...
...
dlls/ddraw/device.c
View file @
513a493f
...
...
@@ -317,8 +317,8 @@ IDirect3DDeviceImpl_7_Release(IDirect3DDevice7 *iface)
EnterCriticalSection
(
&
ddraw_cs
);
/* Free the index buffer. */
IWineD3DDevice_SetIndices
(
This
->
wineD3DDevice
,
NULL
);
IWineD3D
Index
Buffer_GetParent
(
This
->
indexbuffer
,
(
IUnknown
**
)
&
IndexBufferParent
);
IWineD3DBuffer_GetParent
(
This
->
indexbuffer
,
(
IUnknown
**
)
&
IndexBufferParent
);
IParent_Release
(
IndexBufferParent
);
/* Once for the getParent */
if
(
IParent_Release
(
IndexBufferParent
)
!=
0
)
/* And now to destroy it */
{
...
...
@@ -4271,23 +4271,23 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
* or a SetData-Method for the index buffer, which
* overrides the index buffer data with our pointer.
*/
hr
=
IWineD3D
Index
Buffer_Map
(
This
->
indexbuffer
,
0
/* OffSetToLock */
,
IndexCount
*
sizeof
(
WORD
),
(
BYTE
**
)
&
LockedIndices
,
0
/* Flags */
);
hr
=
IWineD3DBuffer_Map
(
This
->
indexbuffer
,
0
/* OffSetToLock */
,
IndexCount
*
sizeof
(
WORD
),
(
BYTE
**
)
&
LockedIndices
,
0
/* Flags */
);
assert
(
IndexCount
<
0x100000
);
if
(
hr
!=
D3D_OK
)
{
ERR
(
"(%p) IWineD3D
IndexBuffer::Lock
failed with hr = %08x
\n
"
,
This
,
hr
);
ERR
(
"(%p) IWineD3D
Buffer::Map
failed with hr = %08x
\n
"
,
This
,
hr
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
memcpy
(
LockedIndices
,
Indices
,
IndexCount
*
sizeof
(
WORD
));
hr
=
IWineD3D
Index
Buffer_Unmap
(
This
->
indexbuffer
);
hr
=
IWineD3DBuffer_Unmap
(
This
->
indexbuffer
);
if
(
hr
!=
D3D_OK
)
{
ERR
(
"(%p) IWineD3D
IndexBuffer::Unlock
failed with hr = %08x
\n
"
,
This
,
hr
);
ERR
(
"(%p) IWineD3D
Buffer::Unmap
failed with hr = %08x
\n
"
,
This
,
hr
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
...
...
dlls/ddraw/direct3d.c
View file @
513a493f
...
...
@@ -820,7 +820,7 @@ IDirect3DImpl_7_CreateDevice(IDirect3D7 *iface,
/* Create an Index Buffer. WineD3D needs one for Drawing indexed primitives
* Create a (hopefully) long enough buffer, and copy the indices into it
* Ideally, a IWineD3D
Index
Buffer::SetData method could be created, which
* Ideally, a IWineD3DBuffer::SetData method could be created, which
* takes the pointer and avoids the memcpy
*/
hr
=
IWineD3DDevice_CreateIndexBuffer
(
This
->
wineD3DDevice
,
0x40000
/* Length. Don't know how long it should be */
,
...
...
dlls/ddraw/vertexbuffer.c
View file @
513a493f
...
...
@@ -245,7 +245,7 @@ IDirect3DVertexBufferImpl_Lock(IDirect3DVertexBuffer7 *iface,
hr
=
IWineD3DBuffer_GetDesc
(
This
->
wineD3DVertexBuffer
,
&
Desc
);
if
(
hr
!=
D3D_OK
)
{
ERR
(
"(%p) IWineD3D
Vertex
Buffer::GetDesc failed with hr=%08x
\n
"
,
This
,
hr
);
ERR
(
"(%p) IWineD3DBuffer::GetDesc failed with hr=%08x
\n
"
,
This
,
hr
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
...
...
@@ -445,7 +445,7 @@ IDirect3DVertexBufferImpl_GetVertexBufferDesc(IDirect3DVertexBuffer7 *iface,
hr
=
IWineD3DBuffer_GetDesc
(
This
->
wineD3DVertexBuffer
,
&
WDesc
);
if
(
hr
!=
D3D_OK
)
{
ERR
(
"(%p) IWineD3D
Vertex
Buffer::GetDesc failed with hr=%08x
\n
"
,
This
,
hr
);
ERR
(
"(%p) IWineD3DBuffer::GetDesc failed with hr=%08x
\n
"
,
This
,
hr
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
...
...
dlls/wined3d/device.c
View file @
513a493f
...
...
@@ -583,7 +583,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexBuffer(IWineD3DDevice *ifac
}
static
HRESULT
WINAPI
IWineD3DDeviceImpl_CreateIndexBuffer
(
IWineD3DDevice
*
iface
,
UINT
Length
,
DWORD
Usage
,
WINED3DFORMAT
Format
,
WINED3DPOOL
Pool
,
IWineD3D
Index
Buffer
**
ppIndexBuffer
,
WINED3DFORMAT
Format
,
WINED3DPOOL
Pool
,
IWineD3DBuffer
**
ppIndexBuffer
,
HANDLE
*
sharedHandle
,
IUnknown
*
parent
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
const
struct
GlPixelFormatDesc
*
format_desc
=
getFormatDescEntry
(
Format
,
&
This
->
adapter
->
gl_info
);
...
...
@@ -622,7 +622,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateIndexBuffer(IWineD3DDevice *iface
TRACE
(
"(%p) : Len=%d, Use=%x, Format=(%u,%s), Pool=%d - Memory@%p, Iface@%p
\n
"
,
This
,
Length
,
Usage
,
Format
,
debug_d3dformat
(
Format
),
Pool
,
object
,
object
->
resource
.
allocatedMemory
);
*
ppIndexBuffer
=
(
IWineD3D
Index
Buffer
*
)
object
;
*
ppIndexBuffer
=
(
IWineD3DBuffer
*
)
object
;
return
WINED3D_OK
;
}
...
...
@@ -752,7 +752,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface,
}
}
if
(
object
->
pIndexData
)
{
IWineD3D
Index
Buffer_AddRef
(
object
->
pIndexData
);
IWineD3DBuffer_AddRef
(
object
->
pIndexData
);
}
if
(
object
->
vertexShader
)
{
IWineD3DVertexShader_AddRef
(
object
->
vertexShader
);
...
...
@@ -3637,9 +3637,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetMaterial(IWineD3DDevice *iface, WINE
/*****
* Get / Set Indices
*****/
static
HRESULT
WINAPI
IWineD3DDeviceImpl_SetIndices
(
IWineD3DDevice
*
iface
,
IWineD3D
Index
Buffer
*
pIndexData
)
{
static
HRESULT
WINAPI
IWineD3DDeviceImpl_SetIndices
(
IWineD3DDevice
*
iface
,
IWineD3DBuffer
*
pIndexData
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3D
Index
Buffer
*
oldIdxs
;
IWineD3DBuffer
*
oldIdxs
;
TRACE
(
"(%p) : Setting to %p
\n
"
,
This
,
pIndexData
);
oldIdxs
=
This
->
updateStateBlock
->
pIndexData
;
...
...
@@ -3650,8 +3650,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetIndices(IWineD3DDevice *iface, IWine
/* Handle recording of state blocks */
if
(
This
->
isRecordingState
)
{
TRACE
(
"Recording... not performing anything
\n
"
);
if
(
pIndexData
)
IWineD3D
Index
Buffer_AddRef
(
pIndexData
);
if
(
oldIdxs
)
IWineD3D
Index
Buffer_Release
(
oldIdxs
);
if
(
pIndexData
)
IWineD3DBuffer_AddRef
(
pIndexData
);
if
(
oldIdxs
)
IWineD3DBuffer_Release
(
oldIdxs
);
return
WINED3D_OK
;
}
...
...
@@ -3659,25 +3659,25 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetIndices(IWineD3DDevice *iface, IWine
IWineD3DDeviceImpl_MarkStateDirty
(
This
,
STATE_INDEXBUFFER
);
if
(
pIndexData
)
{
InterlockedIncrement
(
&
((
struct
wined3d_buffer
*
)
pIndexData
)
->
bind_count
);
IWineD3D
Index
Buffer_AddRef
(
pIndexData
);
IWineD3DBuffer_AddRef
(
pIndexData
);
}
if
(
oldIdxs
)
{
InterlockedDecrement
(
&
((
struct
wined3d_buffer
*
)
oldIdxs
)
->
bind_count
);
IWineD3D
Index
Buffer_Release
(
oldIdxs
);
IWineD3DBuffer_Release
(
oldIdxs
);
}
}
return
WINED3D_OK
;
}
static
HRESULT
WINAPI
IWineD3DDeviceImpl_GetIndices
(
IWineD3DDevice
*
iface
,
IWineD3D
Index
Buffer
**
ppIndexData
)
{
static
HRESULT
WINAPI
IWineD3DDeviceImpl_GetIndices
(
IWineD3DDevice
*
iface
,
IWineD3DBuffer
**
ppIndexData
)
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
*
ppIndexData
=
This
->
stateBlock
->
pIndexData
;
/* up ref count on ppindexdata */
if
(
*
ppIndexData
)
{
IWineD3D
Index
Buffer_AddRef
(
*
ppIndexData
);
IWineD3DBuffer_AddRef
(
*
ppIndexData
);
TRACE
(
"(%p) index data set to %p
\n
"
,
This
,
ppIndexData
);
}
else
{
TRACE
(
"(%p) No index data set
\n
"
,
This
);
...
...
@@ -5637,7 +5637,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *if
{
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
UINT
idxStride
=
2
;
IWineD3D
Index
Buffer
*
pIB
;
IWineD3DBuffer
*
pIB
;
WINED3DBUFFER_DESC
IdxBufDsc
;
GLuint
vbo
;
...
...
@@ -5665,7 +5665,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *if
TRACE
(
"(%p) : min %u, vertex count %u, startIdx %u, index count %u
\n
"
,
This
,
minIndex
,
NumVertices
,
startIndex
,
index_count
);
IWineD3D
Index
Buffer_GetDesc
(
pIB
,
&
IdxBufDsc
);
IWineD3DBuffer_GetDesc
(
pIB
,
&
IdxBufDsc
);
if
(
IdxBufDsc
.
Format
==
WINED3DFMT_R16_UINT
)
{
idxStride
=
2
;
}
else
{
...
...
@@ -5729,7 +5729,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice *
int
idxStride
;
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
IWineD3DBuffer
*
vb
;
IWineD3D
Index
Buffer
*
ib
;
IWineD3DBuffer
*
ib
;
TRACE
(
"(%p) : MinVtxIdx %u, NumVIdx %u, index count %u, pidxdata %p, IdxFmt %u, pVtxdata %p, stride=%u
\n
"
,
This
,
MinVertexIndex
,
NumVertices
,
index_count
,
pIndexData
,
...
...
@@ -5769,7 +5769,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice *
This
->
stateBlock
->
streamStride
[
0
]
=
0
;
ib
=
This
->
stateBlock
->
pIndexData
;
if
(
ib
)
{
IWineD3D
Index
Buffer_Release
(
ib
);
IWineD3DBuffer_Release
(
ib
);
This
->
stateBlock
->
pIndexData
=
NULL
;
}
/* No need to mark the stream source state dirty here. Either the app calls UP drawing again, or it has to call
...
...
@@ -7890,12 +7890,12 @@ static void WINAPI IWineD3DDeviceImpl_ResourceReleased(IWineD3DDevice *iface, IW
}
if
(
This
->
updateStateBlock
!=
NULL
)
{
/* ==NULL when device is being destroyed */
if
(
This
->
updateStateBlock
->
pIndexData
==
(
IWineD3D
Index
Buffer
*
)
resource
)
{
if
(
This
->
updateStateBlock
->
pIndexData
==
(
IWineD3DBuffer
*
)
resource
)
{
This
->
updateStateBlock
->
pIndexData
=
NULL
;
}
}
if
(
This
->
stateBlock
!=
NULL
)
{
/* ==NULL when device is being destroyed */
if
(
This
->
stateBlock
->
pIndexData
==
(
IWineD3D
Index
Buffer
*
)
resource
)
{
if
(
This
->
stateBlock
->
pIndexData
==
(
IWineD3DBuffer
*
)
resource
)
{
This
->
stateBlock
->
pIndexData
=
NULL
;
}
}
...
...
dlls/wined3d/stateblock.c
View file @
513a493f
...
...
@@ -301,7 +301,7 @@ static ULONG WINAPI IWineD3DStateBlockImpl_Release(IWineD3DStateBlock *iface) {
}
}
}
if
(
This
->
pIndexData
)
IWineD3D
Index
Buffer_Release
(
This
->
pIndexData
);
if
(
This
->
pIndexData
)
IWineD3DBuffer_Release
(
This
->
pIndexData
);
if
(
This
->
vertexShader
)
IWineD3DVertexShader_Release
(
This
->
vertexShader
);
if
(
This
->
pixelShader
)
IWineD3DPixelShader_Release
(
This
->
pixelShader
);
...
...
@@ -509,8 +509,8 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
||
(
This
->
baseVertexIndex
!=
targetStateBlock
->
baseVertexIndex
)))
{
TRACE
(
"Updating pIndexData to %p, baseVertexIndex to %d
\n
"
,
targetStateBlock
->
pIndexData
,
targetStateBlock
->
baseVertexIndex
);
if
(
targetStateBlock
->
pIndexData
)
IWineD3D
Index
Buffer_AddRef
(
targetStateBlock
->
pIndexData
);
if
(
This
->
pIndexData
)
IWineD3D
Index
Buffer_Release
(
This
->
pIndexData
);
if
(
targetStateBlock
->
pIndexData
)
IWineD3DBuffer_AddRef
(
targetStateBlock
->
pIndexData
);
if
(
This
->
pIndexData
)
IWineD3DBuffer_Release
(
This
->
pIndexData
);
This
->
pIndexData
=
targetStateBlock
->
pIndexData
;
This
->
baseVertexIndex
=
targetStateBlock
->
baseVertexIndex
;
}
...
...
@@ -656,8 +656,8 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface)
This
->
scissorRect
=
targetStateBlock
->
scissorRect
;
if
(
targetStateBlock
->
pIndexData
!=
This
->
pIndexData
)
{
if
(
targetStateBlock
->
pIndexData
)
IWineD3D
Index
Buffer_AddRef
(
targetStateBlock
->
pIndexData
);
if
(
This
->
pIndexData
)
IWineD3D
Index
Buffer_Release
(
This
->
pIndexData
);
if
(
targetStateBlock
->
pIndexData
)
IWineD3DBuffer_AddRef
(
targetStateBlock
->
pIndexData
);
if
(
This
->
pIndexData
)
IWineD3DBuffer_Release
(
This
->
pIndexData
);
This
->
pIndexData
=
targetStateBlock
->
pIndexData
;
}
for
(
i
=
0
;
i
<
MAX_STREAMS
;
i
++
)
{
...
...
dlls/wined3d/wined3d_private.h
View file @
513a493f
...
...
@@ -1930,7 +1930,7 @@ struct IWineD3DStateBlockImpl
UINT
streamFlags
[
MAX_STREAMS
+
1
];
/*0 | WINED3DSTREAMSOURCE_INSTANCEDATA | WINED3DSTREAMSOURCE_INDEXEDDATA */
/* Indices */
IWineD3D
IndexBuffer
*
pIndexData
;
IWineD3D
Buffer
*
pIndexData
;
INT
baseVertexIndex
;
INT
loadBaseVertexIndex
;
/* non-indexed drawing needs 0 here, indexed baseVertexIndex */
...
...
include/wine/wined3d.idl
View file @
513a493f
...
...
@@ -2342,26 +2342,6 @@ interface IWineD3DRendertargetView : IWineD3DBase
[
object
,
local
,
uuid
(
3
a02a54e
-
6
f30
-
11
d9
-
c687
-
00046142
c14f
)
]
interface
IWineD3DIndexBuffer
:
IWineD3DResource
{
HRESULT
Map
(
[
in
]
UINT
offset
,
[
in
]
UINT
size
,
[
out
]
BYTE
**
data
,
[
in
]
DWORD
flags
)
;
HRESULT
Unmap
(
)
;
HRESULT
GetDesc
(
[
out
]
WINED3DBUFFER_DESC
*
desc
)
;
}
[
object
,
local
,
uuid
(
f756720c
-
32b9
-
4439
-
b5a3
-
1
d6c97037d9e
)
]
interface
IWineD3DPalette
:
IWineD3DBase
...
...
@@ -2916,7 +2896,7 @@ interface IWineD3DDevice : IWineD3DBase
[
in
]
DWORD
usage
,
[
in
]
WINED3DFORMAT
format
,
[
in
]
WINED3DPOOL
pool
,
[
out
]
IWineD3D
Index
Buffer
**
index_buffer
,
[
out
]
IWineD3DBuffer
**
index_buffer
,
[
in
]
HANDLE
*
shared_handle
,
[
in
]
IUnknown
*
parent
)
;
...
...
@@ -3139,10 +3119,10 @@ interface IWineD3DDevice : IWineD3DBase
[
out
]
WINED3DGAMMARAMP
*
ramp
)
;
HRESULT
SetIndices
(
[
in
]
IWineD3D
Index
Buffer
*
index_buffer
[
in
]
IWineD3DBuffer
*
index_buffer
)
;
HRESULT
GetIndices
(
[
out
]
IWineD3D
Index
Buffer
**
index_buffer
[
out
]
IWineD3DBuffer
**
index_buffer
)
;
HRESULT
SetBaseVertexIndex
(
[
in
]
INT
base_index
...
...
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