LASTEXPRESS: Split detection features & adapt to new plugins.
This commit is contained in:
parent
0fbfa709a2
commit
06cb6c50e6
4 changed files with 61 additions and 22 deletions
2
configure
vendored
2
configure
vendored
|
@ -6164,7 +6164,7 @@ declare -a static_detect_engines=("PLUMBERS" "AGI" "SCUMM" "SKY" "DREAMWEB" "DRA
|
||||||
"SWORD1" "SWORD2" "SWORD25" "ADL" "QUEEN" "CGE" "CGE2" "ACCESS"
|
"SWORD1" "SWORD2" "SWORD25" "ADL" "QUEEN" "CGE" "CGE2" "ACCESS"
|
||||||
"ZVISION" "AGOS" "GOB" "COMPOSER" "DM" "DRACI" "DRAGONS" "GNAP"
|
"ZVISION" "AGOS" "GOB" "COMPOSER" "DM" "DRACI" "DRAGONS" "GNAP"
|
||||||
"GRIFFON" "GROOVIE" "HDB" "HOPKINS" "HUGO" "ILLUSIONS" "KINGDOM"
|
"GRIFFON" "GROOVIE" "HDB" "HOPKINS" "HUGO" "ILLUSIONS" "KINGDOM"
|
||||||
"KYRA" "LAB")
|
"KYRA" "LAB" "LASTEXPRESS")
|
||||||
detectId="_DETECTION"
|
detectId="_DETECTION"
|
||||||
|
|
||||||
echo "Creating engines/plugins_table.h"
|
echo "Creating engines/plugins_table.h"
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "lastexpress/lastexpress.h"
|
|
||||||
#include "engines/advancedDetector.h"
|
#include "engines/advancedDetector.h"
|
||||||
|
|
||||||
namespace LastExpress {
|
namespace LastExpress {
|
||||||
|
@ -241,26 +240,8 @@ public:
|
||||||
const char *getOriginalCopyright() const override {
|
const char *getOriginalCopyright() const override {
|
||||||
return "The Last Express (C) 1997 Smoking Car Productions";
|
return "The Last Express (C) 1997 Smoking Car Productions";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
|
||||||
bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const override;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool LastExpressMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
|
|
||||||
if (gd) {
|
|
||||||
*engine = new LastExpressEngine(syst, (const ADGameDescription *)gd);
|
|
||||||
}
|
|
||||||
return gd != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LastExpressEngine::isDemo() const {
|
|
||||||
return (bool)(_gameDescription->flags & ADGF_DEMO);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // End of namespace LastExpress
|
} // End of namespace LastExpress
|
||||||
|
|
||||||
#if PLUGIN_ENABLED_DYNAMIC(LASTEXPRESS)
|
REGISTER_PLUGIN_STATIC(LASTEXPRESS_DETECTION, PLUGIN_TYPE_METAENGINE, LastExpress::LastExpressMetaEngine);
|
||||||
REGISTER_PLUGIN_DYNAMIC(LASTEXPRESS, PLUGIN_TYPE_ENGINE, LastExpress::LastExpressMetaEngine);
|
|
||||||
#else
|
|
||||||
REGISTER_PLUGIN_STATIC(LASTEXPRESS, PLUGIN_TYPE_ENGINE, LastExpress::LastExpressMetaEngine);
|
|
||||||
#endif
|
|
||||||
|
|
55
engines/lastexpress/metaengine.cpp
Normal file
55
engines/lastexpress/metaengine.cpp
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
/* ScummVM - Graphic Adventure Engine
|
||||||
|
*
|
||||||
|
* ScummVM is the legal property of its developers, whose names
|
||||||
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||||
|
* file distributed with this source distribution.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "lastexpress/lastexpress.h"
|
||||||
|
#include "engines/advancedDetector.h"
|
||||||
|
|
||||||
|
namespace LastExpress {
|
||||||
|
|
||||||
|
class LastExpressMetaEngineConnect : public AdvancedMetaEngineConnect {
|
||||||
|
public:
|
||||||
|
const char *getName() const override {
|
||||||
|
return "lastexpress";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const override;
|
||||||
|
};
|
||||||
|
|
||||||
|
bool LastExpressMetaEngineConnect::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *gd) const {
|
||||||
|
if (gd) {
|
||||||
|
*engine = new LastExpressEngine(syst, (const ADGameDescription *)gd);
|
||||||
|
}
|
||||||
|
return gd != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LastExpressEngine::isDemo() const {
|
||||||
|
return (bool)(_gameDescription->flags & ADGF_DEMO);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // End of namespace LastExpress
|
||||||
|
|
||||||
|
#if PLUGIN_ENABLED_DYNAMIC(LASTEXPRESS)
|
||||||
|
REGISTER_PLUGIN_DYNAMIC(LASTEXPRESS, PLUGIN_TYPE_ENGINE, LastExpress::LastExpressMetaEngineConnect);
|
||||||
|
#else
|
||||||
|
REGISTER_PLUGIN_STATIC(LASTEXPRESS, PLUGIN_TYPE_ENGINE, LastExpress::LastExpressMetaEngineConnect);
|
||||||
|
#endif
|
|
@ -69,9 +69,9 @@ MODULE_OBJS := \
|
||||||
sound/queue.o \
|
sound/queue.o \
|
||||||
sound/sound.o \
|
sound/sound.o \
|
||||||
debug.o \
|
debug.o \
|
||||||
detection.o \
|
|
||||||
graphics.o \
|
graphics.o \
|
||||||
lastexpress.o \
|
lastexpress.o \
|
||||||
|
metaengine.o \
|
||||||
resource.o
|
resource.o
|
||||||
|
|
||||||
# This module can be built as a plugin
|
# This module can be built as a plugin
|
||||||
|
@ -81,3 +81,6 @@ endif
|
||||||
|
|
||||||
# Include common rules
|
# Include common rules
|
||||||
include $(srcdir)/rules.mk
|
include $(srcdir)/rules.mk
|
||||||
|
|
||||||
|
# Detection objects
|
||||||
|
DETECT_OBJS += $(MODULE)/detection.o
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue