1
0
Fork 0

(svn r18545) -Fix [FS#3292]: Assign '_screen.dst_ptr' as soon as it is allocated.

release/1.0
frosch 2009-12-19 18:46:40 +00:00
parent 7572f95448
commit 29d6491605
6 changed files with 6 additions and 11 deletions

View File

@ -211,9 +211,10 @@ static bool CreateMainSurface(uint w, uint h)
_screen.width = _allegro_screen->w; _screen.width = _allegro_screen->w;
_screen.height = _allegro_screen->h; _screen.height = _allegro_screen->h;
_screen.pitch = ((byte*)screen->line[1] - (byte*)screen->line[0]) / (bpp / 8); _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 */ /* 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 */ /* Set the mouse at the place where we expect it */
poll_mouse(); poll_mouse();
@ -520,7 +521,6 @@ void VideoDriver_Allegro::MainLoop()
GameLoop(); GameLoop();
_screen.dst_ptr = _allegro_screen->line[0];
UpdateWindows(); UpdateWindows();
if (++pal_tick > 4) { if (++pal_tick > 4) {
CheckPaletteAnim(); CheckPaletteAnim();
@ -529,7 +529,6 @@ void VideoDriver_Allegro::MainLoop()
DrawSurfaceToScreen(); DrawSurfaceToScreen();
} else { } else {
CSleep(1); CSleep(1);
_screen.dst_ptr = _allegro_screen->line[0];
NetworkDrawChatMessage(); NetworkDrawChatMessage();
DrawMouseCursor(); DrawMouseCursor();
DrawSurfaceToScreen(); DrawSurfaceToScreen();

View File

@ -194,6 +194,7 @@ void QZ_GameSizeChanged()
_screen.width = _cocoa_subdriver->GetWidth(); _screen.width = _cocoa_subdriver->GetWidth();
_screen.height = _cocoa_subdriver->GetHeight(); _screen.height = _cocoa_subdriver->GetHeight();
_screen.pitch = _cocoa_subdriver->GetWidth(); _screen.pitch = _cocoa_subdriver->GetWidth();
_screen.dst_ptr = _cocoa_subdriver->GetPixelBuffer();
_fullscreen = _cocoa_subdriver->IsFullscreen(); _fullscreen = _cocoa_subdriver->IsFullscreen();
GameSizeChanged(); GameSizeChanged();

View File

@ -603,7 +603,6 @@ void QZ_GameLoop()
uint32 st = 0; uint32 st = 0;
#endif #endif
_screen.dst_ptr = _cocoa_subdriver->GetPixelBuffer();
DisplaySplashImage(); DisplaySplashImage();
QZ_CheckPaletteAnim(); QZ_CheckPaletteAnim();
_cocoa_subdriver->Draw(true); _cocoa_subdriver->Draw(true);
@ -611,7 +610,6 @@ void QZ_GameLoop()
for (int i = 0; i < 2; i++) GameLoop(); for (int i = 0; i < 2; i++) GameLoop();
_screen.dst_ptr = _cocoa_subdriver->GetPixelBuffer();
UpdateWindows(); UpdateWindows();
QZ_CheckPaletteAnim(); QZ_CheckPaletteAnim();
_cocoa_subdriver->Draw(); _cocoa_subdriver->Draw();
@ -651,7 +649,6 @@ void QZ_GameLoop()
GameLoop(); GameLoop();
_screen.dst_ptr = _cocoa_subdriver->GetPixelBuffer();
UpdateWindows(); UpdateWindows();
if (++pal_tick > 4) { if (++pal_tick > 4) {
QZ_CheckPaletteAnim(); QZ_CheckPaletteAnim();
@ -666,7 +663,6 @@ void QZ_GameLoop()
#ifdef _DEBUG #ifdef _DEBUG
st += GetTick() - st0; st += GetTick() - st0;
#endif #endif
_screen.dst_ptr = _cocoa_subdriver->GetPixelBuffer();
NetworkDrawChatMessage(); NetworkDrawChatMessage();
DrawMouseCursor(); DrawMouseCursor();
_cocoa_subdriver->Draw(); _cocoa_subdriver->Draw();

View File

@ -145,6 +145,7 @@ const char *VideoDriver_Dedicated::Start(const char * const *parm)
_screen.width = _screen.pitch = _cur_resolution.width; _screen.width = _screen.pitch = _cur_resolution.width;
_screen.height = _cur_resolution.height; _screen.height = _cur_resolution.height;
_screen.dst_ptr = _dedicated_video_mem;
ScreenSizeChanged(); ScreenSizeChanged();
#if defined(WINCE) #if defined(WINCE)
@ -302,7 +303,6 @@ void VideoDriver_Dedicated::MainLoop()
next_tick = cur_ticks + 30; next_tick = cur_ticks + 30;
GameLoop(); GameLoop();
_screen.dst_ptr = _dedicated_video_mem;
UpdateWindows(); UpdateWindows();
} }
CSleep(1); CSleep(1);

View File

@ -21,6 +21,7 @@ const char *VideoDriver_Null::Start(const char * const *parm)
this->ticks = GetDriverParamInt(parm, "ticks", 1000); this->ticks = GetDriverParamInt(parm, "ticks", 1000);
_screen.width = _screen.pitch = _cur_resolution.width; _screen.width = _screen.pitch = _cur_resolution.width;
_screen.height = _cur_resolution.height; _screen.height = _cur_resolution.height;
_screen.dst_ptr = NULL;
ScreenSizeChanged(); ScreenSizeChanged();
/* Do not render, nor blit */ /* Do not render, nor blit */
@ -39,7 +40,6 @@ void VideoDriver_Null::MainLoop()
for (i = 0; i < this->ticks; i++) { for (i = 0; i < this->ticks; i++) {
GameLoop(); GameLoop();
_screen.dst_ptr = NULL;
UpdateWindows(); UpdateWindows();
} }
} }

View File

@ -249,6 +249,7 @@ static bool CreateMainSurface(uint w, uint h)
_screen.width = newscreen->w; _screen.width = newscreen->w;
_screen.height = newscreen->h; _screen.height = newscreen->h;
_screen.pitch = newscreen->pitch / (bpp / 8); _screen.pitch = newscreen->pitch / (bpp / 8);
_screen.dst_ptr = newscreen->pixels;
_sdl_screen = newscreen; _sdl_screen = newscreen;
InitPalette(); InitPalette();
@ -587,7 +588,6 @@ void VideoDriver_SDL::MainLoop()
if (_draw_threaded) _draw_mutex->BeginCritical(); if (_draw_threaded) _draw_mutex->BeginCritical();
_screen.dst_ptr = _sdl_screen->pixels;
UpdateWindows(); UpdateWindows();
if (++pal_tick > 4) { if (++pal_tick > 4) {
CheckPaletteAnim(); CheckPaletteAnim();
@ -599,7 +599,6 @@ void VideoDriver_SDL::MainLoop()
CSleep(1); CSleep(1);
if (_draw_threaded) _draw_mutex->BeginCritical(); if (_draw_threaded) _draw_mutex->BeginCritical();
_screen.dst_ptr = _sdl_screen->pixels;
NetworkDrawChatMessage(); NetworkDrawChatMessage();
DrawMouseCursor(); DrawMouseCursor();
} }