1
1
forked from 0ad/0ad

Attempts to fix crash reported on OS X Mavericks by not calling SDL_SetGamma in that case (this patch was included in the A15 bundles), refs #2272

This was SVN commit r14540.
This commit is contained in:
historic_bruno 2014-01-08 01:29:04 +00:00
parent 0482038af2
commit 7e87211d91

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2013 Wildfire Games.
/* Copyright (C) 2014 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -33,6 +33,11 @@
#include "ps/GameSetup/Config.h"
#include "renderer/Renderer.h"
#if OS_MACOSX
# include "lib/sysdep/os/osx/osx_sys_version.h"
#endif
static int DEFAULT_WINDOW_W = 1024;
static int DEFAULT_WINDOW_H = 768;
@ -278,8 +283,18 @@ bool CVideoMode::InitSDL()
if (SDL_SetWindowGammaRamp(m_Window, ramp, ramp, ramp) < 0)
LOGWARNING(L"SDL_SetGamma failed");
#else
# if OS_MACOSX
// Workaround for crash on Mavericks, see http://trac.wildfiregames.com/ticket/2272
int major, minor, bugfix;
GetSystemVersion(major, minor, bugfix);
if (minor < 9)
{
# endif
if (SDL_SetGamma(g_Gamma, g_Gamma, g_Gamma) < 0)
LOGWARNING(L"SDL_SetGamma failed");
# if OS_MACOSX
}
# endif
#endif
m_IsInitialised = true;