summaryrefslogtreecommitdiff
path: root/src/video/sdl_v.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-12-19 18:46:40 +0000
committerfrosch <frosch@openttd.org>2009-12-19 18:46:40 +0000
commit29d6491605bb13e7a751b2a1a8b8728f17bbc54b (patch)
treed36add5885667a83011cef1fdbfe90d5ce548dfd /src/video/sdl_v.cpp
parent7572f95448308fd19cd91ea1416ddf6320f51247 (diff)
downloadopenttd-29d6491605bb13e7a751b2a1a8b8728f17bbc54b.tar.xz
(svn r18545) -Fix [FS#3292]: Assign '_screen.dst_ptr' as soon as it is allocated.
Diffstat (limited to 'src/video/sdl_v.cpp')
-rw-r--r--src/video/sdl_v.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index 1af499d0a..d252287fb 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -249,6 +249,7 @@ static bool CreateMainSurface(uint w, uint h)
_screen.width = newscreen->w;
_screen.height = newscreen->h;
_screen.pitch = newscreen->pitch / (bpp / 8);
+ _screen.dst_ptr = newscreen->pixels;
_sdl_screen = newscreen;
InitPalette();
@@ -587,7 +588,6 @@ void VideoDriver_SDL::MainLoop()
if (_draw_threaded) _draw_mutex->BeginCritical();
- _screen.dst_ptr = _sdl_screen->pixels;
UpdateWindows();
if (++pal_tick > 4) {
CheckPaletteAnim();
@@ -599,7 +599,6 @@ void VideoDriver_SDL::MainLoop()
CSleep(1);
if (_draw_threaded) _draw_mutex->BeginCritical();
- _screen.dst_ptr = _sdl_screen->pixels;
NetworkDrawChatMessage();
DrawMouseCursor();
}