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
22abfd6e
Commit
22abfd6e
authored
Mar 30, 2011
by
Rico Schüller
Committed by
Alexandre Julliard
Mar 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Use init function for ID3DXBuffer.
parent
87f6f86c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
9 deletions
+27
-9
core.c
dlls/d3dx9_36/core.c
+27
-9
No files found.
dlls/d3dx9_36/core.c
View file @
22abfd6e
...
@@ -116,27 +116,45 @@ static const struct ID3DXBufferVtbl ID3DXBufferImpl_Vtbl =
...
@@ -116,27 +116,45 @@ static const struct ID3DXBufferVtbl ID3DXBufferImpl_Vtbl =
ID3DXBufferImpl_GetBufferSize
ID3DXBufferImpl_GetBufferSize
};
};
static
HRESULT
d3dx9_buffer_init
(
struct
ID3DXBufferImpl
*
buffer
,
DWORD
size
)
{
buffer
->
ID3DXBuffer_iface
.
lpVtbl
=
&
ID3DXBufferImpl_Vtbl
;
buffer
->
ref
=
1
;
buffer
->
size
=
size
;
buffer
->
buffer
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
(
!
buffer
->
buffer
)
{
ERR
(
"Failed to allocate buffer memory
\n
"
);
return
E_OUTOFMEMORY
;
}
return
D3D_OK
;
}
HRESULT
WINAPI
D3DXCreateBuffer
(
DWORD
size
,
LPD3DXBUFFER
*
buffer
)
HRESULT
WINAPI
D3DXCreateBuffer
(
DWORD
size
,
LPD3DXBUFFER
*
buffer
)
{
{
struct
ID3DXBufferImpl
*
object
;
struct
ID3DXBufferImpl
*
object
;
HRESULT
hr
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
object
==
NULL
)
if
(
!
object
)
{
{
*
buffer
=
NULL
;
ERR
(
"Failed to allocate buffer memory
\n
"
)
;
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
object
->
ID3DXBuffer_iface
.
lpVtbl
=
&
ID3DXBufferImpl_Vtbl
;
object
->
ref
=
1
;
hr
=
d3dx9_buffer_init
(
object
,
size
);
object
->
size
=
size
;
if
(
FAILED
(
hr
))
object
->
buffer
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
(
object
->
buffer
==
NULL
)
{
{
WARN
(
"Failed to initialize buffer, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
buffer
=
NULL
;
return
hr
;
return
E_OUTOFMEMORY
;
}
}
*
buffer
=
&
object
->
ID3DXBuffer_iface
;
*
buffer
=
&
object
->
ID3DXBuffer_iface
;
TRACE
(
"Created ID3DBuffer %p
\n
"
,
*
buffer
);
return
D3D_OK
;
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