summaryrefslogtreecommitdiff
path: root/src/video/allegro_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/allegro_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/allegro_v.cpp')
-rw-r--r--src/video/allegro_v.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/video/allegro_v.cpp b/src/video/allegro_v.cpp
index 4dc588159..d1717f9b1 100644
--- a/src/video/allegro_v.cpp
+++ b/src/video/allegro_v.cpp
@@ -211,9 +211,10 @@ static bool CreateMainSurface(uint w, uint h)
_screen.width = _allegro_screen->w;
_screen.height = _allegro_screen->h;
_screen.pitch = ((byte*)screen->line[1] - (byte*)screen->line[0]) / (bpp / 8);
+ _screen.dst_ptr = _allegro_screen->line[0];
/* Initialise the screen so we don't blit garbage to the screen */
- memset(_allegro_screen->line[0], 0, _screen.height * _screen.pitch);
+ memset(_screen.dst_ptr, 0, _screen.height * _screen.pitch);
/* Set the mouse at the place where we expect it */
poll_mouse();
@@ -520,7 +521,6 @@ void VideoDriver_Allegro::MainLoop()
GameLoop();
- _screen.dst_ptr = _allegro_screen->line[0];
UpdateWindows();
if (++pal_tick > 4) {
CheckPaletteAnim();
@@ -529,7 +529,6 @@ void VideoDriver_Allegro::MainLoop()
DrawSurfaceToScreen();
} else {
CSleep(1);
- _screen.dst_ptr = _allegro_screen->line[0];
NetworkDrawChatMessage();
DrawMouseCursor();
DrawSurfaceToScreen();