From d53ec3d1b662f5bfaffae3f6f1f7498cad954679 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 4 Feb 2010 14:32:12 +0000 Subject: [PATCH] (svn r19003) -Fix [FS#3194]: [OSX] OS X 10.5+ does not (always?) handle 8bpp graphics in a suitable manner. This is actually not a fix but a nasty work around; you can still easily trigger the bug/issue by overriding the 'default' blitter choice (Brad Oliver). I can/have not test(ed) (including compiling) this fix. Bjarni once suggested that 8bpp works for him on 10.5, so apparantly not all 10.5+ does not handle 8bpp graphics. Nevertheless, it seemed that for some systems the already existing 'does this support 8bpp' did not work, i.e. the OS API seemed to suggest that 8bpp worked when it actually did not. So, I don't know what is going on precisely here but it's definitely not nice to suggest that it supports 8bpp when it doesn't. So just ditch 8bpp support for anything that we suspect might not support 8bpp... --- src/video/cocoa/fullscreen.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/video/cocoa/fullscreen.mm b/src/video/cocoa/fullscreen.mm index 631ef09d41..59e5c5408a 100644 --- a/src/video/cocoa/fullscreen.mm +++ b/src/video/cocoa/fullscreen.mm @@ -28,6 +28,7 @@ #include "../../core/sort_func.hpp" #include "cocoa_v.h" #include "../../gfx_func.h" +#include "macos.h" /** * Important notice regarding all modifications!!!!!!! @@ -134,6 +135,11 @@ uint QZ_ListModes(OTTD_Point *modes, uint max_modes, CGDirectDisplayID display_i /** Small function to test if the main display can display 8 bpp in fullscreen */ bool QZ_CanDisplay8bpp() { + /* 8bpp modes are deprecated starting in 10.5. CoreGraphics will return them + * as available in the display list, but many features (e.g. palette animation) + * will be broken. */ + if (MacOSVersionIsAtLeast(10, 5, 0)) return false; + OTTD_Point p; /* We want to know if 8 bpp is possible in fullscreen and not anything about