summaryrefslogtreecommitdiff
path: root/src/video
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2014-04-27 12:15:14 +0000
committerfrosch <frosch@openttd.org>2014-04-27 12:15:14 +0000
commit631e8b45fd7bbd95766ee294304fad38dda946dc (patch)
tree67a68a8e68f7c7f05dd17d86071391e4fb778a37 /src/video
parent77889ab8e80653cb09cfc25b1d918b3562f1eab9 (diff)
downloadopenttd-631e8b45fd7bbd95766ee294304fad38dda946dc.tar.xz
(svn r26522) -Add: A config-file-only setting to disable usage of 8bpp video modes.
-Remove: [win32] fullscreen_bpp setting, which is replaced by above setting. -Change: Disable usage of 8bpp blitters and video modes by default. Many modern OS and hardware cause issues with those.
Diffstat (limited to 'src/video')
-rw-r--r--src/video/sdl_v.cpp2
-rw-r--r--src/video/win32_v.cpp16
2 files changed, 9 insertions, 9 deletions
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index 9b1dd727f..d34f5e6db 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -317,7 +317,7 @@ bool VideoDriver_SDL::CreateMainSurface(uint w, uint h)
* (which we can't force in 8bpp on 8bpp mode,
* unfortunately).
*/
- want_hwpalette = (bpp == 8 && _fullscreen);
+ want_hwpalette = bpp == 8 && _fullscreen && _support8bpp == S8BPP_HARDWARE;
} else {
/* User specified a value manually */
want_hwpalette = _use_hwpalette;
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 989a2f1a2..3774f3c0f 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -52,7 +52,6 @@ static struct {
bool _force_full_redraw;
bool _window_maximize;
uint _display_hz;
-uint _fullscreen_bpp;
static Dimension _bck_resolution;
#if !defined(WINCE) || _WIN32_WCE >= 0x400
DWORD _imm_props;
@@ -272,23 +271,21 @@ bool VideoDriver_Win32::MakeWindow(bool full_screen)
if (full_screen) {
DEVMODE settings;
- /* Make sure we are always at least the screen-depth of the blitter */
- if (_fullscreen_bpp < BlitterFactory::GetCurrentBlitter()->GetScreenDepth()) _fullscreen_bpp = BlitterFactory::GetCurrentBlitter()->GetScreenDepth();
-
memset(&settings, 0, sizeof(settings));
settings.dmSize = sizeof(settings);
settings.dmFields =
- (_fullscreen_bpp != 0 ? DM_BITSPERPEL : 0) |
+ DM_BITSPERPEL |
DM_PELSWIDTH |
DM_PELSHEIGHT |
(_display_hz != 0 ? DM_DISPLAYFREQUENCY : 0);
- settings.dmBitsPerPel = _fullscreen_bpp;
+ settings.dmBitsPerPel = BlitterFactory::GetCurrentBlitter()->GetScreenDepth();
settings.dmPelsWidth = _wnd.width_org;
settings.dmPelsHeight = _wnd.height_org;
settings.dmDisplayFrequency = _display_hz;
/* Check for 8 bpp support. */
- if (settings.dmBitsPerPel != 32 && ChangeDisplaySettings(&settings, CDS_FULLSCREEN | CDS_TEST) != DISP_CHANGE_SUCCESSFUL) {
+ if (settings.dmBitsPerPel == 8 &&
+ (_support8bpp != S8BPP_HARDWARE || ChangeDisplaySettings(&settings, CDS_FULLSCREEN | CDS_TEST) != DISP_CHANGE_SUCCESSFUL)) {
settings.dmBitsPerPel = 32;
}
@@ -1107,11 +1104,14 @@ static void FindResolutions()
uint i;
DEVMODEA dm;
+ /* Check modes for the relevant fullscreen bpp */
+ int bpp = _support8bpp != S8BPP_HARDWARE ? 32 : BlitterFactory::GetCurrentBlitter()->GetScreenDepth();
+
/* XXX - EnumDisplaySettingsW crashes with unicows.dll on Windows95
* Doesn't really matter since we don't pass a string anyways, but still
* a letdown */
for (i = 0; EnumDisplaySettingsA(NULL, i, &dm) != 0; i++) {
- if (dm.dmBitsPerPel == BlitterFactory::GetCurrentBlitter()->GetScreenDepth() &&
+ if (dm.dmBitsPerPel == bpp &&
dm.dmPelsWidth >= 640 && dm.dmPelsHeight >= 480) {
uint j;