Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6c9f813c
Commit
6c9f813c
authored
Sep 16, 2003
by
Alex Pasadyn
Committed by
Alexandre Julliard
Sep 16, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable resolution changes for older D3D/DDraw applications.
parent
ad22804e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
37 deletions
+16
-37
user.c
dlls/ddraw/ddraw/user.c
+16
-37
No files found.
dlls/ddraw/ddraw/user.c
View file @
6c9f813c
...
...
@@ -28,6 +28,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "ddraw.h"
#include "ddraw_private.h"
#include "ddraw/main.h"
...
...
@@ -98,10 +99,6 @@ static BOOL
IsValidDisplayMode
(
DWORD
dwWidth
,
DWORD
dwHeight
,
DWORD
dwBPP
,
DWORD
dwRefreshRate
,
DWORD
dwFlags
)
{
if
(
dwWidth
>
GetSystemMetrics
(
SM_CXSCREEN
)
||
dwHeight
>
GetSystemMetrics
(
SM_CYSCREEN
))
return
FALSE
;
switch
(
dwBPP
)
{
case
8
:
...
...
@@ -303,11 +300,7 @@ User_DirectDraw_create_backbuffer(IDirectDrawImpl* This,
/* DuplicateSurface: generic */
/* Derived from Xlib_IDirectDraw2Impl_EnumDisplayModes.
* Very fake: just enumerate some arbitrary modes.
*
* The screen sizes are plausible-looking screen sizes and will be limited
* by (virtual) screen size.
/* Originally derived from Xlib_IDirectDraw2Impl_EnumDisplayModes.
*
* The depths are whatever DIBsections support on the client side.
* Should they be limited by screen depth?
...
...
@@ -317,34 +310,16 @@ User_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags,
LPDDSURFACEDESC2
pDDSD
,
LPVOID
context
,
LPDDENUMMODESCALLBACK2
callback
)
{
struct
mode
{
int
width
;
int
height
;
};
static
const
struct
mode
modes
[]
=
{
{
512
,
384
},
{
640
,
400
},
{
640
,
480
},
{
800
,
600
},
{
1024
,
768
},
{
1152
,
864
},
{
1280
,
1024
},
{
1600
,
1200
}
};
static
const
int
num_modes
=
sizeof
(
modes
)
/
sizeof
(
modes
[
0
]);
static
const
int
num_pixelformats
=
sizeof
(
pixelformats
)
/
sizeof
(
pixelformats
[
0
]);
DDSURFACEDESC2
callback_sd
;
DEVMODEW
DevModeW
;
int
max_width
,
max_height
;
int
i
,
j
;
TRACE
(
"(%p)->(0x%08lx,%p,%p,%p)
\n
"
,
iface
,
dwFlags
,
pDDSD
,
context
,
callback
);
/* Unfortunately this is the virtual screen size, not physical. */
max_width
=
GetSystemMetrics
(
SM_CXSCREEN
);
max_height
=
GetSystemMetrics
(
SM_CYSCREEN
);
ZeroMemory
(
&
callback_sd
,
sizeof
(
callback_sd
));
callback_sd
.
dwSize
=
sizeof
(
callback_sd
);
...
...
@@ -356,19 +331,17 @@ User_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags,
callback_sd
.
u2
.
dwRefreshRate
=
60
.
0
;
for
(
i
=
0
;
i
<
num_modes
;
i
++
)
i
=
0
;
while
(
EnumDisplaySettingsExW
(
NULL
,
i
,
&
DevModeW
,
0
))
{
if
(
modes
[
i
].
width
>
max_width
||
modes
[
i
].
height
>
max_height
)
continue
;
callback_sd
.
dwHeight
=
modes
[
i
].
height
;
callback_sd
.
dwWidth
=
modes
[
i
].
width
;
callback_sd
.
dwHeight
=
DevModeW
.
dmPelsHeight
;
callback_sd
.
dwWidth
=
DevModeW
.
dmPelsWidth
;
TRACE
(
"- mode: %ldx%ld
\n
"
,
callback_sd
.
dwWidth
,
callback_sd
.
dwHeight
);
for
(
j
=
0
;
j
<
num_pixelformats
;
j
++
)
{
callback_sd
.
u1
.
lPitch
=
DDRAW_width_bpp_to_pitch
(
modes
[
i
].
w
idth
,
=
DDRAW_width_bpp_to_pitch
(
DevModeW
.
dmPelsW
idth
,
pixelformats
[
j
].
u1
.
dwRGBBitCount
);
callback_sd
.
u4
.
ddpfPixelFormat
=
pixelformats
[
j
];
...
...
@@ -390,6 +363,7 @@ User_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags,
if
(
callback
(
&
callback_sd
,
context
)
==
DDENUMRET_CANCEL
)
return
DD_OK
;
}
i
++
;
}
return
DD_OK
;
...
...
@@ -550,10 +524,16 @@ User_DirectDraw_SetDisplayMode(LPDIRECTDRAW7 iface, DWORD dwWidth,
ICOM_THIS
(
IDirectDrawImpl
,
iface
);
const
DDPIXELFORMAT
*
pixelformat
;
DEVMODEW
devmode
;
LONG
pitch
;
TRACE
(
"(%p)->(%ldx%ldx%ld,%ld Hz,%08lx)
\n
"
,
This
,
dwWidth
,
dwHeight
,
dwBPP
,
dwRefreshRate
,
dwFlags
);
if
(
!
IsValidDisplayMode
(
dwWidth
,
dwHeight
,
dwBPP
,
dwRefreshRate
,
dwFlags
))
devmode
.
dmFields
=
/* DM_BITSPERPEL | */
DM_PELSWIDTH
|
DM_PELSHEIGHT
;
FIXME
(
"Ignoring requested BPP (%ld)
\n
"
,
dwBPP
);
devmode
.
dmBitsPerPel
=
dwBPP
;
devmode
.
dmPelsWidth
=
dwWidth
;
devmode
.
dmPelsHeight
=
dwHeight
;
if
(
ChangeDisplaySettingsExW
(
NULL
,
&
devmode
,
NULL
,
CDS_FULLSCREEN
,
NULL
)
!=
DISP_CHANGE_SUCCESSFUL
)
return
DDERR_INVALIDMODE
;
pixelformat
=
pixelformat_for_depth
(
dwBPP
);
...
...
@@ -564,7 +544,6 @@ User_DirectDraw_SetDisplayMode(LPDIRECTDRAW7 iface, DWORD dwWidth,
}
pitch
=
DDRAW_width_bpp_to_pitch
(
dwWidth
,
dwBPP
);
return
Main_DirectDraw_SetDisplayMode
(
iface
,
dwWidth
,
dwHeight
,
pitch
,
dwRefreshRate
,
dwFlags
,
pixelformat
);
}
...
...
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