aboutsummaryrefslogtreecommitdiff
path: root/engines/saga
diff options
context:
space:
mode:
authorEugene Sandulenko2007-11-03 21:06:58 +0000
committerEugene Sandulenko2007-11-03 21:06:58 +0000
commitc640d1c604f219a5be5412d6c5ea8a85f44ec4b4 (patch)
tree5d6efb4954efb93e4d6e2f71a37486a666ee20ce /engines/saga
parentc06905149286c3fbd803d3ca7522bbe66a6ad129 (diff)
downloadscummvm-rg350-c640d1c604f219a5be5412d6c5ea8a85f44ec4b4.tar.gz
scummvm-rg350-c640d1c604f219a5be5412d6c5ea8a85f44ec4b4.tar.bz2
scummvm-rg350-c640d1c604f219a5be5412d6c5ea8a85f44ec4b4.zip
Patch #1825276: "DETECTION: advanced detector engine simplification"
svn-id: r29386
Diffstat (limited to 'engines/saga')
-rw-r--r--engines/saga/detection.cpp16
-rw-r--r--engines/saga/saga.cpp4
-rw-r--r--engines/saga/saga.h2
3 files changed, 12 insertions, 10 deletions
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index 2ca1ae4482..95a2cd297d 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -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;
diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp
index 4cd0c1a381..2723551d94 100644
--- a/engines/saga/saga.cpp
+++ b/engines/saga/saga.cpp
@@ -59,8 +59,8 @@ namespace Saga {
#define MAX_TIME_DELTA 100
-SagaEngine::SagaEngine(OSystem *syst)
- : Engine(syst) {
+SagaEngine::SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc)
+ : Engine(syst), _gameDescription(gameDesc) {
_leftMouseButtonPressed = _rightMouseButtonPressed = false;
diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index 0879d15a0d..cac2b911db 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -504,7 +504,7 @@ protected:
int go();
int init();
public:
- SagaEngine(OSystem *syst);
+ SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc);
virtual ~SagaEngine();
void shutDown() { _quit = true; }