[Scummvm-cvs-logs] CVS: scummvm/common engine.cpp,1.17,1.18 engine.h,1.20,1.21 gameDetector.cpp,1.86,1.87

Max Horn fingolfin at users.sourceforge.net
Sat Apr 26 04:45:05 CEST 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv5264/common

Modified Files:
	engine.cpp engine.h gameDetector.cpp 
Log Message:
Make it possible to disable some/all of our three game modules (scumm/simon/sky) with three flags in the Makefile

Index: engine.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/engine.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- engine.cpp	7 Mar 2003 15:37:56 -0000	1.17
+++ engine.cpp	26 Apr 2003 11:44:13 -0000	1.18
@@ -79,18 +79,26 @@
 Engine *Engine::createFromDetector(GameDetector *detector, OSystem *syst) {
 	Engine *engine = NULL;
 
+#ifndef DISABLE_SCUMM
+	if (detector->_gameId >= GID_SCUMM_FIRST && detector->_gameId <= GID_SCUMM_LAST) {
+		// Some kind of Scumm game
+		engine = Engine_SCUMM_create(detector, syst);
+	}
+#endif
+
+#ifndef DISABLE_SIMON
 	if (detector->_gameId >= GID_SIMON_FIRST && detector->_gameId <= GID_SIMON_LAST) {
 		// Simon the Sorcerer
 		engine = Engine_SIMON_create(detector, syst);
-	} else if (detector->_gameId >= GID_SCUMM_FIRST && detector->_gameId <= GID_SCUMM_LAST) {
-		// Some kind of Scumm game
-		engine = Engine_SCUMM_create(detector, syst);
-	} else if (detector->_gameId >= GID_SKY_FIRST && detector->_gameId <= GID_SKY_LAST) {
+	}
+#endif
+
+#ifndef DISABLE_SKY
+	if (detector->_gameId >= GID_SKY_FIRST && detector->_gameId <= GID_SKY_LAST) {
 		// Beneath a Steel Sky
 		engine = Engine_SKY_create(detector, syst);
-	} else {
-		// Unknown game
 	}
+#endif
 
 	return engine;
 }

Index: engine.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/engine.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- engine.h	20 Apr 2003 21:42:49 -0000	1.20
+++ engine.h	26 Apr 2003 11:44:13 -0000	1.21
@@ -82,13 +82,21 @@
 // in this header. This serves two purposes:
 // 1) Clean seperation from the game modules (scumm, simon) and the generic code
 // 2) Faster (compiler doesn't have to parse lengthy header files)
-extern Engine *Engine_SIMON_create(GameDetector *detector, OSystem *syst);
+
+#ifndef DISABLE_SCUMM
+extern const VersionSettings *Engine_SCUMM_targetList();
 extern Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst);
-extern Engine *Engine_SKY_create(GameDetector *detector, OSystem *syst);
+#endif
 
+#ifndef DISABLE_SIMON
+extern Engine *Engine_SIMON_create(GameDetector *detector, OSystem *syst);
 extern const VersionSettings *Engine_SIMON_targetList();
-extern const VersionSettings *Engine_SCUMM_targetList();
+#endif
+
+#ifndef DISABLE_SKY
 extern const VersionSettings *Engine_SKY_targetList();
+extern Engine *Engine_SKY_create(GameDetector *detector, OSystem *syst);
+#endif
 
 #endif
 

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- gameDetector.cpp	26 Mar 2003 12:30:41 -0000	1.86
+++ gameDetector.cpp	26 Apr 2003 11:44:13 -0000	1.87
@@ -162,26 +162,45 @@
 	_default_gfx_mode = true;
 
 	if (version_settings == NULL) {
+		int totalCount = 0;
+		
 		// Gather & combine the target lists from the modules
+
+#ifndef DISABLE_SCUMM
 		const VersionSettings *scummVersions = Engine_SCUMM_targetList();
-		const VersionSettings *simonVersions = Engine_SIMON_targetList();
-		const VersionSettings *skyVersions = Engine_SKY_targetList();
-		
 		int scummCount = countVersions(scummVersions);
+		totalCount += scummCount;
+#endif
+
+#ifndef DISABLE_SIMON
+		const VersionSettings *simonVersions = Engine_SIMON_targetList();
 		int simonCount = countVersions(simonVersions);
+		totalCount += simonCount;
+#endif
+
+#ifndef DISABLE_SKY
+		const VersionSettings *skyVersions = Engine_SKY_targetList();
 		int skyCount = countVersions(skyVersions);
+		totalCount += skyCount;
+#endif
 		
-		VersionSettings *v = (VersionSettings *)calloc(scummCount + simonCount + skyCount + 1, sizeof(VersionSettings));
+		VersionSettings *v = (VersionSettings *)calloc(totalCount + 1, sizeof(VersionSettings));
 		version_settings = v;
 
+#ifndef DISABLE_SCUMM
 		memcpy(v, scummVersions, scummCount * sizeof(VersionSettings));
 		v += scummCount;
+#endif
 
+#ifndef DISABLE_SIMON
 		memcpy(v, simonVersions, simonCount * sizeof(VersionSettings));
 		v += simonCount;
+#endif
 
+#ifndef DISABLE_SKY
 		memcpy(v, skyVersions, skyCount * sizeof(VersionSettings));
 		v += skyCount;
+#endif
 	}
 }
 





More information about the Scummvm-git-logs mailing list