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
9a0b2a51
Commit
9a0b2a51
authored
Jan 26, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: device::GetCurrentViewport returns an error if no viewport is set.
parent
07197a19
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
device.c
dlls/ddraw/device.c
+8
-6
viewport.c
dlls/ddraw/viewport.c
+8
-10
No files found.
dlls/ddraw/device.c
View file @
9a0b2a51
...
@@ -1758,16 +1758,18 @@ static HRESULT WINAPI d3d_device3_GetCurrentViewport(IDirect3DDevice3 *iface, ID
...
@@ -1758,16 +1758,18 @@ static HRESULT WINAPI d3d_device3_GetCurrentViewport(IDirect3DDevice3 *iface, ID
return
DDERR_INVALIDPARAMS
;
return
DDERR_INVALIDPARAMS
;
wined3d_mutex_lock
();
wined3d_mutex_lock
();
*
viewport
=
&
device
->
current_viewport
->
IDirect3DViewport3_iface
;
if
(
!
device
->
current_viewport
)
{
wined3d_mutex_unlock
();
WARN
(
"No current viewport, returning D3DERR_NOCURRENTVIEWPORT
\n
"
);
return
D3DERR_NOCURRENTVIEWPORT
;
}
/* AddRef the returned viewport */
*
viewport
=
&
device
->
current_viewport
->
IDirect3DViewport3_iface
;
if
(
*
viewport
)
IDirect3DViewport3_AddRef
(
*
viewport
);
IDirect3DViewport3_AddRef
(
*
viewport
);
TRACE
(
"Returning interface %p.
\n
"
,
*
viewport
);
TRACE
(
"Returning interface %p.
\n
"
,
*
viewport
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
D3D_OK
;
return
D3D_OK
;
}
}
...
...
dlls/ddraw/viewport.c
View file @
9a0b2a51
...
@@ -342,10 +342,10 @@ static HRESULT WINAPI d3d_viewport_SetViewport(IDirect3DViewport3 *iface, D3DVIE
...
@@ -342,10 +342,10 @@ static HRESULT WINAPI d3d_viewport_SetViewport(IDirect3DViewport3 *iface, D3DVIE
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
)
{
if
(
This
->
active_device
)
{
IDirect3DDevice3
*
d3d_device3
=
&
This
->
active_device
->
IDirect3DDevice3_iface
;
IDirect3DDevice3
*
d3d_device3
=
&
This
->
active_device
->
IDirect3DDevice3_iface
;
IDirect3DDevice3_GetCurrentViewport
(
d3d_device3
,
&
current_viewport
);
if
(
SUCCEEDED
(
IDirect3DDevice3_GetCurrentViewport
(
d3d_device3
,
&
current_viewport
)))
if
(
current_viewport
)
{
{
if
(
current_viewport
==
iface
)
viewport_activate
(
This
,
FALSE
);
if
(
current_viewport
==
iface
)
viewport_activate
(
This
,
FALSE
);
IDirect3DViewport3_Release
(
current_viewport
);
IDirect3DViewport3_Release
(
current_viewport
);
...
@@ -705,8 +705,7 @@ static HRESULT WINAPI d3d_viewport_Clear(IDirect3DViewport3 *iface,
...
@@ -705,8 +705,7 @@ static HRESULT WINAPI d3d_viewport_Clear(IDirect3DViewport3 *iface,
hr
=
IDirect3DDevice7_Clear
(
&
This
->
active_device
->
IDirect3DDevice7_iface
,
rect_count
,
rects
,
hr
=
IDirect3DDevice7_Clear
(
&
This
->
active_device
->
IDirect3DDevice7_iface
,
rect_count
,
rects
,
flags
&
(
D3DCLEAR_ZBUFFER
|
D3DCLEAR_TARGET
),
color
,
1
.
0
,
0x00000000
);
flags
&
(
D3DCLEAR_ZBUFFER
|
D3DCLEAR_TARGET
),
color
,
1
.
0
,
0x00000000
);
IDirect3DDevice3_GetCurrentViewport
(
d3d_device3
,
&
current_viewport
);
if
(
SUCCEEDED
(
IDirect3DDevice3_GetCurrentViewport
(
d3d_device3
,
&
current_viewport
)))
if
(
current_viewport
)
{
{
struct
d3d_viewport
*
vp
=
impl_from_IDirect3DViewport3
(
current_viewport
);
struct
d3d_viewport
*
vp
=
impl_from_IDirect3DViewport3
(
current_viewport
);
viewport_activate
(
vp
,
TRUE
);
viewport_activate
(
vp
,
TRUE
);
...
@@ -979,10 +978,10 @@ static HRESULT WINAPI d3d_viewport_SetViewport2(IDirect3DViewport3 *iface, D3DVI
...
@@ -979,10 +978,10 @@ static HRESULT WINAPI d3d_viewport_SetViewport2(IDirect3DViewport3 *iface, D3DVI
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
)
{
if
(
This
->
active_device
)
{
IDirect3DDevice3
*
d3d_device3
=
&
This
->
active_device
->
IDirect3DDevice3_iface
;
IDirect3DDevice3
*
d3d_device3
=
&
This
->
active_device
->
IDirect3DDevice3_iface
;
IDirect3DDevice3_GetCurrentViewport
(
d3d_device3
,
&
current_viewport
);
if
(
SUCCEEDED
(
IDirect3DDevice3_GetCurrentViewport
(
d3d_device3
,
&
current_viewport
)))
if
(
current_viewport
)
{
{
if
(
current_viewport
==
iface
)
viewport_activate
(
This
,
FALSE
);
if
(
current_viewport
==
iface
)
viewport_activate
(
This
,
FALSE
);
IDirect3DViewport3_Release
(
current_viewport
);
IDirect3DViewport3_Release
(
current_viewport
);
...
@@ -1087,8 +1086,7 @@ static HRESULT WINAPI d3d_viewport_Clear2(IDirect3DViewport3 *iface, DWORD rect_
...
@@ -1087,8 +1086,7 @@ static HRESULT WINAPI d3d_viewport_Clear2(IDirect3DViewport3 *iface, DWORD rect_
hr
=
IDirect3DDevice7_Clear
(
&
viewport
->
active_device
->
IDirect3DDevice7_iface
,
hr
=
IDirect3DDevice7_Clear
(
&
viewport
->
active_device
->
IDirect3DDevice7_iface
,
rect_count
,
rects
,
flags
,
color
,
depth
,
stencil
);
rect_count
,
rects
,
flags
,
color
,
depth
,
stencil
);
IDirect3DDevice3_GetCurrentViewport
(
d3d_device3
,
&
current_viewport
);
if
(
SUCCEEDED
(
IDirect3DDevice3_GetCurrentViewport
(
d3d_device3
,
&
current_viewport
)))
if
(
current_viewport
)
{
{
struct
d3d_viewport
*
vp
=
impl_from_IDirect3DViewport3
(
current_viewport
);
struct
d3d_viewport
*
vp
=
impl_from_IDirect3DViewport3
(
current_viewport
);
viewport_activate
(
vp
,
TRUE
);
viewport_activate
(
vp
,
TRUE
);
...
...
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