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
4e81f661
Commit
4e81f661
authored
Mar 19, 2024
by
Paul Gofman
Committed by
Alexandre Julliard
Mar 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Store matrix handle in the global table.
parent
5a7ff3b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
19 deletions
+12
-19
device.c
dlls/ddraw/device.c
+4
-15
executebuffer.c
dlls/ddraw/executebuffer.c
+4
-4
main.c
dlls/ddraw/main.c
+4
-0
No files found.
dlls/ddraw/device.c
View file @
4e81f661
...
...
@@ -303,14 +303,6 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface)
case
DDRAW_HANDLE_FREE
:
break
;
case
DDRAW_HANDLE_MATRIX
:
{
/* No FIXME here because this might happen because of sloppy applications. */
WARN
(
"Leftover matrix handle %#lx (%p), deleting.
\n
"
,
i
+
1
,
entry
->
object
);
IDirect3DDevice_DeleteMatrix
(
&
This
->
IDirect3DDevice_iface
,
i
+
1
);
break
;
}
case
DDRAW_HANDLE_STATEBLOCK
:
{
/* No FIXME here because this might happen because of sloppy applications. */
...
...
@@ -1304,7 +1296,6 @@ static HRESULT WINAPI d3d_device1_EnumTextureFormats(IDirect3DDevice *iface,
*****************************************************************************/
static
HRESULT
WINAPI
d3d_device1_CreateMatrix
(
IDirect3DDevice
*
iface
,
D3DMATRIXHANDLE
*
D3DMatHandle
)
{
struct
d3d_device
*
device
=
impl_from_IDirect3DDevice
(
iface
);
D3DMATRIX
*
matrix
;
DWORD
h
;
...
...
@@ -1321,7 +1312,7 @@ static HRESULT WINAPI d3d_device1_CreateMatrix(IDirect3DDevice *iface, D3DMATRIX
wined3d_mutex_lock
();
h
=
ddraw_allocate_handle
(
&
device
->
handle_table
,
matrix
,
DDRAW_HANDLE_MATRIX
);
h
=
ddraw_allocate_handle
(
NULL
,
matrix
,
DDRAW_HANDLE_MATRIX
);
if
(
h
==
DDRAW_INVALID_HANDLE
)
{
ERR
(
"Failed to allocate a matrix handle.
\n
"
);
...
...
@@ -1370,7 +1361,7 @@ static HRESULT WINAPI d3d_device1_SetMatrix(IDirect3DDevice *iface,
wined3d_mutex_lock
();
m
=
ddraw_get_object
(
&
device
->
handle_table
,
matrix_handle
-
1
,
DDRAW_HANDLE_MATRIX
);
m
=
ddraw_get_object
(
NULL
,
matrix_handle
-
1
,
DDRAW_HANDLE_MATRIX
);
if
(
!
m
)
{
WARN
(
"Invalid matrix handle.
\n
"
);
...
...
@@ -1419,7 +1410,6 @@ static HRESULT WINAPI d3d_device1_SetMatrix(IDirect3DDevice *iface,
static
HRESULT
WINAPI
d3d_device1_GetMatrix
(
IDirect3DDevice
*
iface
,
D3DMATRIXHANDLE
D3DMatHandle
,
D3DMATRIX
*
D3DMatrix
)
{
struct
d3d_device
*
device
=
impl_from_IDirect3DDevice
(
iface
);
D3DMATRIX
*
m
;
TRACE
(
"iface %p, matrix_handle %#lx, matrix %p.
\n
"
,
iface
,
D3DMatHandle
,
D3DMatrix
);
...
...
@@ -1428,7 +1418,7 @@ static HRESULT WINAPI d3d_device1_GetMatrix(IDirect3DDevice *iface,
wined3d_mutex_lock
();
m
=
ddraw_get_object
(
&
device
->
handle_table
,
D3DMatHandle
-
1
,
DDRAW_HANDLE_MATRIX
);
m
=
ddraw_get_object
(
NULL
,
D3DMatHandle
-
1
,
DDRAW_HANDLE_MATRIX
);
if
(
!
m
)
{
WARN
(
"Invalid matrix handle.
\n
"
);
...
...
@@ -1460,14 +1450,13 @@ static HRESULT WINAPI d3d_device1_GetMatrix(IDirect3DDevice *iface,
*****************************************************************************/
static
HRESULT
WINAPI
d3d_device1_DeleteMatrix
(
IDirect3DDevice
*
iface
,
D3DMATRIXHANDLE
D3DMatHandle
)
{
struct
d3d_device
*
device
=
impl_from_IDirect3DDevice
(
iface
);
D3DMATRIX
*
m
;
TRACE
(
"iface %p, matrix_handle %#lx.
\n
"
,
iface
,
D3DMatHandle
);
wined3d_mutex_lock
();
m
=
ddraw_free_handle
(
&
device
->
handle_table
,
D3DMatHandle
-
1
,
DDRAW_HANDLE_MATRIX
);
m
=
ddraw_free_handle
(
NULL
,
D3DMatHandle
-
1
,
DDRAW_HANDLE_MATRIX
);
if
(
!
m
)
{
WARN
(
"Invalid matrix handle.
\n
"
);
...
...
dlls/ddraw/executebuffer.c
View file @
4e81f661
...
...
@@ -209,9 +209,9 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d
D3DMATRIXMULTIPLY
*
ci
=
(
D3DMATRIXMULTIPLY
*
)
instr
;
struct
wined3d_matrix
*
a
,
*
b
,
*
c
;
a
=
ddraw_get_object
(
&
device
->
handle_table
,
ci
->
hDestMatrix
-
1
,
DDRAW_HANDLE_MATRIX
);
b
=
ddraw_get_object
(
&
device
->
handle_table
,
ci
->
hSrcMatrix1
-
1
,
DDRAW_HANDLE_MATRIX
);
c
=
ddraw_get_object
(
&
device
->
handle_table
,
ci
->
hSrcMatrix2
-
1
,
DDRAW_HANDLE_MATRIX
);
a
=
ddraw_get_object
(
NULL
,
ci
->
hDestMatrix
-
1
,
DDRAW_HANDLE_MATRIX
);
b
=
ddraw_get_object
(
NULL
,
ci
->
hSrcMatrix1
-
1
,
DDRAW_HANDLE_MATRIX
);
c
=
ddraw_get_object
(
NULL
,
ci
->
hSrcMatrix2
-
1
,
DDRAW_HANDLE_MATRIX
);
if
(
!
a
||
!
b
||
!
c
)
{
...
...
@@ -235,7 +235,7 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d
D3DSTATE
*
ci
=
(
D3DSTATE
*
)
instr
;
D3DMATRIX
*
m
;
m
=
ddraw_get_object
(
&
device
->
handle_table
,
ci
->
dwArg
[
0
]
-
1
,
DDRAW_HANDLE_MATRIX
);
m
=
ddraw_get_object
(
NULL
,
ci
->
dwArg
[
0
]
-
1
,
DDRAW_HANDLE_MATRIX
);
if
(
!
m
)
{
ERR
(
"Invalid matrix handle %#lx.
\n
"
,
ci
->
dwArg
[
0
]);
...
...
dlls/ddraw/main.c
View file @
4e81f661
...
...
@@ -920,6 +920,10 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved)
WARN
(
"Texture handle %#x (%p) not unset properly.
\n
"
,
i
+
1
,
entry
->
object
);
break
;
case
DDRAW_HANDLE_MATRIX
:
WARN
(
"Leftover matrix handle %#x (%p), deleting.
\n
"
,
i
+
1
,
entry
->
object
);
break
;
default:
WARN
(
"Handle %#x (%p) has unknown type %#x.
\n
"
,
i
+
1
,
entry
->
object
,
entry
->
type
);
break
;
...
...
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