diff options
author | Max Horn | 2003-04-26 11:44:13 +0000 |
---|---|---|
committer | Max Horn | 2003-04-26 11:44:13 +0000 |
commit | 5626e42f5bf50ae7fdde587047d48cf6986d61e8 (patch) | |
tree | a7519fcefd64326a6c4e2a4e6cac0241c6fce89d /common/gameDetector.cpp | |
parent | 846034328709d13a2d7af332fef346ad9558d0c3 (diff) | |
download | scummvm-rg350-5626e42f5bf50ae7fdde587047d48cf6986d61e8.tar.gz scummvm-rg350-5626e42f5bf50ae7fdde587047d48cf6986d61e8.tar.bz2 scummvm-rg350-5626e42f5bf50ae7fdde587047d48cf6986d61e8.zip |
Make it possible to disable some/all of our three game modules (scumm/simon/sky) with three flags in the Makefile
svn-id: r7131
Diffstat (limited to 'common/gameDetector.cpp')
-rw-r--r-- | common/gameDetector.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp index 71399b8751..6cb0f025a8 100644 --- a/common/gameDetector.cpp +++ b/common/gameDetector.cpp @@ -162,26 +162,45 @@ GameDetector::GameDetector() { _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 } } |