diff options
author | Max Horn | 2002-12-13 17:44:04 +0000 |
---|---|---|
committer | Max Horn | 2002-12-13 17:44:04 +0000 |
commit | 80a962dd025f488e2ab770ac42462af61c72b578 (patch) | |
tree | 2419b63b246bf40ce9459445b2f1f5936b0b30ed /backends | |
parent | 57187dbdcd011fc95a0829c04e1e2b13b76e981b (diff) | |
download | scummvm-rg350-80a962dd025f488e2ab770ac42462af61c72b578.tar.gz scummvm-rg350-80a962dd025f488e2ab770ac42462af61c72b578.tar.bz2 scummvm-rg350-80a962dd025f488e2ab770ac42462af61c72b578.zip |
cleanup
svn-id: r5936
Diffstat (limited to 'backends')
-rw-r--r-- | backends/sdl/sdl-common.cpp | 23 | ||||
-rw-r--r-- | backends/sdl/sdl-common.h | 3 | ||||
-rw-r--r-- | backends/sdl/sdl.cpp | 11 | ||||
-rw-r--r-- | backends/sdl/sdl_gl.cpp | 24 |
4 files changed, 10 insertions, 51 deletions
diff --git a/backends/sdl/sdl-common.cpp b/backends/sdl/sdl-common.cpp index c7440b9c43..e58234ff71 100644 --- a/backends/sdl/sdl-common.cpp +++ b/backends/sdl/sdl-common.cpp @@ -655,20 +655,6 @@ bool OSystem_SDL_Common::set_sound_proc(void *param, SoundProc *proc, byte forma return true; } - -/* retrieve the 320x200 bitmap currently being displayed */ -void OSystem_SDL_Common::get_screen_image(byte *buf) { - /* make sure the mouse is gone */ - undraw_mouse(); - - if (SDL_LockSurface(_screen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); - - memcpy(buf, _screen->pixels, _screenWidth*_screenHeight); - - SDL_UnlockSurface(_screen); -} - uint32 OSystem_SDL_Common::property(int param, Property *value) { switch(param) { @@ -691,15 +677,6 @@ uint32 OSystem_SDL_Common::property(int param, Property *value) { } break; - case PROP_SET_GFX_MODE: - if (value->gfx_mode >= 7) - return 0; - - _mode = value->gfx_mode; - hotswap_gfx_mode(); - - return 1; - case PROP_SHOW_DEFAULT_CURSOR: SDL_ShowCursor(value->show_cursor ? SDL_ENABLE : SDL_DISABLE); break; diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h index ff0bd96135..ad168e2572 100644 --- a/backends/sdl/sdl-common.h +++ b/backends/sdl/sdl-common.h @@ -204,9 +204,6 @@ protected: virtual void load_gfx_mode() = 0; virtual void unload_gfx_mode() = 0; - virtual void hotswap_gfx_mode() = 0; - - void get_screen_image(byte *buf); void setup_icon(); void kbd_mouse(); diff --git a/backends/sdl/sdl.cpp b/backends/sdl/sdl.cpp index 01bb80a827..3d8d2e1cf5 100644 --- a/backends/sdl/sdl.cpp +++ b/backends/sdl/sdl.cpp @@ -192,7 +192,6 @@ void OSystem_SDL::unload_gfx_mode() { void OSystem_SDL::hotswap_gfx_mode() { - // Keep around the old _screen & _tmpscreen so we can restore the screen data // after the mode switch. SDL_Surface *old_screen = _screen; @@ -339,7 +338,17 @@ uint32 OSystem_SDL::property(int param, Property *value) { } #endif return 1; + } else if (param == PROP_SET_GFX_MODE) { + if (value->gfx_mode >= 7) + return 0; + + _mode = value->gfx_mode; + hotswap_gfx_mode(); + + return 1; } + + return OSystem_SDL_Common::property(param, value); } diff --git a/backends/sdl/sdl_gl.cpp b/backends/sdl/sdl_gl.cpp index f3a2fa7f63..375ca5b733 100644 --- a/backends/sdl/sdl_gl.cpp +++ b/backends/sdl/sdl_gl.cpp @@ -55,7 +55,6 @@ protected: virtual void load_gfx_mode(); virtual void unload_gfx_mode(); - void hotswap_gfx_mode(); }; OSystem_SDL_Common *OSystem_SDL_Common::create() { @@ -243,29 +242,6 @@ void OSystem_SDL_OpenGL::update_screen() { _forceFull = false; } -void OSystem_SDL_OpenGL::hotswap_gfx_mode() { - /* We allocate a screen sized bitmap which contains a "backup" - * of the screen data during the change. Then we draw that to - * the new screen right after it's setup. - */ - - byte *bak_mem = (byte*)malloc(_screenWidth*_screenHeight); - - get_screen_image(bak_mem); - - unload_gfx_mode(); - load_gfx_mode(); - - // reset palette - SDL_SetColors(_screen, _currentPalette, 0, 256); - - // blit image - copy_rect(bak_mem, _screenWidth, 0, 0, _screenWidth, _screenHeight); - free(bak_mem); - - update_screen(); -} - uint32 OSystem_SDL_OpenGL::property(int param, Property *value) { if (param == PROP_TOGGLE_FULLSCREEN) { |