CRYO: Split detection features & adapt to new plugins.

This commit is contained in:
aryanrawlani28 2020-08-07 04:48:56 +05:30 committed by Eugene Sandulenko
parent 2712bccff6
commit fb458421cf
4 changed files with 70 additions and 32 deletions

2
configure vendored
View File

@ -6169,7 +6169,7 @@ declare -a static_detect_engines=("PLUMBERS" "AGI" "SCUMM" "SKY" "DREAMWEB" "DRA
"PETKA" "PINK" "PRINCE" "SHERLOCK" "SLUDGE" "STARTREK" "SUPERNOVA"
"TEENAGENT" "TESTBED" "TINSEL" "TITANIC" "TOLTECS" "TONY" "TOON"
"TOUCHE" "TSAGE" "TUCKER" "VOYEUR" "WAGE" "AVALANCHE" "BBVS"
"BLADERUNNER" "CHEWY" "CINE" "CRUISE")
"BLADERUNNER" "CHEWY" "CINE" "CRUISE" "CRYO")
detectId="_DETECTION"
echo "Creating engines/plugins_table.h"

View File

@ -23,18 +23,7 @@
#include "base/plugins.h"
#include "engines/advancedDetector.h"
#include "common/file.h"
#include "cryo/cryo.h"
namespace Cryo {
const char *CryoEngine::getGameId() const { return _gameDescription->gameId; }
bool CryoEngine::isDemo() const { return _gameDescription->flags & ADGF_DEMO; }
Common::Platform CryoEngine::getPlatform() const { return _gameDescription->platform; }
}
static const PlainGameDescriptor cryoGames[] = {
{"losteden", "Lost Eden"},
@ -146,24 +135,6 @@ public:
const char *getOriginalCopyright() const override {
return "Cryo Engine (C) Cryo Interactive";
}
bool hasFeature(MetaEngineFeature f) const override;
bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
};
bool CryoMetaEngine::hasFeature(MetaEngineFeature f) const {
return false;
}
bool CryoMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
if (desc) {
*engine = new Cryo::CryoEngine(syst, desc);
}
return desc != 0;
}
#if PLUGIN_ENABLED_DYNAMIC(CRYO)
REGISTER_PLUGIN_DYNAMIC(CRYO, PLUGIN_TYPE_ENGINE, CryoMetaEngine);
#else
REGISTER_PLUGIN_STATIC(CRYO, PLUGIN_TYPE_ENGINE, CryoMetaEngine);
#endif
REGISTER_PLUGIN_STATIC(CRYO_DETECTION, PLUGIN_TYPE_METAENGINE, CryoMetaEngine);

View File

@ -0,0 +1,64 @@
/* 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 "base/plugins.h"
#include "engines/advancedDetector.h"
#include "common/file.h"
#include "cryo/cryo.h"
namespace Cryo {
const char *CryoEngine::getGameId() const { return _gameDescription->gameId; }
bool CryoEngine::isDemo() const { return _gameDescription->flags & ADGF_DEMO; }
Common::Platform CryoEngine::getPlatform() const { return _gameDescription->platform; }
} // End of namespace Cryo
class CryoMetaEngineConnect : public AdvancedMetaEngineConnect {
public:
const char *getName() const override {
return "cryo";
}
bool hasFeature(MetaEngineFeature f) const override;
bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
};
bool CryoMetaEngineConnect::hasFeature(MetaEngineFeature f) const {
return false;
}
bool CryoMetaEngineConnect::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
if (desc) {
*engine = new Cryo::CryoEngine(syst, desc);
}
return desc != 0;
}
#if PLUGIN_ENABLED_DYNAMIC(CRYO)
REGISTER_PLUGIN_DYNAMIC(CRYO, PLUGIN_TYPE_ENGINE, CryoMetaEngineConnect);
#else
REGISTER_PLUGIN_STATIC(CRYO, PLUGIN_TYPE_ENGINE, CryoMetaEngineConnect);
#endif

View File

@ -4,9 +4,9 @@ MODULE_OBJS = \
cryo.o \
cryolib.o \
debugger.o \
detection.o \
eden.o \
eden_graphics.o \
metaengine.o \
resource.o \
sound.o \
video.o
@ -18,3 +18,6 @@ endif
# Include common rules
include $(srcdir)/rules.mk
# Detection objects
DETECT_OBJS += $(MODULE)/detection.o