Make it possible to disable some/all of our three game modules (scumm/simon/sky) with three flags in the Makefile

svn-id: r7131
This commit is contained in:
Max Horn 2003-04-26 11:44:13 +00:00
parent 8460343287
commit 5626e42f5b
6 changed files with 83 additions and 26 deletions

View File

@ -48,11 +48,17 @@ LIBS += -lmad
#######################################################################
# Misc stuff - you should normally never have to edit this #
# Control which modules are built - uncomment any to disable module #
#######################################################################
# Concat DEFINES and INCLUDES to for the CPPFLAGS
CPPFLAGS:= $(DEFINES) $(INCLUDES)
# DISABLE_SCUMM = 1
# DISABLE_SIMON = 1
# DISABLE_SKY = 1
#######################################################################
# Misc stuff - you should normally never have to edit this #
#######################################################################
include Makefile.common

View File

@ -22,10 +22,26 @@ DEPDIR := .deps
# TODO - the nested ones (scumm/smush, backends/...) should be handled from the
# module.mk of their parents. In fact the only reason they are listed here is to ensure the
# DEPDIRS directive works correctly.
ifdef DISABLE_SCUMM
DEFINES += -DDISABLE_SCUMM
else
MODULES += scumm
endif
ifdef DISABLE_SIMON
DEFINES += -DDISABLE_SIMON
else
MODULES += simon
endif
ifdef DISABLE_SKY
DEFINES += -DDISABLE_SKY
else
MODULES += sky
endif
MODULES += \
scumm \
simon \
sky \
common \
gui \
backends \
@ -36,8 +52,11 @@ MODULES += \
backends/fs/windows \
backends/midi
# Concat DEFINES and INCLUDES to form the CPPFLAGS
CPPFLAGS:= $(DEFINES) $(INCLUDES)
# Include the build instructions for all modules
-include $(patsubst %,%/module.mk,$(MODULES))
-include $(addsuffix /module.mk,$(MODULES))
# HACK temporary fix to get compilation on OS X (and possibly others) working again
OBJS:=common/engine.o $(OBJS)
@ -59,8 +78,8 @@ clean:
# If you use GCC, disable the above and enable this for intelligent
# dependency tracking.
DEPDIRS = $(patsubst %,%/$(DEPDIR),$(MODULES))
DEPFILES = $(wildcard $(patsubst %,%/*.d,$(DEPDIRS)))
DEPDIRS = $(addsuffix /$(DEPDIR),$(MODULES))
DEPFILES = $(wildcard $(addsuffix /*.d,$(DEPDIRS)))
.cpp.o:
$(MKDIR) $(*D)/$(DEPDIR)

View File

@ -50,9 +50,6 @@ LIBS += -lvorbisfile -lvorbis -logg
# Misc stuff - you should normally never have to edit this #
#######################################################################
# Concat DEFINES and INCLUDES to for the CPPFLAGS
CPPFLAGS:= $(DEFINES) $(INCLUDES)
include Makefile.common
scummvmico.o: scummvm.ico

View File

@ -79,18 +79,26 @@ const char *Engine::getSavePath() const {
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;
}

View File

@ -82,13 +82,21 @@ void checkHeap();
// 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);
extern Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst);
extern Engine *Engine_SKY_create(GameDetector *detector, OSystem *syst);
extern const VersionSettings *Engine_SIMON_targetList();
#ifndef DISABLE_SCUMM
extern const VersionSettings *Engine_SCUMM_targetList();
extern Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst);
#endif
#ifndef DISABLE_SIMON
extern Engine *Engine_SIMON_create(GameDetector *detector, OSystem *syst);
extern const VersionSettings *Engine_SIMON_targetList();
#endif
#ifndef DISABLE_SKY
extern const VersionSettings *Engine_SKY_targetList();
extern Engine *Engine_SKY_create(GameDetector *detector, OSystem *syst);
#endif
#endif

View File

@ -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
}
}