diff options
author | truelight <truelight@openttd.org> | 2007-06-12 23:10:47 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-06-12 23:10:47 +0000 |
commit | 2f5c49abc294b249e524bee85fa996b121b34b55 (patch) | |
tree | 909db660aa7ce697edf07e18a0ab7838bfa62c20 /src/video | |
parent | ee4208ffe9769ea4308f39b68c811e1271133caa (diff) | |
download | openttd-2f5c49abc294b249e524bee85fa996b121b34b55.tar.xz |
(svn r10124) -Fix r10123: fix the OSX video driver properly
Diffstat (limited to 'src/video')
-rw-r--r-- | src/video/cocoa_v.mm | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/video/cocoa_v.mm b/src/video/cocoa_v.mm index 2adc231d5..bc4358912 100644 --- a/src/video/cocoa_v.mm +++ b/src/video/cocoa_v.mm @@ -873,9 +873,6 @@ static void QZ_SetPortAlphaOpaque() _screen.width = _cocoa_video_data.width; _screen.height = _cocoa_video_data.height; _screen.pitch = _cocoa_video_data.width; - _screen.renderer = RendererFactoryBase::SelectRenderer(BlitterFactoryBase::GetCurrentBlitter()->GetRenderer()); - - if (_screen.renderer == NULL) error("Couldn't load the renderer '%s' the selected blitter depends on", BlitterFactoryBase::GetCurrentBlitter()->GetRenderer()); GameSizeChanged(); @@ -1711,9 +1708,6 @@ static const char* QZ_SetVideoMode(uint width, uint height, bool fullscreen) _screen.width = _cocoa_video_data.width; _screen.height = _cocoa_video_data.height; _screen.pitch = _cocoa_video_data.width; - _screen.renderer = RendererFactoryBase::SelectRenderer(BlitterFactoryBase::GetCurrentBlitter()->GetRenderer()); - - if (_screen.renderer == NULL) error("Couldn't load the renderer '%s' the selected blitter depends on", BlitterFactoryBase::GetCurrentBlitter()->GetRenderer()); QZ_UpdateVideoModes(); GameSizeChanged(); @@ -1739,6 +1733,8 @@ static const char* QZ_SetVideoModeAndRestoreOnFailure(uint width, uint height, b static void QZ_VideoInit() { + if (BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth() == 0) error("Can't use a blitter that blits 0 bpp for normal visuals"); + memset(&_cocoa_video_data, 0, sizeof(_cocoa_video_data)); /* Initialize the video settings; this data persists between mode switches */ @@ -1766,6 +1762,9 @@ static void QZ_VideoInit() _cocoa_video_data.cursor_visible = true; + _screen.renderer = RendererFactoryBase::SelectRenderer(BlitterFactoryBase::GetCurrentBlitter()->GetRenderer()); + if (_screen.renderer == NULL) error("Couldn't load the renderer '%s' the selected blitter depends on", BlitterFactoryBase::GetCurrentBlitter()->GetRenderer()); + /* register for sleep notifications so wake from sleep generates SDL_VIDEOEXPOSE */ // QZ_RegisterForSleepNotifications(); } |