[Scummvm-cvs-logs] SF.net SVN: scummvm:[49370] scummvm/branches/gsoc2010-opengl/backends/ platform/sdl

vgvgf at users.sourceforge.net vgvgf at users.sourceforge.net
Tue Jun 1 06:02:45 CEST 2010


Revision: 49370
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49370&view=rev
Author:   vgvgf
Date:     2010-06-01 04:02:44 +0000 (Tue, 01 Jun 2010)

Log Message:
-----------
Removed OSystem pointer. Added left initialization code to file subsystem.

Modified Paths:
--------------
    scummvm/branches/gsoc2010-opengl/backends/platform/sdl/file.cpp
    scummvm/branches/gsoc2010-opengl/backends/platform/sdl/file.h
    scummvm/branches/gsoc2010-opengl/backends/platform/sdl/mutex.cpp
    scummvm/branches/gsoc2010-opengl/backends/platform/sdl/mutex.h
    scummvm/branches/gsoc2010-opengl/backends/platform/sdl/timer.cpp
    scummvm/branches/gsoc2010-opengl/backends/platform/sdl/timer.h

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/sdl/file.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/sdl/file.cpp	2010-06-01 04:00:55 UTC (rev 49369)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/sdl/file.cpp	2010-06-01 04:02:44 UTC (rev 49370)
@@ -68,16 +68,29 @@
 	_fsFactory(0),
 	_savefile(0) {
 
+	#if defined(__amigaos4__)
+		_fsFactory = new AmigaOSFilesystemFactory();
+	#elif defined(UNIX)
+		_fsFactory = new POSIXFilesystemFactory();
+	#elif defined(WIN32)
+		_fsFactory = new WindowsFilesystemFactory();
+	#elif defined(__SYMBIAN32__)
+		// Do nothing since its handled by the Symbian SDL inheritance
+	#else
+		#error Unknown and unsupported FS backend
+	#endif
 }
 
 SdlSubSys_File::~SdlSubSys_File() {
+	if (_inited) {
+		fileDone();
+	}
 }
 
-void SdlSubSys_File::fileInit(OSystem *mainSys) {
+void SdlSubSys_File::fileInit() {
 	if (_inited) {
 		return;
 	}
-	_mainSys = mainSys;
 
 	// Create the savefile manager, if none exists yet (we check for this to
 	// allow subclasses to provide their own).
@@ -89,23 +102,16 @@
 	#endif
 	}
 
-#if defined(__amigaos4__)
-	_fsFactory = new AmigaOSFilesystemFactory();
-#elif defined(UNIX)
-	_fsFactory = new POSIXFilesystemFactory();
-#elif defined(WIN32)
-	_fsFactory = new WindowsFilesystemFactory();
-#elif defined(__SYMBIAN32__)
-	// Do nothing since its handled by the Symbian SDL inheritance
-#else
-	#error Unknown and unsupported FS backend
-#endif
-
 	_inited = true;
 }
 
 void SdlSubSys_File::fileDone() {
+	// Event Manager requires save manager for storing
+	// recorded events
+	delete getEventManager();
 	delete _savefile;
+
+	_inited = false;
 }
 
 bool SdlSubSys_File::hasFeature(Feature f) {

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/sdl/file.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/sdl/file.h	2010-06-01 04:00:55 UTC (rev 49369)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/sdl/file.h	2010-06-01 04:02:44 UTC (rev 49370)
@@ -39,7 +39,7 @@
 	SdlSubSys_File();
 	~SdlSubSys_File();
 
-	virtual void fileInit(OSystem *mainSys);
+	virtual void fileInit();
 	virtual void fileDone();
 
 	bool hasFeature(Feature f);
@@ -58,9 +58,6 @@
 
 	FilesystemFactory *_fsFactory;
 	Common::SaveFileManager *_savefile;
-
-private:
-	OSystem *_mainSys;
 };
 
 

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/sdl/mutex.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/sdl/mutex.cpp	2010-06-01 04:00:55 UTC (rev 49369)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/sdl/mutex.cpp	2010-06-01 04:02:44 UTC (rev 49370)
@@ -27,7 +27,8 @@
 
 SdlSubSys_Mutex::SdlSubSys_Mutex()
 	:
-	_inited(false) {
+	_inited(false),
+	_graphicsMutex(0) {
 
 }
 
@@ -37,11 +38,10 @@
 	}
 }
 
-void SdlSubSys_Mutex::mutexInit(OSystem *mainSys) {
+void SdlSubSys_Mutex::mutexInit() {
 	if (_inited) {
 		return;
 	}
-	_mainSys = mainSys;
 
 	_graphicsMutex = createMutex();
 

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/sdl/mutex.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/sdl/mutex.h	2010-06-01 04:00:55 UTC (rev 49369)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/sdl/mutex.h	2010-06-01 04:02:44 UTC (rev 49370)
@@ -39,7 +39,7 @@
 	SdlSubSys_Mutex();
 	~SdlSubSys_Mutex();
 
-	virtual void mutexInit(OSystem *mainSys);
+	virtual void mutexInit();
 	virtual void mutexDone();
 
 	bool hasFeature(Feature f);
@@ -60,9 +60,6 @@
 	 * when accessing the screen.
 	 */
 	MutexRef _graphicsMutex;
-
-private:
-	OSystem *_mainSys;
 };
 
 

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/sdl/timer.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/sdl/timer.cpp	2010-06-01 04:00:55 UTC (rev 49369)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/sdl/timer.cpp	2010-06-01 04:02:44 UTC (rev 49370)
@@ -47,11 +47,10 @@
 	}
 }
 
-void SdlSubSys_Timer::timerInit(OSystem *mainSys) {
+void SdlSubSys_Timer::timerInit() {
 	if (_inited) {
 		return;
 	}
-	_mainSys = mainSys;
 
 	if (SDL_InitSubSystem(SDL_INIT_TIMER) == -1) {
 		error("Could not initialize SDL Timer: %s", SDL_GetError());

Modified: scummvm/branches/gsoc2010-opengl/backends/platform/sdl/timer.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/platform/sdl/timer.h	2010-06-01 04:00:55 UTC (rev 49369)
+++ scummvm/branches/gsoc2010-opengl/backends/platform/sdl/timer.h	2010-06-01 04:02:44 UTC (rev 49370)
@@ -39,7 +39,7 @@
 	SdlSubSys_Timer();
 	~SdlSubSys_Timer();
 
-	virtual void timerInit(OSystem *mainSys);
+	virtual void timerInit();
 	virtual void timerDone();
 
 	bool hasFeature(Feature f);
@@ -60,9 +60,6 @@
 
 	SDL_TimerID _timerID;
 	Common::TimerManager *_timer;
-
-private:
-	OSystem *_mainSys;
 };
 
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list