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
bd6a8870
Commit
bd6a8870
authored
Oct 29, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 30, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Initialize the matrix stack in D3DXCreateMatrixStack().
Based on a patchset by David Adam.
parent
3eac8afb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
d3dx8_private.h
dlls/d3dx8/d3dx8_private.h
+2
-1
math.c
dlls/d3dx8/math.c
+23
-1
No files found.
dlls/d3dx8/d3dx8_private.h
View file @
bd6a8870
...
...
@@ -86,7 +86,8 @@ struct ID3DXMatrixStackImpl
LONG
ref
;
/* ID3DXMatrixStack fields */
int
current
;
unsigned
int
current
;
unsigned
int
stack_size
;
D3DXMATRIX
*
stack
;
};
...
...
dlls/d3dx8/math.c
View file @
bd6a8870
...
...
@@ -581,10 +581,14 @@ D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm)
/*_________________D3DXMatrixStack____________________*/
static
const
unsigned
int
INITIAL_STACK_SIZE
=
32
;
HRESULT
WINAPI
D3DXCreateMatrixStack
(
DWORD
flags
,
LPD3DXMATRIXSTACK
*
ppstack
)
{
ID3DXMatrixStackImpl
*
object
;
TRACE
(
"flags %#x, ppstack %p
\n
"
,
flags
,
ppstack
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
ID3DXMatrixStackImpl
));
if
(
object
==
NULL
)
{
...
...
@@ -593,7 +597,21 @@ HRESULT WINAPI D3DXCreateMatrixStack(DWORD flags, LPD3DXMATRIXSTACK* ppstack)
}
object
->
lpVtbl
=
&
ID3DXMatrixStack_Vtbl
;
object
->
ref
=
1
;
object
->
stack
=
HeapAlloc
(
GetProcessHeap
(),
0
,
INITIAL_STACK_SIZE
*
sizeof
(
D3DXMATRIX
));
if
(
!
object
->
stack
)
{
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
ppstack
=
NULL
;
return
E_OUTOFMEMORY
;
}
object
->
current
=
0
;
object
->
stack_size
=
INITIAL_STACK_SIZE
;
D3DXMatrixIdentity
(
&
object
->
stack
[
0
]);
TRACE
(
"Created matrix stack %p
\n
"
,
object
);
*
ppstack
=
(
LPD3DXMATRIXSTACK
)
object
;
return
D3D_OK
;
}
...
...
@@ -624,7 +642,11 @@ static ULONG WINAPI ID3DXMatrixStackImpl_Release(ID3DXMatrixStack* iface)
{
ID3DXMatrixStackImpl
*
This
=
(
ID3DXMatrixStackImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
stack
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
TRACE
(
"(%p) : ReleaseRef to %d
\n
"
,
This
,
ref
);
return
ref
;
}
...
...
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