Patch #1825276: "DETECTION: advanced detector engine simplification"

svn-id: r29386
This commit is contained in:
Eugene Sandulenko 2007-11-03 21:06:58 +00:00
parent c069051492
commit c640d1c604
34 changed files with 101 additions and 281 deletions

View file

@ -139,19 +139,21 @@ static const Common::ADParams detectionParams = {
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");
namespace Saga {
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.bottom = getDisplayInfo().logicalHeight;