summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-06-12 23:10:47 +0000
committertruelight <truelight@openttd.org>2007-06-12 23:10:47 +0000
commita1603f51f2a372ecbdf9dafbdedfbebd590dfaef (patch)
tree909db660aa7ce697edf07e18a0ab7838bfa62c20 /src
parent5d013d166e4ba6a4c77e7c4e8cb61b7ffdd2e294 (diff)
downloadopenttd-a1603f51f2a372ecbdf9dafbdedfbebd590dfaef.tar.xz
(svn r10124) -Fix r10123: fix the OSX video driver properly
Diffstat (limited to 'src')
-rw-r--r--src/video/cocoa_v.mm11
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();
}