mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
Added color depth check to ChangeDisplaySettingsEx hook
See issue #303.
This commit is contained in:
parent
474fdb1e45
commit
574f4cdd2b
@ -132,6 +132,12 @@ namespace
|
|||||||
SIZE emulatedResolution = {};
|
SIZE emulatedResolution = {};
|
||||||
if (lpDevMode)
|
if (lpDevMode)
|
||||||
{
|
{
|
||||||
|
if ((lpDevMode->dmFields & DM_BITSPERPEL) &&
|
||||||
|
8 != lpDevMode->dmBitsPerPel && 16 != lpDevMode->dmBitsPerPel && 32 != lpDevMode->dmBitsPerPel)
|
||||||
|
{
|
||||||
|
return DISP_CHANGE_BADMODE;
|
||||||
|
}
|
||||||
|
|
||||||
targetDevMode = *lpDevMode;
|
targetDevMode = *lpDevMode;
|
||||||
targetDevMode.dmFields |= DM_BITSPERPEL;
|
targetDevMode.dmFields |= DM_BITSPERPEL;
|
||||||
targetDevMode.dmBitsPerPel = 32;
|
targetDevMode.dmBitsPerPel = 32;
|
||||||
|
@ -51,6 +51,7 @@ namespace
|
|||||||
std::ostream& logDevMode(std::ostream& os, const DevMode& dm)
|
std::ostream& logDevMode(std::ostream& os, const DevMode& dm)
|
||||||
{
|
{
|
||||||
return Compat::LogStruct(os)
|
return Compat::LogStruct(os)
|
||||||
|
<< Compat::hex(dm.dmFields)
|
||||||
<< dm.dmPelsWidth
|
<< dm.dmPelsWidth
|
||||||
<< dm.dmPelsHeight
|
<< dm.dmPelsHeight
|
||||||
<< dm.dmBitsPerPel
|
<< dm.dmBitsPerPel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user