diff options
| author | Max Horn | 2003-04-30 19:11:33 +0000 |
|---|---|---|
| committer | Max Horn | 2003-04-30 19:11:33 +0000 |
| commit | feab6f904f81e5f6a1fbaf8b1b3b8686242ed00b (patch) | |
| tree | db386448d255e93d18ce5751bb94b65c6ed44726 /backends/sdl/sdl.cpp | |
| parent | 70936947815df45899879fa0467c6489cc0d72c9 (diff) | |
| download | scummvm-rg350-feab6f904f81e5f6a1fbaf8b1b3b8686242ed00b.tar.gz scummvm-rg350-feab6f904f81e5f6a1fbaf8b1b3b8686242ed00b.tar.bz2 scummvm-rg350-feab6f904f81e5f6a1fbaf8b1b3b8686242ed00b.zip | |
moved screen mutex from smush into SDL backend (other backends have to make sure they are thread safe by themselves)
svn-id: r7230
Diffstat (limited to 'backends/sdl/sdl.cpp')
| -rw-r--r-- | backends/sdl/sdl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/backends/sdl/sdl.cpp b/backends/sdl/sdl.cpp index 6c6dd255e1..3c977e20b9 100644 --- a/backends/sdl/sdl.cpp +++ b/backends/sdl/sdl.cpp @@ -230,6 +230,8 @@ void OSystem_SDL::hotswap_gfx_mode() { void OSystem_SDL::update_screen() { assert(_hwscreen != NULL); + StackLock lock(_mutex); // Lock the mutex until this function ends + // If the shake position changed, fill the dirty area with blackness if (_currentShakePos != _newShakePos) { SDL_Rect blackrect = {0, 0, _screenWidth * _scaleFactor, _newShakePos * _scaleFactor}; @@ -277,12 +279,12 @@ void OSystem_SDL::update_screen() { if (!_overlayVisible) { 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. if (_scaler_proc == Normal1x) { if (SDL_BlitSurface(_screen, r, _hwscreen, &dst) != 0) error("SDL_BlitSurface failed: %s", SDL_GetError()); } else { - 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. if (SDL_BlitSurface(_screen, r, _tmpscreen, &dst) != 0) error("SDL_BlitSurface failed: %s", SDL_GetError()); } |
