Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
584cb331
Commit
584cb331
authored
Aug 19, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Add a separate function for execute buffer initialization.
parent
a60c4939
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
40 deletions
+45
-40
ddraw_private.h
dlls/ddraw/ddraw_private.h
+2
-2
device.c
dlls/ddraw/device.c
+7
-37
executebuffer.c
dlls/ddraw/executebuffer.c
+36
-1
No files found.
dlls/ddraw/ddraw_private.h
View file @
584cb331
...
@@ -614,8 +614,8 @@ struct IDirect3DExecuteBufferImpl
...
@@ -614,8 +614,8 @@ struct IDirect3DExecuteBufferImpl
BOOL
need_free
;
BOOL
need_free
;
};
};
/* The VTable */
HRESULT
d3d_execute_buffer_init
(
IDirect3DExecuteBufferImpl
*
execute_buffer
,
extern
const
IDirect3DExecuteBufferVtbl
IDirect3DExecuteBuffer_Vtbl
DECLSPEC_HIDDEN
;
IDirect3DDeviceImpl
*
device
,
D3DEXECUTEBUFFERDESC
*
desc
)
DECLSPEC_HIDDEN
;
/* The execute function */
/* The execute function */
void
IDirect3DExecuteBufferImpl_Execute
(
IDirect3DExecuteBufferImpl
*
This
,
void
IDirect3DExecuteBufferImpl_Execute
(
IDirect3DExecuteBufferImpl
*
This
,
...
...
dlls/ddraw/device.c
View file @
584cb331
...
@@ -712,6 +712,8 @@ IDirect3DDeviceImpl_1_CreateExecuteBuffer(IDirect3DDevice *iface,
...
@@ -712,6 +712,8 @@ IDirect3DDeviceImpl_1_CreateExecuteBuffer(IDirect3DDevice *iface,
{
{
IDirect3DDeviceImpl
*
This
=
device_from_device1
(
iface
);
IDirect3DDeviceImpl
*
This
=
device_from_device1
(
iface
);
IDirect3DExecuteBufferImpl
*
object
;
IDirect3DExecuteBufferImpl
*
object
;
HRESULT
hr
;
TRACE
(
"(%p)->(%p,%p,%p)!
\n
"
,
This
,
Desc
,
ExecuteBuffer
,
UnkOuter
);
TRACE
(
"(%p)->(%p,%p,%p)!
\n
"
,
This
,
Desc
,
ExecuteBuffer
,
UnkOuter
);
if
(
UnkOuter
)
if
(
UnkOuter
)
...
@@ -725,46 +727,14 @@ IDirect3DDeviceImpl_1_CreateExecuteBuffer(IDirect3DDevice *iface,
...
@@ -725,46 +727,14 @@ IDirect3DDeviceImpl_1_CreateExecuteBuffer(IDirect3DDevice *iface,
return
DDERR_OUTOFMEMORY
;
return
DDERR_OUTOFMEMORY
;
}
}
object
->
lpVtbl
=
&
IDirect3DExecuteBuffer_Vtbl
;
hr
=
d3d_execute_buffer_init
(
object
,
This
,
Desc
);
object
->
ref
=
1
;
if
(
FAILED
(
hr
))
object
->
d3ddev
=
This
;
/* Initializes memory */
memcpy
(
&
object
->
desc
,
Desc
,
Desc
->
dwSize
);
/* No buffer given */
if
((
object
->
desc
.
dwFlags
&
D3DDEB_LPDATA
)
==
0
)
object
->
desc
.
lpData
=
NULL
;
/* No buffer size given */
if
((
object
->
desc
.
dwFlags
&
D3DDEB_BUFSIZE
)
==
0
)
object
->
desc
.
dwBufferSize
=
0
;
/* Create buffer if asked */
if
((
object
->
desc
.
lpData
==
NULL
)
&&
(
object
->
desc
.
dwBufferSize
>
0
))
{
object
->
need_free
=
TRUE
;
object
->
desc
.
lpData
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
object
->
desc
.
dwBufferSize
);
if
(
!
object
->
desc
.
lpData
)
{
ERR
(
"Out of memory when allocating the execute buffer data
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
DDERR_OUTOFMEMORY
;
}
}
else
{
{
object
->
need_free
=
FALSE
;
WARN
(
"Failed to initialize execute buffer, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
}
/* No vertices for the moment */
object
->
vertex_data
=
NULL
;
object
->
desc
.
dwFlags
|=
D3DDEB_LPDATA
;
object
->
indices
=
NULL
;
object
->
nb_indices
=
0
;
*
ExecuteBuffer
=
(
IDirect3DExecuteBuffer
*
)
object
;
*
ExecuteBuffer
=
(
IDirect3DExecuteBuffer
*
)
object
;
TRACE
(
" Returning IDirect3DExecuteBuffer at %p, implementation is at %p
\n
"
,
*
ExecuteBuffer
,
object
);
TRACE
(
" Returning IDirect3DExecuteBuffer at %p, implementation is at %p
\n
"
,
*
ExecuteBuffer
,
object
);
...
...
dlls/ddraw/executebuffer.c
View file @
584cb331
...
@@ -825,7 +825,7 @@ IDirect3DExecuteBufferImpl_Optimize(IDirect3DExecuteBuffer *iface,
...
@@ -825,7 +825,7 @@ IDirect3DExecuteBufferImpl_Optimize(IDirect3DExecuteBuffer *iface,
return
DDERR_UNSUPPORTED
;
/* Unchecked */
return
DDERR_UNSUPPORTED
;
/* Unchecked */
}
}
const
IDirect3DExecuteBufferVtbl
IDirect3DExecuteBuffer_V
tbl
=
static
const
struct
IDirect3DExecuteBufferVtbl
d3d_execute_buffer_v
tbl
=
{
{
IDirect3DExecuteBufferImpl_QueryInterface
,
IDirect3DExecuteBufferImpl_QueryInterface
,
IDirect3DExecuteBufferImpl_AddRef
,
IDirect3DExecuteBufferImpl_AddRef
,
...
@@ -838,3 +838,38 @@ const IDirect3DExecuteBufferVtbl IDirect3DExecuteBuffer_Vtbl =
...
@@ -838,3 +838,38 @@ const IDirect3DExecuteBufferVtbl IDirect3DExecuteBuffer_Vtbl =
IDirect3DExecuteBufferImpl_Validate
,
IDirect3DExecuteBufferImpl_Validate
,
IDirect3DExecuteBufferImpl_Optimize
,
IDirect3DExecuteBufferImpl_Optimize
,
};
};
HRESULT
d3d_execute_buffer_init
(
IDirect3DExecuteBufferImpl
*
execute_buffer
,
IDirect3DDeviceImpl
*
device
,
D3DEXECUTEBUFFERDESC
*
desc
)
{
execute_buffer
->
lpVtbl
=
&
d3d_execute_buffer_vtbl
;
execute_buffer
->
ref
=
1
;
execute_buffer
->
d3ddev
=
device
;
/* Initializes memory */
memcpy
(
&
execute_buffer
->
desc
,
desc
,
desc
->
dwSize
);
/* No buffer given */
if
(
!
(
execute_buffer
->
desc
.
dwFlags
&
D3DDEB_LPDATA
))
execute_buffer
->
desc
.
lpData
=
NULL
;
/* No buffer size given */
if
(
!
(
execute_buffer
->
desc
.
dwFlags
&
D3DDEB_BUFSIZE
))
execute_buffer
->
desc
.
dwBufferSize
=
0
;
/* Create buffer if asked */
if
(
!
execute_buffer
->
desc
.
lpData
&&
execute_buffer
->
desc
.
dwBufferSize
)
{
execute_buffer
->
need_free
=
TRUE
;
execute_buffer
->
desc
.
lpData
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
execute_buffer
->
desc
.
dwBufferSize
);
if
(
!
execute_buffer
->
desc
.
lpData
)
{
ERR
(
"Failed to allocate execute buffer data.
\n
"
);
return
DDERR_OUTOFMEMORY
;
}
}
execute_buffer
->
desc
.
dwFlags
|=
D3DDEB_LPDATA
;
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