diff options
author | Max Horn | 2002-09-27 13:05:54 +0000 |
---|---|---|
committer | Max Horn | 2002-09-27 13:05:54 +0000 |
commit | 29f8c3af953c75aa427f3b144f703c6b9291e282 (patch) | |
tree | 1f196daff7df098748e11932c5d1a5525abdba59 /backends/sdl/sdl.cpp | |
parent | 09f56dc233324a7611554912c5483e20e0684104 (diff) | |
download | scummvm-rg350-29f8c3af953c75aa427f3b144f703c6b9291e282.tar.gz scummvm-rg350-29f8c3af953c75aa427f3b144f703c6b9291e282.tar.bz2 scummvm-rg350-29f8c3af953c75aa427f3b144f703c6b9291e282.zip |
made init_size in the SDL backend reentrant
svn-id: r5022
Diffstat (limited to 'backends/sdl/sdl.cpp')
-rw-r--r-- | backends/sdl/sdl.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/backends/sdl/sdl.cpp b/backends/sdl/sdl.cpp index cf8c39b0a4..2b2ae1d115 100644 --- a/backends/sdl/sdl.cpp +++ b/backends/sdl/sdl.cpp @@ -27,6 +27,8 @@ class OSystem_SDL_Normal : public OSystem_SDL_Common { public: + OSystem_SDL_Normal() : sdl_tmpscreen(0), sdl_hwscreen(0) {} + // Set colors of the palette void set_palette(const byte *colors, uint start, uint num); @@ -337,10 +339,10 @@ void OSystem_SDL_Normal::update_screen() { if (force_full) { num_dirty_rects = 1; - dirty_rect_list[0].x = 0; - dirty_rect_list[0].y = 0; - dirty_rect_list[0].w = SCREEN_WIDTH; - dirty_rect_list[0].h = SCREEN_HEIGHT; + _dirty_rect_list[0].x = 0; + _dirty_rect_list[0].y = 0; + _dirty_rect_list[0].w = SCREEN_WIDTH; + _dirty_rect_list[0].h = SCREEN_HEIGHT; } // Only draw anything if necessary @@ -348,12 +350,12 @@ void OSystem_SDL_Normal::update_screen() { SDL_Rect *r; uint32 srcPitch, dstPitch; - SDL_Rect *last_rect = dirty_rect_list + num_dirty_rects; + SDL_Rect *last_rect = _dirty_rect_list + num_dirty_rects; // Convert appropriate parts of the 8bpp image into 16bpp if (!_overlay_visible) { SDL_Rect dst; - for(r=dirty_rect_list; r!=last_rect; ++r) { + for(r=_dirty_rect_list; r!=last_rect; ++r) { dst = *r; dst.x++; // Shift rect by one since 2xSai needs to acces the data around dst.y++; // any pixel to scale it, and we want to avoid mem access crashes. @@ -368,7 +370,7 @@ void OSystem_SDL_Normal::update_screen() { srcPitch = sdl_tmpscreen->pitch; dstPitch = sdl_hwscreen->pitch; - for(r=dirty_rect_list; r!=last_rect; ++r) { + for(r=_dirty_rect_list; r!=last_rect; ++r) { register int dst_y = r->y + _current_shake_pos; register int dst_h = 0; if (dst_y < SCREEN_HEIGHT) { @@ -389,8 +391,8 @@ void OSystem_SDL_Normal::update_screen() { } if (force_full) { - dirty_rect_list[0].y = 0; - dirty_rect_list[0].h = SCREEN_HEIGHT * scaling; + _dirty_rect_list[0].y = 0; + _dirty_rect_list[0].h = SCREEN_HEIGHT * scaling; } SDL_UnlockSurface(sdl_tmpscreen); @@ -399,7 +401,7 @@ void OSystem_SDL_Normal::update_screen() { if (num_dirty_rects > 0) { /* Finally, blit all our changes to the screen */ - SDL_UpdateRects(sdl_hwscreen, num_dirty_rects, dirty_rect_list); + SDL_UpdateRects(sdl_hwscreen, num_dirty_rects, _dirty_rect_list); } num_dirty_rects = 0; |