diff options
| author | Max Horn | 2003-07-02 15:08:46 +0000 |
|---|---|---|
| committer | Max Horn | 2003-07-02 15:08:46 +0000 |
| commit | e1ca5552ddccf427cf1a0ca84e335b74b183d638 (patch) | |
| tree | 0c825fdf214968d7769bfc38d026c4f7d476e867 /backends/sdl/sdl.cpp | |
| parent | 5b71113dcb4b87287417d0605c48fbc2a9eab451 (diff) | |
| download | scummvm-rg350-e1ca5552ddccf427cf1a0ca84e335b74b183d638.tar.gz scummvm-rg350-e1ca5552ddccf427cf1a0ca84e335b74b183d638.tar.bz2 scummvm-rg350-e1ca5552ddccf427cf1a0ca84e335b74b183d638.zip | |
cleanup; made mutex protection of graphics code a little bit tighter by protecting all of method property(); moved set_palette to OSystem_SDL_Common (it was identical in both normal and GL backend)
svn-id: r8717
Diffstat (limited to 'backends/sdl/sdl.cpp')
| -rw-r--r-- | backends/sdl/sdl.cpp | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/backends/sdl/sdl.cpp b/backends/sdl/sdl.cpp index 27616d09f8..4e9cb69bf9 100644 --- a/backends/sdl/sdl.cpp +++ b/backends/sdl/sdl.cpp @@ -29,9 +29,6 @@ class OSystem_SDL : public OSystem_SDL_Common { public: OSystem_SDL(); - // Set colors of the palette - void set_palette(const byte *colors, uint start, uint num); - // Update the dirty areas of the screen void update_screen(); @@ -57,24 +54,6 @@ OSystem_SDL::OSystem_SDL() { } -void OSystem_SDL::set_palette(const byte *colors, uint start, uint num) { - const byte *b = colors; - uint i; - SDL_Color *base = _currentPalette + start; - for (i = 0; i < num; i++) { - base[i].r = b[0]; - base[i].g = b[1]; - base[i].b = b[2]; - b += 4; - } - - if (start < _paletteDirtyStart) - _paletteDirtyStart = start; - - if (start + num > _paletteDirtyEnd) - _paletteDirtyEnd = start + num; -} - void OSystem_SDL::load_gfx_mode() { _forceFull = true; _mode_flags = DF_UPDATE_EXPAND_1_PIXEL; @@ -201,8 +180,6 @@ void OSystem_SDL::hotswap_gfx_mode() { if (!_screen) return; - StackLock lock(_mutex); // Lock the mutex until this function ends - // Keep around the old _screen & _tmpscreen so we can restore the screen data // after the mode switch. SDL_Surface *old_screen = _screen; @@ -233,7 +210,7 @@ void OSystem_SDL::hotswap_gfx_mode() { void OSystem_SDL::update_screen() { assert(_hwscreen != NULL); - StackLock lock(_mutex); // Lock the mutex until this function ends + StackLock lock(_graphicsMutex); // Lock the mutex until this function ends // If the shake position changed, fill the dirty area with blackness if (_currentShakePos != _newShakePos) { @@ -357,6 +334,9 @@ void OSystem_SDL::update_screen() { } uint32 OSystem_SDL::property(int param, Property *value) { + + StackLock lock(_graphicsMutex); // Lock the mutex until this function ends + if (param == PROP_TOGGLE_FULLSCREEN) { assert(_hwscreen != 0); _full_screen ^= true; |
