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
a7f4ac28
Commit
a7f4ac28
authored
Jan 15, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Get rid of the local "window" variable in ddraw7_SetCooperativeLevel().
Having both a "hwnd" and a "window" here doesn't exactly make things much easier to follow.
parent
292522c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
ddraw.c
dlls/ddraw/ddraw.c
+15
-19
No files found.
dlls/ddraw/ddraw.c
View file @
a7f4ac28
...
...
@@ -696,23 +696,19 @@ static HRESULT ddraw_create_swapchain(struct ddraw *ddraw, HWND window, BOOL win
* (Probably others too, have to investigate)
*
*****************************************************************************/
static
HRESULT
WINAPI
ddraw7_SetCooperativeLevel
(
IDirectDraw7
*
iface
,
HWND
hwnd
,
DWORD
cooplevel
)
static
HRESULT
WINAPI
ddraw7_SetCooperativeLevel
(
IDirectDraw7
*
iface
,
HWND
window
,
DWORD
cooplevel
)
{
struct
ddraw
*
This
=
impl_from_IDirectDraw7
(
iface
);
struct
wined3d_surface
*
rt
=
NULL
,
*
ds
=
NULL
;
struct
wined3d_stateblock
*
stateblock
;
BOOL
restore_state
=
FALSE
;
HWND
window
;
HRESULT
hr
;
TRACE
(
"iface %p, window %p, flags %#x.
\n
"
,
iface
,
hwnd
,
cooplevel
);
TRACE
(
"iface %p, window %p, flags %#x.
\n
"
,
iface
,
window
,
cooplevel
);
DDRAW_dump_cooperativelevel
(
cooplevel
);
wined3d_mutex_lock
();
/* Get the old window */
window
=
This
->
dest_window
;
/* Tests suggest that we need one of them: */
if
(
!
(
cooplevel
&
(
DDSCL_SETFOCUSWINDOW
|
DDSCL_NORMAL
|
...
...
@@ -749,14 +745,14 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
return
DDERR_INVALIDPARAMS
;
}
hr
=
ddraw_set_focus_window
(
This
,
hwnd
);
hr
=
ddraw_set_focus_window
(
This
,
window
);
wined3d_mutex_unlock
();
return
hr
;
}
if
(
cooplevel
&
DDSCL_EXCLUSIVE
)
{
if
(
!
(
cooplevel
&
DDSCL_FULLSCREEN
)
||
!
(
hwnd
||
(
cooplevel
&
DDSCL_CREATEDEVICEWINDOW
)))
if
(
!
(
cooplevel
&
DDSCL_FULLSCREEN
)
||
!
(
window
||
(
cooplevel
&
DDSCL_CREATEDEVICEWINDOW
)))
{
WARN
(
"DDSCL_EXCLUSIVE requires DDSCL_FULLSCREEN and a window.
\n
"
);
wined3d_mutex_unlock
();
...
...
@@ -794,20 +790,20 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
if
(
cooplevel
&
DDSCL_SETFOCUSWINDOW
)
{
if
(
!
hwnd
)
if
(
!
window
)
{
wined3d_mutex_unlock
();
return
DDERR_NOHWND
;
}
if
(
FAILED
(
hr
=
ddraw_set_focus_window
(
This
,
hwnd
)))
if
(
FAILED
(
hr
=
ddraw_set_focus_window
(
This
,
window
)))
{
wined3d_mutex_unlock
();
return
hr
;
}
}
hwnd
=
device_window
;
window
=
device_window
;
}
}
else
...
...
@@ -819,28 +815,28 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
}
if
((
This
->
cooperative_level
&
DDSCL_EXCLUSIVE
)
&&
(
hwnd
!=
window
||
!
(
cooplevel
&
DDSCL_EXCLUSIVE
)))
&&
(
window
!=
This
->
dest_
window
||
!
(
cooplevel
&
DDSCL_EXCLUSIVE
)))
wined3d_device_release_focus_window
(
This
->
wined3d_device
);
if
((
cooplevel
&
DDSCL_FULLSCREEN
)
!=
(
This
->
cooperative_level
&
DDSCL_FULLSCREEN
)
||
hwnd
!=
window
)
if
((
cooplevel
&
DDSCL_FULLSCREEN
)
!=
(
This
->
cooperative_level
&
DDSCL_FULLSCREEN
)
||
window
!=
This
->
dest_
window
)
{
if
(
This
->
cooperative_level
&
DDSCL_FULLSCREEN
)
wined3d_device_restore_fullscreen_window
(
This
->
wined3d_device
,
window
);
wined3d_device_restore_fullscreen_window
(
This
->
wined3d_device
,
This
->
dest_
window
);
if
(
cooplevel
&
DDSCL_FULLSCREEN
)
{
struct
wined3d_display_mode
display_mode
;
wined3d_get_adapter_display_mode
(
This
->
wined3d
,
WINED3DADAPTER_DEFAULT
,
&
display_mode
,
NULL
);
wined3d_device_setup_fullscreen_window
(
This
->
wined3d_device
,
hwnd
,
wined3d_device_setup_fullscreen_window
(
This
->
wined3d_device
,
window
,
display_mode
.
width
,
display_mode
.
height
);
}
}
if
((
cooplevel
&
DDSCL_EXCLUSIVE
)
&&
(
hwnd
!=
window
||
!
(
This
->
cooperative_level
&
DDSCL_EXCLUSIVE
)))
&&
(
window
!=
This
->
dest_
window
||
!
(
This
->
cooperative_level
&
DDSCL_EXCLUSIVE
)))
{
hr
=
wined3d_device_acquire_focus_window
(
This
->
wined3d_device
,
hwnd
);
hr
=
wined3d_device_acquire_focus_window
(
This
->
wined3d_device
,
window
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to acquire focus window, hr %#x.
\n
"
,
hr
);
...
...
@@ -879,7 +875,7 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
ddraw_destroy_swapchain
(
This
);
}
if
(
FAILED
(
hr
=
ddraw_create_swapchain
(
This
,
hwnd
,
!
(
cooplevel
&
DDSCL_FULLSCREEN
))))
if
(
FAILED
(
hr
=
ddraw_create_swapchain
(
This
,
window
,
!
(
cooplevel
&
DDSCL_FULLSCREEN
))))
ERR
(
"Failed to create swapchain, hr %#x.
\n
"
,
hr
);
if
(
restore_state
)
...
...
@@ -915,7 +911,7 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
/* Store the cooperative_level */
This
->
cooperative_level
=
cooplevel
;
This
->
dest_window
=
hwnd
;
This
->
dest_window
=
window
;
TRACE
(
"SetCooperativeLevel retuning DD_OK
\n
"
);
wined3d_mutex_unlock
();
...
...
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