[Scummvm-cvs-logs] CVS: scummvm/backends/sdl sdl-common.cpp,1.18,1.19 sdl-common.h,1.9,1.10 sdl.cpp,1.17,1.18 sdl_gl.cpp,1.18,1.19
Max Horn
fingolfin at users.sourceforge.net
Fri Dec 13 09:45:05 CET 2002
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/backends/sdl sdl-common.cpp,1.17,1.18 sdl-common.h,1.8,1.9 sdl.cpp,1.16,1.17 sdl_gl.cpp,1.17,1.18
- Next message: [Scummvm-cvs-logs] CVS: scummvm/gui PopUpWidget.cpp,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/backends/sdl
In directory sc8-pr-cvs1:/tmp/cvs-serv6258
Modified Files:
sdl-common.cpp sdl-common.h sdl.cpp sdl_gl.cpp
Log Message:
cleanup
Index: sdl-common.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- sdl-common.cpp 13 Dec 2002 17:27:15 -0000 1.18
+++ sdl-common.cpp 13 Dec 2002 17:43:46 -0000 1.19
@@ -655,20 +655,6 @@
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) {
@@ -690,15 +676,6 @@
}
}
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);
Index: sdl-common.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- sdl-common.h 13 Dec 2002 17:27:19 -0000 1.9
+++ sdl-common.h 13 Dec 2002 17:43:50 -0000 1.10
@@ -204,9 +204,6 @@
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();
Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- sdl.cpp 13 Dec 2002 17:27:22 -0000 1.17
+++ sdl.cpp 13 Dec 2002 17:43:58 -0000 1.18
@@ -192,7 +192,6 @@
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 @@
}
#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);
}
Index: sdl_gl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl_gl.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- sdl_gl.cpp 13 Dec 2002 17:27:28 -0000 1.18
+++ sdl_gl.cpp 13 Dec 2002 17:44:04 -0000 1.19
@@ -55,7 +55,6 @@
virtual void load_gfx_mode();
virtual void unload_gfx_mode();
- void hotswap_gfx_mode();
};
OSystem_SDL_Common *OSystem_SDL_Common::create() {
@@ -241,29 +240,6 @@
_num_dirty_rects = 0;
_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) {
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/backends/sdl sdl-common.cpp,1.17,1.18 sdl-common.h,1.8,1.9 sdl.cpp,1.16,1.17 sdl_gl.cpp,1.17,1.18
- Next message: [Scummvm-cvs-logs] CVS: scummvm/gui PopUpWidget.cpp,1.3,1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list