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
f18cb4c2
Commit
f18cb4c2
authored
Jun 30, 2010
by
Mikko Rasa
Committed by
Alexandre Julliard
Jun 30, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Grow index buffer as needed.
parent
929ba3f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
device.c
dlls/ddraw/device.c
+32
-1
No files found.
dlls/ddraw/device.c
View file @
f18cb4c2
...
@@ -4299,6 +4299,7 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
...
@@ -4299,6 +4299,7 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
DWORD
stride
=
get_flexible_vertex_size
(
vb
->
fvf
);
DWORD
stride
=
get_flexible_vertex_size
(
vb
->
fvf
);
WORD
*
LockedIndices
;
WORD
*
LockedIndices
;
HRESULT
hr
;
HRESULT
hr
;
WINED3DBUFFER_DESC
desc
;
TRACE
(
"(%p)->(%08x,%p,%d,%d,%p,%d,%08x)
\n
"
,
This
,
PrimitiveType
,
vb
,
StartVertex
,
NumVertices
,
Indices
,
IndexCount
,
Flags
);
TRACE
(
"(%p)->(%08x,%p,%d,%d,%p,%d,%08x)
\n
"
,
This
,
PrimitiveType
,
vb
,
StartVertex
,
NumVertices
,
Indices
,
IndexCount
,
Flags
);
...
@@ -4320,6 +4321,37 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
...
@@ -4320,6 +4321,37 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
return
hr
;
return
hr
;
}
}
/* check that the buffer is large enough to hold the indices,
* reallocate if necessary.
*/
hr
=
IWineD3DBuffer_GetDesc
(
This
->
indexbuffer
,
&
desc
);
if
(
desc
.
Size
<
IndexCount
*
sizeof
(
WORD
))
{
UINT
size
=
max
(
desc
.
Size
*
2
,
IndexCount
*
sizeof
(
WORD
));
IWineD3DBuffer
*
buffer
;
IUnknown
*
parent
;
TRACE
(
"Growing index buffer to %u bytes
\n
"
,
size
);
IWineD3DBuffer_GetParent
(
This
->
indexbuffer
,
&
parent
);
hr
=
IWineD3DDevice_CreateIndexBuffer
(
This
->
wineD3DDevice
,
size
,
WINED3DUSAGE_DYNAMIC
/* Usage */
,
WINED3DPOOL_DEFAULT
,
&
buffer
,
parent
,
&
ddraw_null_wined3d_parent_ops
);
if
(
hr
!=
D3D_OK
)
{
ERR
(
"(%p) IWineD3DDevice::CreateIndexBuffer failed with hr = %08x
\n
"
,
This
,
hr
);
IParent_Release
(
parent
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
IWineD3DBuffer_Release
(
This
->
indexbuffer
);
This
->
indexbuffer
=
buffer
;
((
IParentImpl
*
)
parent
)
->
child
=
(
IUnknown
*
)
buffer
;
IParent_Release
(
parent
);
}
/* copy the index stream into the index buffer.
/* copy the index stream into the index buffer.
* A new IWineD3DDevice method could be created
* A new IWineD3DDevice method could be created
* which takes an user pointer containing the indices
* which takes an user pointer containing the indices
...
@@ -4331,7 +4363,6 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
...
@@ -4331,7 +4363,6 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
IndexCount
*
sizeof
(
WORD
),
IndexCount
*
sizeof
(
WORD
),
(
BYTE
**
)
&
LockedIndices
,
(
BYTE
**
)
&
LockedIndices
,
0
/* Flags */
);
0
/* Flags */
);
assert
(
IndexCount
<
0x100000
);
if
(
hr
!=
D3D_OK
)
if
(
hr
!=
D3D_OK
)
{
{
ERR
(
"(%p) IWineD3DBuffer::Map failed with hr = %08x
\n
"
,
This
,
hr
);
ERR
(
"(%p) IWineD3DBuffer::Map failed with hr = %08x
\n
"
,
This
,
hr
);
...
...
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