summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2020-06-01 19:26:23 +0200
committerNiels Martin Hansen <nielsm@indvikleren.dk>2020-06-01 19:43:37 +0200
commit764497206ab9457ab5dff3ea7851546da9259cc4 (patch)
tree379cdad0bce3951a3561d49069797e87a369f491 /src
parentb3ddf2c9072b0dc0a81943acad9d97e5977ccd5e (diff)
downloadopenttd-764497206ab9457ab5dff3ea7851546da9259cc4.tar.xz
Fix #8066: Try another fallback colourspace if first one fails
Diffstat (limited to 'src')
-rw-r--r--src/video/cocoa/wnd_quartz.mm2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/video/cocoa/wnd_quartz.mm b/src/video/cocoa/wnd_quartz.mm
index 8549100d9..edc9c5008 100644
--- a/src/video/cocoa/wnd_quartz.mm
+++ b/src/video/cocoa/wnd_quartz.mm
@@ -318,6 +318,8 @@ bool WindowQuartzSubdriver::SetVideoMode(int width, int height, int bpp)
[this->window setColorSpace:[NSColorSpace sRGBColorSpace]];
this->color_space = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
+ if (this->color_space == nullptr) this->color_space = CGColorSpaceCreateDeviceRGB();
+ if (this->color_space == nullptr) error("Could not get a valid colour space for drawing.");
bool ret = WindowResized();
this->UpdatePalette(0, 256);