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
a03c939a
Commit
a03c939a
authored
Oct 14, 2003
by
Christian Costa
Committed by
Alexandre Julliard
Oct 14, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add necessary AddRef/Release stuff to {Set/Get}CurrentViewport.
When changing parameters of a viewport, do the appropriate update if it is current.
parent
bd7bdbce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
main.c
dlls/ddraw/d3ddevice/main.c
+14
-1
d3dviewport.c
dlls/ddraw/d3dviewport.c
+18
-1
No files found.
dlls/ddraw/d3ddevice/main.c
View file @
a03c939a
...
@@ -1100,15 +1100,24 @@ Main_IDirect3DDeviceImpl_3_2T_SetCurrentViewport(LPDIRECT3DDEVICE3 iface,
...
@@ -1100,15 +1100,24 @@ Main_IDirect3DDeviceImpl_3_2T_SetCurrentViewport(LPDIRECT3DDEVICE3 iface,
ICOM_THIS_FROM
(
IDirect3DDeviceImpl
,
IDirect3DDevice3
,
iface
);
ICOM_THIS_FROM
(
IDirect3DDeviceImpl
,
IDirect3DDevice3
,
iface
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
lpDirect3DViewport3
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
lpDirect3DViewport3
);
/* Do nothing if the specified viewport is the same as the current one */
if
(
This
->
current_viewport
==
ICOM_OBJECT
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
lpDirect3DViewport3
))
return
DD_OK
;
/* Should check if the viewport was added or not */
/* Should check if the viewport was added or not */
/* Release previous viewport and AddRef the new one */
if
(
This
->
current_viewport
)
IDirect3DViewport3_Release
(
ICOM_INTERFACE
(
This
->
current_viewport
,
IDirect3DViewport3
));
IDirect3DViewport3_AddRef
(
lpDirect3DViewport3
);
/* Set this viewport as the current viewport */
/* Set this viewport as the current viewport */
This
->
current_viewport
=
ICOM_OBJECT
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
lpDirect3DViewport3
);
This
->
current_viewport
=
ICOM_OBJECT
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
lpDirect3DViewport3
);
/* Activate this viewport */
/* Activate this viewport */
This
->
current_viewport
->
active_device
=
This
;
This
->
current_viewport
->
active_device
=
This
;
This
->
current_viewport
->
activate
(
This
->
current_viewport
);
This
->
current_viewport
->
activate
(
This
->
current_viewport
);
return
DD_OK
;
return
DD_OK
;
}
}
...
@@ -1120,6 +1129,10 @@ Main_IDirect3DDeviceImpl_3_2T_GetCurrentViewport(LPDIRECT3DDEVICE3 iface,
...
@@ -1120,6 +1129,10 @@ Main_IDirect3DDeviceImpl_3_2T_GetCurrentViewport(LPDIRECT3DDEVICE3 iface,
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
lplpDirect3DViewport3
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
lplpDirect3DViewport3
);
*
lplpDirect3DViewport3
=
ICOM_INTERFACE
(
This
->
current_viewport
,
IDirect3DViewport3
);
*
lplpDirect3DViewport3
=
ICOM_INTERFACE
(
This
->
current_viewport
,
IDirect3DViewport3
);
/* AddRef the returned viewport */
IDirect3DViewport3_AddRef
(
*
lplpDirect3DViewport3
);
TRACE
(
" returning interface %p
\n
"
,
*
lplpDirect3DViewport3
);
TRACE
(
" returning interface %p
\n
"
,
*
lplpDirect3DViewport3
);
return
DD_OK
;
return
DD_OK
;
...
...
dlls/ddraw/d3dviewport.c
View file @
a03c939a
...
@@ -180,6 +180,7 @@ Main_IDirect3DViewportImpl_3_2_1_SetViewport(LPDIRECT3DVIEWPORT3 iface,
...
@@ -180,6 +180,7 @@ Main_IDirect3DViewportImpl_3_2_1_SetViewport(LPDIRECT3DVIEWPORT3 iface,
LPD3DVIEWPORT
lpData
)
LPD3DVIEWPORT
lpData
)
{
{
ICOM_THIS_FROM
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
iface
);
ICOM_THIS_FROM
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
iface
);
LPDIRECT3DVIEWPORT3
current_viewport
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
lpData
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
lpData
);
if
(
TRACE_ON
(
ddraw
))
{
if
(
TRACE_ON
(
ddraw
))
{
...
@@ -196,7 +197,14 @@ Main_IDirect3DViewportImpl_3_2_1_SetViewport(LPDIRECT3DVIEWPORT3 iface,
...
@@ -196,7 +197,14 @@ Main_IDirect3DViewportImpl_3_2_1_SetViewport(LPDIRECT3DVIEWPORT3 iface,
*/
*/
This
->
viewports
.
vp1
.
dvMinZ
=
0
.
0
;
This
->
viewports
.
vp1
.
dvMinZ
=
0
.
0
;
This
->
viewports
.
vp1
.
dvMaxZ
=
1
.
0
;
This
->
viewports
.
vp1
.
dvMaxZ
=
1
.
0
;
if
(
This
->
active_device
)
{
IDirect3DDevice3_GetCurrentViewport
(
ICOM_INTERFACE
(
This
->
active_device
,
IDirect3DDevice3
),
&
current_viewport
);
if
(
ICOM_OBJECT
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
current_viewport
)
==
This
)
This
->
activate
(
This
);
IDirect3DViewport3_Release
(
current_viewport
);
}
return
DD_OK
;
return
DD_OK
;
}
}
...
@@ -402,6 +410,7 @@ Main_IDirect3DViewportImpl_3_2_SetViewport2(LPDIRECT3DVIEWPORT3 iface,
...
@@ -402,6 +410,7 @@ Main_IDirect3DViewportImpl_3_2_SetViewport2(LPDIRECT3DVIEWPORT3 iface,
LPD3DVIEWPORT2
lpData
)
LPD3DVIEWPORT2
lpData
)
{
{
ICOM_THIS_FROM
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
iface
);
ICOM_THIS_FROM
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
iface
);
LPDIRECT3DVIEWPORT3
current_viewport
;
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
lpData
);
TRACE
(
"(%p/%p)->(%p)
\n
"
,
This
,
iface
,
lpData
);
if
(
TRACE_ON
(
ddraw
))
{
if
(
TRACE_ON
(
ddraw
))
{
...
@@ -412,6 +421,14 @@ Main_IDirect3DViewportImpl_3_2_SetViewport2(LPDIRECT3DVIEWPORT3 iface,
...
@@ -412,6 +421,14 @@ Main_IDirect3DViewportImpl_3_2_SetViewport2(LPDIRECT3DVIEWPORT3 iface,
This
->
use_vp2
=
1
;
This
->
use_vp2
=
1
;
memset
(
&
(
This
->
viewports
.
vp2
),
0
,
sizeof
(
This
->
viewports
.
vp2
));
memset
(
&
(
This
->
viewports
.
vp2
),
0
,
sizeof
(
This
->
viewports
.
vp2
));
memcpy
(
&
(
This
->
viewports
.
vp2
),
lpData
,
lpData
->
dwSize
);
memcpy
(
&
(
This
->
viewports
.
vp2
),
lpData
,
lpData
->
dwSize
);
if
(
This
->
active_device
)
{
IDirect3DDevice3_GetCurrentViewport
(
ICOM_INTERFACE
(
This
->
active_device
,
IDirect3DDevice3
),
&
current_viewport
);
if
(
ICOM_OBJECT
(
IDirect3DViewportImpl
,
IDirect3DViewport3
,
current_viewport
)
==
This
)
This
->
activate
(
This
);
IDirect3DViewport3_Release
(
current_viewport
);
}
return
DD_OK
;
return
DD_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