[Scummvm-cvs-logs] CVS: scummvm/backends/sdl graphics.cpp,1.39,1.40 sdl-common.h,1.78,1.79 sdl.cpp,1.82,1.83
Max Horn
fingolfin at users.sourceforge.net
Tue Apr 19 13:23:21 CEST 2005
Update of /cvsroot/scummvm/scummvm/backends/sdl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12884/backends/sdl
Modified Files:
graphics.cpp sdl-common.h sdl.cpp
Log Message:
Added new (optional) OSystem::initBackend() method; this (and its usage) fixes bugs #1160977 and #1184664
Index: graphics.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/graphics.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- graphics.cpp 19 Apr 2005 12:43:54 -0000 1.39
+++ graphics.cpp 19 Apr 2005 20:22:49 -0000 1.40
@@ -301,6 +301,7 @@
}
void OSystem_SDL::loadGFXMode() {
+ assert(_inited);
_forceFull = true;
_modeFlags |= DF_UPDATE_EXPAND_1_PIXEL;
Index: sdl-common.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.h,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- sdl-common.h 9 Apr 2005 13:31:46 -0000 1.78
+++ sdl-common.h 19 Apr 2005 20:22:49 -0000 1.79
@@ -69,6 +69,8 @@
OSystem_SDL();
virtual ~OSystem_SDL();
+ virtual void initBackend();
+
void beginGFXTransaction(void);
void endGFXTransaction(void);
@@ -188,7 +190,7 @@
#endif
protected:
- void initIntern();
+ bool _inited;
#ifdef USE_OSD
SDL_Surface *_osdSurface;
Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl.cpp,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- sdl.cpp 10 Mar 2005 15:43:08 -0000 1.82
+++ sdl.cpp 19 Apr 2005 20:22:50 -0000 1.83
@@ -35,7 +35,8 @@
return new OSystem_SDL();
}
-void OSystem_SDL::initIntern() {
+void OSystem_SDL::initBackend() {
+ assert(!_inited);
int joystick_num = ConfMan.getInt("joystick_num");
uint32 sdlFlags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER;
@@ -89,6 +90,8 @@
printf("Using joystick: %s\n", SDL_JoystickName(0));
_joystick = SDL_JoystickOpen(joystick_num);
}
+
+ _inited = true;
}
OSystem_SDL::OSystem_SDL()
@@ -120,7 +123,7 @@
memset(&_km, 0, sizeof(_km));
memset(&_mouseCurState, 0, sizeof(_mouseCurState));
- initIntern();
+ _inited = false;
}
OSystem_SDL::~OSystem_SDL() {
More information about the Scummvm-git-logs
mailing list