Patch #1825276: "DETECTION: advanced detector engine simplification"
svn-id: r29386
This commit is contained in:
parent
c069051492
commit
c640d1c604
34 changed files with 101 additions and 281 deletions
|
@ -70,7 +70,7 @@ GameList gameIDList(const Common::ADParams ¶ms) {
|
||||||
return GameList(params.list);
|
return GameList(params.list);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void upgradeTargetIfNecessary(const Common::ADParams ¶ms) {
|
void upgradeTargetIfNecessary(const Common::ADParams ¶ms) {
|
||||||
if (params.obsoleteList == 0)
|
if (params.obsoleteList == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -264,43 +264,6 @@ EncapsulatedADGameDesc detectBestMatchingGame(
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginError detectGameForEngineCreation(
|
|
||||||
const Common::ADParams ¶ms
|
|
||||||
) {
|
|
||||||
|
|
||||||
upgradeTargetIfNecessary(params);
|
|
||||||
|
|
||||||
Common::String gameid = ConfMan.get("gameid");
|
|
||||||
|
|
||||||
FSList fslist;
|
|
||||||
FilesystemNode dir(ConfMan.get("path"));
|
|
||||||
if (!dir.getChildren(fslist, FilesystemNode::kListFilesOnly)) {
|
|
||||||
return kInvalidPathError;
|
|
||||||
}
|
|
||||||
|
|
||||||
ADGameDescList matches = detectGame(&fslist, params, Common::UNK_LANG, Common::kPlatformUnknown);
|
|
||||||
|
|
||||||
// We have single ID set, so we have a game if there are hits
|
|
||||||
if (params.singleid != NULL && matches.size())
|
|
||||||
return kNoError;
|
|
||||||
|
|
||||||
for (uint i = 0; i < matches.size(); i++) {
|
|
||||||
if (matches[i]->gameid == gameid) {
|
|
||||||
return kNoError;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use fallback detector if there were no matches by other means
|
|
||||||
if (params.fallbackDetectFunc != NULL) {
|
|
||||||
EncapsulatedADGameDesc fallbackDesc = (*params.fallbackDetectFunc)(&fslist);
|
|
||||||
if (fallbackDesc.realDesc != 0 && (params.singleid != NULL || fallbackDesc.getGameID() == gameid)) {
|
|
||||||
return kNoError;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return kNoGameDataFoundError;
|
|
||||||
}
|
|
||||||
|
|
||||||
void reportUnknown(StringMap &filesMD5, HashMap<String, int32, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> &filesSize) {
|
void reportUnknown(StringMap &filesMD5, HashMap<String, int32, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> &filesSize) {
|
||||||
// TODO: This message should be cleaned up / made more specific.
|
// TODO: This message should be cleaned up / made more specific.
|
||||||
// For example, we should specify at least which engine triggered this.
|
// For example, we should specify at least which engine triggered this.
|
||||||
|
|
|
@ -236,22 +236,13 @@ GameList detectAllGames(const FSList &fslist, const Common::ADParams ¶ms);
|
||||||
// FIXME/TODO: Rename this function to something more sensible.
|
// FIXME/TODO: Rename this function to something more sensible.
|
||||||
EncapsulatedADGameDesc detectBestMatchingGame(const Common::ADParams ¶ms);
|
EncapsulatedADGameDesc detectBestMatchingGame(const Common::ADParams ¶ms);
|
||||||
|
|
||||||
// FIXME/TODO: Rename this function to something more sensible.
|
void upgradeTargetIfNecessary(const Common::ADParams ¶ms);
|
||||||
// Only used by ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_FUNC
|
|
||||||
PluginError detectGameForEngineCreation(const Common::ADParams ¶ms);
|
|
||||||
|
|
||||||
|
// FIXME/TODO: Rename this function to something more sensible.
|
||||||
// Helper function to announce an unknown version of the game (useful for
|
// Helper function to announce an unknown version of the game (useful for
|
||||||
// fallback detection functions).
|
// fallback detection functions).
|
||||||
void reportUnknown(StringList &files, int md5Bytes);
|
void reportUnknown(StringList &files, int md5Bytes);
|
||||||
|
|
||||||
// FIXME: It would probably be good to merge detectBestMatchingGame
|
|
||||||
// and detectGameForEngineCreation into a single function. Right now, the
|
|
||||||
// detection code called priort to creating an engine instance
|
|
||||||
// (i.e. detectGameForEngineCreation) differs from the detection code the
|
|
||||||
// engines call internally (i.e. detectBestMatchingGame). This could lead
|
|
||||||
// to hard to debug and odd errors.
|
|
||||||
|
|
||||||
|
|
||||||
} // End of namespace AdvancedDetector
|
} // End of namespace AdvancedDetector
|
||||||
|
|
||||||
|
|
||||||
|
@ -267,22 +258,11 @@ void reportUnknown(StringList &files, int md5Bytes);
|
||||||
} \
|
} \
|
||||||
void dummyFuncToAllowTrailingSemicolon()
|
void dummyFuncToAllowTrailingSemicolon()
|
||||||
|
|
||||||
#define _ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_PREDEFINED_FUNC(engine,factoryFunc,params) \
|
#define ADVANCED_DETECTOR_DEFINE_PLUGIN(engine,factoryFunc,params) \
|
||||||
_ADVANCED_DETECTOR_DEFINE_PLUGIN_HEAD(engine,params); \
|
|
||||||
PluginError Engine_##engine##_create(OSystem *syst, Engine **engine) { \
|
|
||||||
assert(syst); \
|
|
||||||
assert(engine); \
|
|
||||||
PluginError err = Common::AdvancedDetector::detectGameForEngineCreation(params); \
|
|
||||||
if (err == kNoError) \
|
|
||||||
*engine = factoryFunc(syst); \
|
|
||||||
return err; \
|
|
||||||
} \
|
|
||||||
void dummyFuncToAllowTrailingSemicolon()
|
|
||||||
|
|
||||||
#define ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(engine,factoryFunc,params) \
|
|
||||||
_ADVANCED_DETECTOR_DEFINE_PLUGIN_HEAD(engine,params); \
|
_ADVANCED_DETECTOR_DEFINE_PLUGIN_HEAD(engine,params); \
|
||||||
PluginError Engine_##engine##_create(OSystem *syst, Engine **engine) { \
|
PluginError Engine_##engine##_create(OSystem *syst, Engine **engine) { \
|
||||||
assert(engine); \
|
assert(engine); \
|
||||||
|
Common::AdvancedDetector::upgradeTargetIfNecessary(params); \
|
||||||
Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(params); \
|
Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(params); \
|
||||||
if (encapsulatedDesc.realDesc == 0) { \
|
if (encapsulatedDesc.realDesc == 0) { \
|
||||||
return kNoGameDataFoundError; \
|
return kNoGameDataFoundError; \
|
||||||
|
@ -294,14 +274,6 @@ void reportUnknown(StringList &files, int md5Bytes);
|
||||||
} \
|
} \
|
||||||
void dummyFuncToAllowTrailingSemicolon()
|
void dummyFuncToAllowTrailingSemicolon()
|
||||||
|
|
||||||
#define ADVANCED_DETECTOR_DEFINE_PLUGIN(engine,className,params) \
|
|
||||||
static Engine *engine##_createInstance(OSystem *syst) { \
|
|
||||||
return new className(syst); \
|
|
||||||
} \
|
|
||||||
_ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_PREDEFINED_FUNC(engine,engine##_createInstance,params); \
|
|
||||||
void dummyFuncToAllowTrailingSemicolon()
|
|
||||||
|
|
||||||
|
|
||||||
} // End of namespace Common
|
} // End of namespace Common
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -605,11 +605,11 @@ AgiButtonStyle::AgiButtonStyle(Common::RenderMode renderMode) {
|
||||||
setAmigaStyle(renderMode == Common::kRenderAmiga);
|
setAmigaStyle(renderMode == Common::kRenderAmiga);
|
||||||
}
|
}
|
||||||
|
|
||||||
AgiBase::AgiBase(OSystem *syst) : Engine(syst) {
|
AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AgiEngine::AgiEngine(OSystem *syst) : AgiBase(syst) {
|
AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) {
|
||||||
|
|
||||||
// Setup mixer
|
// Setup mixer
|
||||||
if (!_mixer->isReady()) {
|
if (!_mixer->isReady()) {
|
||||||
|
@ -783,13 +783,6 @@ AgiEngine::~AgiEngine() {
|
||||||
|
|
||||||
int AgiEngine::init() {
|
int AgiEngine::init() {
|
||||||
|
|
||||||
// Detect game
|
|
||||||
if (!initGame()) {
|
|
||||||
GUIErrorMessage("No valid games were found in the specified directory.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Initialize backend
|
// Initialize backend
|
||||||
_system->beginGFXTransaction();
|
_system->beginGFXTransaction();
|
||||||
initCommonGFX(false);
|
initCommonGFX(false);
|
||||||
|
|
|
@ -656,7 +656,7 @@ public:
|
||||||
virtual int agiGetKeypressLow() = 0;
|
virtual int agiGetKeypressLow() = 0;
|
||||||
virtual int agiIsKeypressLow() = 0;
|
virtual int agiIsKeypressLow() = 0;
|
||||||
|
|
||||||
AgiBase(OSystem *syst);
|
AgiBase(OSystem *syst, const AGIGameDescription *gameDesc);
|
||||||
|
|
||||||
#define INITIAL_IMAGE_STACK_SIZE 32
|
#define INITIAL_IMAGE_STACK_SIZE 32
|
||||||
|
|
||||||
|
@ -695,10 +695,8 @@ protected:
|
||||||
void shutdown();
|
void shutdown();
|
||||||
void initialize();
|
void initialize();
|
||||||
|
|
||||||
bool initGame();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AgiEngine(OSystem *syst);
|
AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc);
|
||||||
virtual ~AgiEngine();
|
virtual ~AgiEngine();
|
||||||
int getGameId() {
|
int getGameId() {
|
||||||
return _gameId;
|
return _gameId;
|
||||||
|
|
|
@ -2253,13 +2253,13 @@ bool engineCreateAgi(OSystem *syst, Engine **engine, Common::EncapsulatedADGameD
|
||||||
|
|
||||||
switch (gd->gameType) {
|
switch (gd->gameType) {
|
||||||
case Agi::GType_PreAGI:
|
case Agi::GType_PreAGI:
|
||||||
*engine = new Agi::PreAgiEngine(syst);
|
*engine = new Agi::PreAgiEngine(syst, gd);
|
||||||
break;
|
break;
|
||||||
case Agi::GType_V2:
|
case Agi::GType_V2:
|
||||||
*engine = new Agi::AgiEngine(syst);
|
*engine = new Agi::AgiEngine(syst, gd);
|
||||||
break;
|
break;
|
||||||
case Agi::GType_V3:
|
case Agi::GType_V3:
|
||||||
*engine = new Agi::AgiEngine(syst);
|
*engine = new Agi::AgiEngine(syst, gd);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
res = false;
|
res = false;
|
||||||
|
@ -2269,25 +2269,7 @@ bool engineCreateAgi(OSystem *syst, Engine **engine, Common::EncapsulatedADGameD
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(AGI, engineCreateAgi, detectionParams);
|
ADVANCED_DETECTOR_DEFINE_PLUGIN(AGI, engineCreateAgi, detectionParams);
|
||||||
|
|
||||||
REGISTER_PLUGIN(AGI, "AGI preAGI + v2 + v3 Engine", "Sierra AGI Engine (C) Sierra On-Line Software");
|
REGISTER_PLUGIN(AGI, "AGI preAGI + v2 + v3 Engine", "Sierra AGI Engine (C) Sierra On-Line Software");
|
||||||
|
|
||||||
namespace Agi {
|
|
||||||
|
|
||||||
bool AgiEngine::initGame() {
|
|
||||||
Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
|
|
||||||
_gameDescription = (const AGIGameDescription *)(encapsulatedDesc.realDesc);
|
|
||||||
|
|
||||||
return (_gameDescription != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool PreAgiEngine::initGame() {
|
|
||||||
Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
|
|
||||||
_gameDescription = (const AGIGameDescription *)(encapsulatedDesc.realDesc);
|
|
||||||
|
|
||||||
return (_gameDescription != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // End of namespace Agi
|
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
namespace Agi {
|
namespace Agi {
|
||||||
|
|
||||||
PreAgiEngine::PreAgiEngine(OSystem *syst) : AgiBase(syst) {
|
PreAgiEngine::PreAgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) {
|
||||||
|
|
||||||
// Setup mixer
|
// Setup mixer
|
||||||
if (!_mixer->isReady()) {
|
if (!_mixer->isReady()) {
|
||||||
|
@ -195,13 +195,6 @@ PreAgiEngine::~PreAgiEngine() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int PreAgiEngine::init() {
|
int PreAgiEngine::init() {
|
||||||
|
|
||||||
// Detect game
|
|
||||||
if (!initGame()) {
|
|
||||||
GUIErrorMessage("No valid games were found in the specified directory.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize backend
|
// Initialize backend
|
||||||
_system->beginGFXTransaction();
|
_system->beginGFXTransaction();
|
||||||
initCommonGFX(false);
|
initCommonGFX(false);
|
||||||
|
|
|
@ -40,14 +40,12 @@ protected:
|
||||||
void shutdown();
|
void shutdown();
|
||||||
void initialize();
|
void initialize();
|
||||||
|
|
||||||
bool initGame();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void agiTimerLow() {}
|
void agiTimerLow() {}
|
||||||
int agiGetKeypressLow() { return 0; }
|
int agiGetKeypressLow() { return 0; }
|
||||||
int agiIsKeypressLow() { return 0; }
|
int agiIsKeypressLow() { return 0; }
|
||||||
|
|
||||||
PreAgiEngine(OSystem *syst);
|
PreAgiEngine(OSystem *syst, const AGIGameDescription *gameDesc);
|
||||||
virtual ~PreAgiEngine();
|
virtual ~PreAgiEngine();
|
||||||
int getGameId() {
|
int getGameId() {
|
||||||
return _gameId;
|
return _gameId;
|
||||||
|
|
|
@ -525,12 +525,6 @@ AGOSEngine::AGOSEngine(OSystem *syst)
|
||||||
}
|
}
|
||||||
|
|
||||||
int AGOSEngine::init() {
|
int AGOSEngine::init() {
|
||||||
// Detect game
|
|
||||||
if (!initGame()) {
|
|
||||||
GUIErrorMessage("No valid games were found in the specified directory.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getGameId() == GID_DIMP) {
|
if (getGameId() == GID_DIMP) {
|
||||||
_screenWidth = 496;
|
_screenWidth = 496;
|
||||||
_screenHeight = 400;
|
_screenHeight = 400;
|
||||||
|
|
|
@ -179,7 +179,6 @@ public:
|
||||||
|
|
||||||
const AGOSGameDescription *_gameDescription;
|
const AGOSGameDescription *_gameDescription;
|
||||||
|
|
||||||
bool initGame(void);
|
|
||||||
virtual void setupGame();
|
virtual void setupGame();
|
||||||
|
|
||||||
int getGameId() const;
|
int getGameId() const;
|
||||||
|
|
|
@ -129,24 +129,19 @@ bool engineCreateAgos(OSystem *syst, Engine **engine, Common::EncapsulatedADGame
|
||||||
res = false;
|
res = false;
|
||||||
error("AGOS engine: unknown gameType");
|
error("AGOS engine: unknown gameType");
|
||||||
}
|
}
|
||||||
|
if (res) {
|
||||||
|
((AGOS::AGOSEngine *)*engine)->_gameDescription = gd;
|
||||||
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(AGOS, engineCreateAgos, detectionParams);
|
ADVANCED_DETECTOR_DEFINE_PLUGIN(AGOS, engineCreateAgos, detectionParams);
|
||||||
|
|
||||||
REGISTER_PLUGIN(AGOS, "AGOS", "AGOS (C) Adventure Soft");
|
REGISTER_PLUGIN(AGOS, "AGOS", "AGOS (C) Adventure Soft");
|
||||||
|
|
||||||
namespace AGOS {
|
namespace AGOS {
|
||||||
|
|
||||||
bool AGOSEngine::initGame() {
|
|
||||||
Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
|
|
||||||
_gameDescription = (const AGOSGameDescription *)(encapsulatedDesc.realDesc);
|
|
||||||
|
|
||||||
return (_gameDescription != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int AGOSEngine::getGameId() const {
|
int AGOSEngine::getGameId() const {
|
||||||
return _gameDescription->gameId;
|
return _gameDescription->gameId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ Common::SaveFileManager *g_saveFileMan;
|
||||||
|
|
||||||
CineEngine *g_cine;
|
CineEngine *g_cine;
|
||||||
|
|
||||||
CineEngine::CineEngine(OSystem *syst) : Engine(syst) {
|
CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
|
||||||
Common::addSpecialDebugLevel(kCineDebugScript, "Script", "Script debug level");
|
Common::addSpecialDebugLevel(kCineDebugScript, "Script", "Script debug level");
|
||||||
|
|
||||||
// Setup mixer
|
// Setup mixer
|
||||||
|
@ -74,12 +74,6 @@ CineEngine::~CineEngine() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int CineEngine::init() {
|
int CineEngine::init() {
|
||||||
// Detect game
|
|
||||||
if (!initGame()) {
|
|
||||||
GUIErrorMessage("No valid games were found in the specified directory.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize backend
|
// Initialize backend
|
||||||
_system->beginGFXTransaction();
|
_system->beginGFXTransaction();
|
||||||
initCommonGFX(false);
|
initCommonGFX(false);
|
||||||
|
|
|
@ -71,7 +71,7 @@ protected:
|
||||||
bool initGame();
|
bool initGame();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CineEngine(OSystem *syst);
|
CineEngine(OSystem *syst, const CINEGameDescription *gameDesc);
|
||||||
virtual ~CineEngine();
|
virtual ~CineEngine();
|
||||||
|
|
||||||
int getGameType() const;
|
int getGameType() const;
|
||||||
|
|
|
@ -487,17 +487,14 @@ static const Common::ADParams detectionParams = {
|
||||||
Common::kADFlagAugmentPreferredTarget
|
Common::kADFlagAugmentPreferredTarget
|
||||||
};
|
};
|
||||||
|
|
||||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(CINE, Cine::CineEngine, detectionParams);
|
static bool Engine_CINE_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) {
|
||||||
|
const Cine::CINEGameDescription *gd = (const Cine::CINEGameDescription *)(encapsulatedDesc.realDesc);
|
||||||
REGISTER_PLUGIN(CINE, "Cinematique evo 1 engine", "Future Wars & Operation Stealth (C) Delphine Software");
|
if (gd) {
|
||||||
|
*engine = new Cine::CineEngine(syst, gd);
|
||||||
namespace Cine {
|
}
|
||||||
|
return gd != 0;
|
||||||
bool CineEngine::initGame() {
|
|
||||||
Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
|
|
||||||
_gameDescription = (const CINEGameDescription *)(encapsulatedDesc.realDesc);
|
|
||||||
|
|
||||||
return (_gameDescription != 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of namespace Cine
|
ADVANCED_DETECTOR_DEFINE_PLUGIN(CINE, Engine_CINE_createInstance, detectionParams);
|
||||||
|
|
||||||
|
REGISTER_PLUGIN(CINE, "Cinematique evo 1 engine", "Future Wars & Operation Stealth (C) Delphine Software");
|
||||||
|
|
|
@ -44,7 +44,7 @@ Common::SaveFileManager * g_saveFileMan;
|
||||||
|
|
||||||
CruiseEngine *g_cruise;
|
CruiseEngine *g_cruise;
|
||||||
|
|
||||||
CruiseEngine::CruiseEngine(OSystem * syst) : Engine(syst) {
|
CruiseEngine::CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
|
||||||
|
|
||||||
#ifdef PALMOS_MODE
|
#ifdef PALMOS_MODE
|
||||||
_currentVolumeFile = new Common::File();
|
_currentVolumeFile = new Common::File();
|
||||||
|
@ -75,11 +75,6 @@ CruiseEngine::~CruiseEngine() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int CruiseEngine::init() {
|
int CruiseEngine::init() {
|
||||||
// Detect game
|
|
||||||
if (!initGame()) {
|
|
||||||
GUIErrorMessage ("No valid games were found in the specified directory.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
// Initialize backend
|
// Initialize backend
|
||||||
_system->beginGFXTransaction();
|
_system->beginGFXTransaction();
|
||||||
initCommonGFX(false);
|
initCommonGFX(false);
|
||||||
|
|
|
@ -51,7 +51,7 @@ protected:
|
||||||
bool initGame();
|
bool initGame();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CruiseEngine(OSystem * syst);
|
CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc);
|
||||||
virtual ~ CruiseEngine();
|
virtual ~ CruiseEngine();
|
||||||
|
|
||||||
int getGameType() const;
|
int getGameType() const;
|
||||||
|
|
|
@ -111,17 +111,14 @@ static const Common::ADParams detectionParams = {
|
||||||
Common::kADFlagAugmentPreferredTarget
|
Common::kADFlagAugmentPreferredTarget
|
||||||
};
|
};
|
||||||
|
|
||||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(CRUISE, Cruise::CruiseEngine, detectionParams);
|
static bool Engine_CRUISE_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) {
|
||||||
|
const Cruise::CRUISEGameDescription *gd = (const Cruise::CRUISEGameDescription *)(encapsulatedDesc.realDesc);
|
||||||
REGISTER_PLUGIN(CRUISE, "Cinematique evo 2 engine", "Cruise for a Corpse (C) Delphine Software");
|
if (gd) {
|
||||||
|
*engine = new Cruise::CruiseEngine(syst, gd);
|
||||||
namespace Cruise {
|
}
|
||||||
|
return gd != 0;
|
||||||
bool CruiseEngine::initGame() {
|
|
||||||
Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
|
|
||||||
_gameDescription = (const CRUISEGameDescription *)(encapsulatedDesc.realDesc);
|
|
||||||
|
|
||||||
return (_gameDescription != 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of namespace Cruise
|
ADVANCED_DETECTOR_DEFINE_PLUGIN(CRUISE, Engine_CRUISE_createInstance, detectionParams);
|
||||||
|
|
||||||
|
REGISTER_PLUGIN(CRUISE, "Cinematique evo 2 engine", "Cruise for a Corpse (C) Delphine Software");
|
||||||
|
|
|
@ -164,18 +164,15 @@ static const Common::ADParams detectionParams = {
|
||||||
Common::kADFlagAugmentPreferredTarget
|
Common::kADFlagAugmentPreferredTarget
|
||||||
};
|
};
|
||||||
|
|
||||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(DRASCULA, Drascula::DrasculaEngine, detectionParams);
|
static bool Engine_DRASCULA_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) {
|
||||||
|
const Drascula::DrasculaGameDescription *gd = (const Drascula::DrasculaGameDescription *)(encapsulatedDesc.realDesc);
|
||||||
|
if (gd) {
|
||||||
|
*engine = new Drascula::DrasculaEngine(syst, gd);
|
||||||
|
}
|
||||||
|
return gd != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ADVANCED_DETECTOR_DEFINE_PLUGIN(DRASCULA, Engine_DRASCULA_createInstance, detectionParams);
|
||||||
|
|
||||||
REGISTER_PLUGIN(DRASCULA, "Drascula Engine", "Drascula Engine (C) 2000 Alcachofa Soft, 1996 (C) Digital Dreams Multimedia, 1994 (C) Emilio de Paz");
|
REGISTER_PLUGIN(DRASCULA, "Drascula Engine", "Drascula Engine (C) 2000 Alcachofa Soft, 1996 (C) Digital Dreams Multimedia, 1994 (C) Emilio de Paz");
|
||||||
|
|
||||||
namespace Drascula {
|
|
||||||
|
|
||||||
bool DrasculaEngine::initGame() {
|
|
||||||
Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
|
|
||||||
_gameDescription = (const DrasculaGameDescription *)(encapsulatedDesc.realDesc);
|
|
||||||
|
|
||||||
return (_gameDescription != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // End of namespace Drascula
|
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ static const GameSettings drasculaSettings[] = {
|
||||||
{NULL, NULL, 0, 0, NULL}
|
{NULL, NULL, 0, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
DrasculaEngine::DrasculaEngine(OSystem *syst) : Engine(syst) {
|
DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
|
||||||
|
|
||||||
// Setup mixer
|
// Setup mixer
|
||||||
if (!_mixer->isReady()) {
|
if (!_mixer->isReady()) {
|
||||||
|
@ -119,12 +119,6 @@ static char poder_t[6][88] = {TEXT11, TEXT109, TEXT111, TEXT110, TEXT115, TEXT11
|
||||||
static char poder_v[6][14] = {"11.als", "109.als", "111.als", "110.als", "115.als", "116.als"};
|
static char poder_v[6][14] = {"11.als", "109.als", "111.als", "110.als", "115.als", "116.als"};
|
||||||
|
|
||||||
int DrasculaEngine::init() {
|
int DrasculaEngine::init() {
|
||||||
// Detect game
|
|
||||||
if (!initGame()) {
|
|
||||||
GUIErrorMessage("No valid games were found in the specified directory.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize backend
|
// Initialize backend
|
||||||
_system->beginGFXTransaction();
|
_system->beginGFXTransaction();
|
||||||
initCommonGFX(false);
|
initCommonGFX(false);
|
||||||
|
|
|
@ -337,10 +337,8 @@ protected:
|
||||||
int go();
|
int go();
|
||||||
// void shutdown();
|
// void shutdown();
|
||||||
|
|
||||||
bool initGame();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DrasculaEngine(OSystem *syst);
|
DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gameDesc);
|
||||||
virtual ~DrasculaEngine();
|
virtual ~DrasculaEngine();
|
||||||
int getGameId() {
|
int getGameId() {
|
||||||
return _gameId;
|
return _gameId;
|
||||||
|
|
|
@ -1701,20 +1701,22 @@ static const ADParams detectionParams = {
|
||||||
kADFlagAugmentPreferredTarget
|
kADFlagAugmentPreferredTarget
|
||||||
};
|
};
|
||||||
|
|
||||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(GOB, Gob::GobEngine, detectionParams);
|
static bool Engine_GOB_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) {
|
||||||
|
const Gob::GOBGameDescription *gd = (const Gob::GOBGameDescription *)(encapsulatedDesc.realDesc);
|
||||||
|
if (gd) {
|
||||||
|
*engine = new Gob::GobEngine(syst);
|
||||||
|
((Gob::GobEngine *)*engine)->initGame(gd);
|
||||||
|
}
|
||||||
|
return gd != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ADVANCED_DETECTOR_DEFINE_PLUGIN(GOB, Engine_GOB_createInstance, detectionParams);
|
||||||
|
|
||||||
REGISTER_PLUGIN(GOB, "Gob Engine", "Goblins Games (C) Coktel Vision");
|
REGISTER_PLUGIN(GOB, "Gob Engine", "Goblins Games (C) Coktel Vision");
|
||||||
|
|
||||||
|
|
||||||
namespace Gob {
|
namespace Gob {
|
||||||
|
|
||||||
bool GobEngine::detectGame() {
|
void GobEngine::initGame(const GOBGameDescription *gd) {
|
||||||
Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
|
|
||||||
const GOBGameDescription *gd = (const GOBGameDescription *)(encapsulatedDesc.realDesc);
|
|
||||||
|
|
||||||
if (gd == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (gd->startTotBase == 0) {
|
if (gd->startTotBase == 0) {
|
||||||
_startTot = new char[10];
|
_startTot = new char[10];
|
||||||
_startTot0 = new char[11];
|
_startTot0 = new char[11];
|
||||||
|
@ -1733,8 +1735,6 @@ bool GobEngine::detectGame() {
|
||||||
_features = gd->features;
|
_features = gd->features;
|
||||||
_language = gd->desc.language;
|
_language = gd->desc.language;
|
||||||
_platform = gd->desc.platform;
|
_platform = gd->desc.platform;
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of namespace Gob
|
} // End of namespace Gob
|
||||||
|
|
|
@ -145,12 +145,6 @@ void GobEngine::validateVideoMode(int16 videoMode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int GobEngine::init() {
|
int GobEngine::init() {
|
||||||
// Detect game
|
|
||||||
if (!detectGame()) {
|
|
||||||
GUIErrorMessage("No valid games were found in the specified directory.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!initGameParts()) {
|
if (!initGameParts()) {
|
||||||
GUIErrorMessage("GobEngine::init(): Unknown version of game engine");
|
GUIErrorMessage("GobEngine::init(): Unknown version of game engine");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -167,6 +167,8 @@ private:
|
||||||
friend class Ptr;
|
friend class Ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct GOBGameDescription;
|
||||||
|
|
||||||
class GobEngine : public Engine {
|
class GobEngine : public Engine {
|
||||||
protected:
|
protected:
|
||||||
GobEngine *_vm;
|
GobEngine *_vm;
|
||||||
|
@ -177,8 +179,6 @@ protected:
|
||||||
bool initGameParts();
|
bool initGameParts();
|
||||||
void deinitGameParts();
|
void deinitGameParts();
|
||||||
|
|
||||||
bool detectGame();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const Common::Language _gobToScummVMLang[];
|
static const Common::Language _gobToScummVMLang[];
|
||||||
|
|
||||||
|
@ -237,6 +237,8 @@ public:
|
||||||
|
|
||||||
GobEngine(OSystem *syst);
|
GobEngine(OSystem *syst);
|
||||||
virtual ~GobEngine();
|
virtual ~GobEngine();
|
||||||
|
|
||||||
|
void initGame(const GOBGameDescription *gd);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of namespace Gob
|
} // End of namespace Gob
|
||||||
|
|
|
@ -436,7 +436,7 @@ bool engineCreateKyra(OSystem *syst, Engine **engine, Common::EncapsulatedADGame
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(KYRA, engineCreateKyra, detectionParams);
|
ADVANCED_DETECTOR_DEFINE_PLUGIN(KYRA, engineCreateKyra, detectionParams);
|
||||||
|
|
||||||
REGISTER_PLUGIN(KYRA, "Legend of Kyrandia Engine", "The Legend of Kyrandia (C) Westwood Studios");
|
REGISTER_PLUGIN(KYRA, "Legend of Kyrandia Engine", "The Legend of Kyrandia (C) Westwood Studios");
|
||||||
|
|
||||||
|
|
|
@ -184,16 +184,16 @@ static const Common::ADParams detectionParams = {
|
||||||
Common::kADFlagAugmentPreferredTarget
|
Common::kADFlagAugmentPreferredTarget
|
||||||
};
|
};
|
||||||
|
|
||||||
bool engineCreateParallaction(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) {
|
static bool Engine_PARALLACTION_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) {
|
||||||
const Parallaction::PARALLACTIONGameDescription *gd = (const Parallaction::PARALLACTIONGameDescription *)(encapsulatedDesc.realDesc);
|
const Parallaction::PARALLACTIONGameDescription *gd = (const Parallaction::PARALLACTIONGameDescription *)(encapsulatedDesc.realDesc);
|
||||||
bool res = true;
|
bool res = true;
|
||||||
|
|
||||||
switch (gd->gameType) {
|
switch (gd->gameType) {
|
||||||
case Parallaction::GType_Nippon:
|
case Parallaction::GType_Nippon:
|
||||||
*engine = new Parallaction::Parallaction_ns(syst);
|
*engine = new Parallaction::Parallaction_ns(syst, gd);
|
||||||
break;
|
break;
|
||||||
case Parallaction::GType_BRA:
|
case Parallaction::GType_BRA:
|
||||||
*engine = new Parallaction::Parallaction_br(syst);
|
*engine = new Parallaction::Parallaction_br(syst, gd);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
res = false;
|
res = false;
|
||||||
|
@ -203,18 +203,6 @@ bool engineCreateParallaction(OSystem *syst, Engine **engine, Common::Encapsulat
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(PARALLACTION, engineCreateParallaction, detectionParams);
|
ADVANCED_DETECTOR_DEFINE_PLUGIN(PARALLACTION, Engine_PARALLACTION_createInstance, detectionParams);
|
||||||
|
|
||||||
REGISTER_PLUGIN(PARALLACTION, "Parallaction engine", "Nippon Safes Inc. (C) Dynabyte");
|
REGISTER_PLUGIN(PARALLACTION, "Parallaction engine", "Nippon Safes Inc. (C) Dynabyte");
|
||||||
|
|
||||||
|
|
||||||
namespace Parallaction {
|
|
||||||
|
|
||||||
bool Parallaction::detectGame() {
|
|
||||||
Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
|
|
||||||
_gameDescription = (const PARALLACTIONGameDescription *)(encapsulatedDesc.realDesc);
|
|
||||||
|
|
||||||
return (_gameDescription != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // End of namespace Parallaction
|
|
||||||
|
|
|
@ -91,8 +91,8 @@ static Job *_jDrawInventory = NULL;
|
||||||
static Job *_jRunScripts = NULL;
|
static Job *_jRunScripts = NULL;
|
||||||
|
|
||||||
|
|
||||||
Parallaction::Parallaction(OSystem *syst) :
|
Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc) :
|
||||||
Engine(syst), _char(this) {
|
Engine(syst), _gameDescription(gameDesc), _char(this) {
|
||||||
|
|
||||||
// FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what
|
// FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what
|
||||||
// needs fixing, or remove it!
|
// needs fixing, or remove it!
|
||||||
|
|
|
@ -363,7 +363,7 @@ class Parallaction : public Engine {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Parallaction(OSystem *syst);
|
Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc);
|
||||||
~Parallaction();
|
~Parallaction();
|
||||||
|
|
||||||
int init();
|
int init();
|
||||||
|
@ -640,7 +640,7 @@ public:
|
||||||
class Parallaction_ns : public Parallaction {
|
class Parallaction_ns : public Parallaction {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Parallaction_ns(OSystem* syst) : Parallaction(syst) { }
|
Parallaction_ns(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction(syst, gameDesc) { }
|
||||||
~Parallaction_ns();
|
~Parallaction_ns();
|
||||||
|
|
||||||
int init();
|
int init();
|
||||||
|
@ -922,7 +922,7 @@ class Parallaction_br : public Parallaction_ns {
|
||||||
typedef Parallaction_ns Super;
|
typedef Parallaction_ns Super;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Parallaction_br(OSystem* syst) : Parallaction_ns(syst) { }
|
Parallaction_br(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction_ns(syst, gameDesc) { }
|
||||||
~Parallaction_br();
|
~Parallaction_br();
|
||||||
|
|
||||||
int init();
|
int init();
|
||||||
|
|
|
@ -59,12 +59,6 @@ const char *partFirstLocation[] = {
|
||||||
|
|
||||||
int Parallaction_br::init() {
|
int Parallaction_br::init() {
|
||||||
|
|
||||||
// Detect game
|
|
||||||
if (!detectGame()) {
|
|
||||||
GUIErrorMessage("No valid games were found in the specified directory.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
_screenWidth = 640;
|
_screenWidth = 640;
|
||||||
_screenHeight = 400;
|
_screenHeight = 400;
|
||||||
|
|
||||||
|
|
|
@ -111,12 +111,6 @@ void LocationName::bind(const char *s) {
|
||||||
|
|
||||||
int Parallaction_ns::init() {
|
int Parallaction_ns::init() {
|
||||||
|
|
||||||
// Detect game
|
|
||||||
if (!detectGame()) {
|
|
||||||
GUIErrorMessage("No valid games were found in the specified directory.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
_screenWidth = 320;
|
_screenWidth = 320;
|
||||||
_screenHeight = 200;
|
_screenHeight = 200;
|
||||||
|
|
||||||
|
|
|
@ -139,19 +139,21 @@ static const Common::ADParams detectionParams = {
|
||||||
Common::kADFlagAugmentPreferredTarget
|
Common::kADFlagAugmentPreferredTarget
|
||||||
};
|
};
|
||||||
|
|
||||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(SAGA, Saga::SagaEngine, detectionParams);
|
static bool Engine_SAGA_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) {
|
||||||
|
const Saga::SAGAGameDescription *gd = (const Saga::SAGAGameDescription *)(encapsulatedDesc.realDesc);
|
||||||
|
if (gd) {
|
||||||
|
*engine = new Saga::SagaEngine(syst, gd);
|
||||||
|
}
|
||||||
|
return gd != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ADVANCED_DETECTOR_DEFINE_PLUGIN(SAGA, Engine_SAGA_createInstance, detectionParams);
|
||||||
|
|
||||||
REGISTER_PLUGIN(SAGA, "SAGA Engine", "Inherit the Earth (C) Wyrmkeep Entertainment");
|
REGISTER_PLUGIN(SAGA, "SAGA Engine", "Inherit the Earth (C) Wyrmkeep Entertainment");
|
||||||
|
|
||||||
namespace Saga {
|
namespace Saga {
|
||||||
|
|
||||||
bool SagaEngine::initGame() {
|
bool SagaEngine::initGame() {
|
||||||
Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
|
|
||||||
_gameDescription = (const SAGAGameDescription *)(encapsulatedDesc.realDesc);
|
|
||||||
|
|
||||||
if (_gameDescription == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
_displayClip.right = getDisplayInfo().logicalWidth;
|
_displayClip.right = getDisplayInfo().logicalWidth;
|
||||||
_displayClip.bottom = getDisplayInfo().logicalHeight;
|
_displayClip.bottom = getDisplayInfo().logicalHeight;
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,8 @@ namespace Saga {
|
||||||
|
|
||||||
#define MAX_TIME_DELTA 100
|
#define MAX_TIME_DELTA 100
|
||||||
|
|
||||||
SagaEngine::SagaEngine(OSystem *syst)
|
SagaEngine::SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc)
|
||||||
: Engine(syst) {
|
: Engine(syst), _gameDescription(gameDesc) {
|
||||||
|
|
||||||
_leftMouseButtonPressed = _rightMouseButtonPressed = false;
|
_leftMouseButtonPressed = _rightMouseButtonPressed = false;
|
||||||
|
|
||||||
|
|
|
@ -504,7 +504,7 @@ protected:
|
||||||
int go();
|
int go();
|
||||||
int init();
|
int init();
|
||||||
public:
|
public:
|
||||||
SagaEngine(OSystem *syst);
|
SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc);
|
||||||
virtual ~SagaEngine();
|
virtual ~SagaEngine();
|
||||||
void shutDown() { _quit = true; }
|
void shutDown() { _quit = true; }
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ static const Common::ADFileBasedFallback fileBasedFallback[] = {
|
||||||
{ 0, { 0 } }
|
{ 0, { 0 } }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
} // End of namespace Touche
|
||||||
|
|
||||||
static const Common::ADParams detectionParams = {
|
static const Common::ADParams detectionParams = {
|
||||||
(const byte *)Touche::gameDescriptions,
|
(const byte *)Touche::gameDescriptions,
|
||||||
|
@ -124,21 +124,14 @@ static const Common::ADParams detectionParams = {
|
||||||
Common::kADFlagAugmentPreferredTarget | Common::kADFlagPrintWarningOnFileBasedFallback
|
Common::kADFlagAugmentPreferredTarget | Common::kADFlagPrintWarningOnFileBasedFallback
|
||||||
};
|
};
|
||||||
|
|
||||||
ADVANCED_DETECTOR_DEFINE_PLUGIN(TOUCHE, Touche::ToucheEngine, detectionParams);
|
static bool Engine_TOUCHE_createInstance(OSystem *syst, Engine **engine, const Common::EncapsulatedADGameDesc &encapsulatedDesc) {
|
||||||
|
|
||||||
REGISTER_PLUGIN(TOUCHE, "Touche Engine", "Touche: The Adventures of the 5th Musketeer (C) Clipper Software");
|
|
||||||
|
|
||||||
namespace Touche {
|
|
||||||
|
|
||||||
bool ToucheEngine::detectGame() {
|
|
||||||
Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);
|
|
||||||
const Common::ADGameDescription *gd = encapsulatedDesc.realDesc;
|
const Common::ADGameDescription *gd = encapsulatedDesc.realDesc;
|
||||||
|
if (gd) {
|
||||||
if (gd == 0)
|
*engine = new Touche::ToucheEngine(syst, gd->language);
|
||||||
return false;
|
}
|
||||||
|
return gd != 0;
|
||||||
_language = gd->language;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of namespace Touche
|
ADVANCED_DETECTOR_DEFINE_PLUGIN(TOUCHE, Engine_TOUCHE_createInstance, detectionParams);
|
||||||
|
|
||||||
|
REGISTER_PLUGIN(TOUCHE, "Touche Engine", "Touche: The Adventures of the 5th Musketeer (C) Clipper Software");
|
||||||
|
|
|
@ -37,8 +37,8 @@
|
||||||
|
|
||||||
namespace Touche {
|
namespace Touche {
|
||||||
|
|
||||||
ToucheEngine::ToucheEngine(OSystem *system)
|
ToucheEngine::ToucheEngine(OSystem *system, Common::Language language)
|
||||||
: Engine(system), _midiPlayer(0) {
|
: Engine(system), _midiPlayer(0), _language(language) {
|
||||||
|
|
||||||
_saveLoadCurrentPage = 0;
|
_saveLoadCurrentPage = 0;
|
||||||
_saveLoadCurrentSlot = 0;
|
_saveLoadCurrentSlot = 0;
|
||||||
|
@ -87,12 +87,6 @@ int ToucheEngine::init() {
|
||||||
_system->initSize(kScreenWidth, kScreenHeight);
|
_system->initSize(kScreenWidth, kScreenHeight);
|
||||||
_system->endGFXTransaction();
|
_system->endGFXTransaction();
|
||||||
|
|
||||||
// Detect game
|
|
||||||
if (!detectGame()) {
|
|
||||||
GUIErrorMessage("No valid games were found in the specified directory.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
Graphics::setupFont(_language);
|
Graphics::setupFont(_language);
|
||||||
|
|
||||||
setupOpcodes();
|
setupOpcodes();
|
||||||
|
|
|
@ -351,7 +351,7 @@ public:
|
||||||
|
|
||||||
typedef void (ToucheEngine::*OpcodeProc)();
|
typedef void (ToucheEngine::*OpcodeProc)();
|
||||||
|
|
||||||
ToucheEngine(OSystem *system);
|
ToucheEngine(OSystem *system, Common::Language language);
|
||||||
virtual ~ToucheEngine();
|
virtual ~ToucheEngine();
|
||||||
|
|
||||||
virtual int init();
|
virtual int init();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue