Ticket #8741: advdetector-svn29385.diff
File advdetector-svn29385.diff, 29.7 KB (added by , 17 years ago) |
---|
-
engines/touche/detection.cpp
110 110 { 0, { 0 } } 111 111 }; 112 112 113 } 113 } // End of namespace Touche 114 114 115 115 static const Common::ADParams detectionParams = { 116 116 (const byte *)Touche::gameDescriptions, … … 124 124 Common::kADFlagAugmentPreferredTarget | Common::kADFlagPrintWarningOnFileBasedFallback 125 125 }; 126 126 127 ADVANCED_DETECTOR_DEFINE_PLUGIN(TOUCHE, Touche::ToucheEngine, detectionParams); 128 129 REGISTER_PLUGIN(TOUCHE, "Touche Engine", "Touche: The Adventures of the 5th Musketeer (C) Clipper Software"); 130 131 namespace Touche { 132 133 bool ToucheEngine::detectGame() { 134 Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); 127 static bool Engine_TOUCHE_createInstance(OSystem *syst, Engine **engine, const Common::EncapsulatedADGameDesc &encapsulatedDesc) { 135 128 const Common::ADGameDescription *gd = encapsulatedDesc.realDesc; 136 137 if (gd == 0) 138 return false; 139 140 _language = gd->language; 141 return true; 129 if (gd) { 130 *engine = new Touche::ToucheEngine(syst, gd->language); 131 } 132 return gd != 0; 142 133 } 143 134 144 } // End of namespace Touche 135 ADVANCED_DETECTOR_DEFINE_PLUGIN(TOUCHE, Engine_TOUCHE_createInstance, detectionParams); 136 137 REGISTER_PLUGIN(TOUCHE, "Touche Engine", "Touche: The Adventures of the 5th Musketeer (C) Clipper Software"); -
engines/touche/touche.cpp
37 37 38 38 namespace Touche { 39 39 40 ToucheEngine::ToucheEngine(OSystem *system )41 : Engine(system), _midiPlayer(0) {40 ToucheEngine::ToucheEngine(OSystem *system, Common::Language language) 41 : Engine(system), _midiPlayer(0), _language(language) { 42 42 43 43 _saveLoadCurrentPage = 0; 44 44 _saveLoadCurrentSlot = 0; … … 87 87 _system->initSize(kScreenWidth, kScreenHeight); 88 88 _system->endGFXTransaction(); 89 89 90 // Detect game91 if (!detectGame()) {92 GUIErrorMessage("No valid games were found in the specified directory.");93 return -1;94 }95 96 90 Graphics::setupFont(_language); 97 91 98 92 setupOpcodes(); -
engines/touche/touche.h
351 351 352 352 typedef void (ToucheEngine::*OpcodeProc)(); 353 353 354 ToucheEngine(OSystem *system );354 ToucheEngine(OSystem *system, Common::Language language); 355 355 virtual ~ToucheEngine(); 356 356 357 357 virtual int init(); -
engines/agos/agos.h
179 179 180 180 const AGOSGameDescription *_gameDescription; 181 181 182 bool initGame(void);183 182 virtual void setupGame(); 184 183 185 184 int getGameId() const; -
engines/agos/detection.cpp
129 129 res = false; 130 130 error("AGOS engine: unknown gameType"); 131 131 } 132 if (res) { 133 ((AGOS::AGOSEngine *)*engine)->_gameDescription = gd; 134 } 132 135 133 136 return res; 134 137 } 135 138 136 ADVANCED_DETECTOR_DEFINE_PLUGIN _WITH_COMPLEX_CREATION(AGOS, engineCreateAgos, detectionParams);139 ADVANCED_DETECTOR_DEFINE_PLUGIN(AGOS, engineCreateAgos, detectionParams); 137 140 138 141 REGISTER_PLUGIN(AGOS, "AGOS", "AGOS (C) Adventure Soft"); 139 142 140 143 namespace AGOS { 141 144 142 bool AGOSEngine::initGame() {143 Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);144 _gameDescription = (const AGOSGameDescription *)(encapsulatedDesc.realDesc);145 146 return (_gameDescription != 0);147 }148 149 150 145 int AGOSEngine::getGameId() const { 151 146 return _gameDescription->gameId; 152 147 } -
engines/agos/agos.cpp
525 525 } 526 526 527 527 int AGOSEngine::init() { 528 // Detect game529 if (!initGame()) {530 GUIErrorMessage("No valid games were found in the specified directory.");531 return -1;532 }533 534 528 if (getGameId() == GID_DIMP) { 535 529 _screenWidth = 496; 536 530 _screenHeight = 400; -
engines/cruise/cruise.h
51 51 bool initGame(); 52 52 53 53 public: 54 CruiseEngine(OSystem * syst );54 CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc); 55 55 virtual ~ CruiseEngine(); 56 56 57 57 int getGameType() const; -
engines/cruise/detection.cpp
111 111 Common::kADFlagAugmentPreferredTarget 112 112 }; 113 113 114 ADVANCED_DETECTOR_DEFINE_PLUGIN(CRUISE, Cruise::CruiseEngine, detectionParams); 115 116 REGISTER_PLUGIN(CRUISE, "Cinematique evo 2 engine", "Cruise for a Corpse (C) Delphine Software"); 117 118 namespace Cruise { 119 120 bool CruiseEngine::initGame() { 121 Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); 122 _gameDescription = (const CRUISEGameDescription *)(encapsulatedDesc.realDesc); 123 124 return (_gameDescription != 0); 114 static bool Engine_CRUISE_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { 115 const Cruise::CRUISEGameDescription *gd = (const Cruise::CRUISEGameDescription *)(encapsulatedDesc.realDesc); 116 if (gd) { 117 *engine = new Cruise::CruiseEngine(syst, gd); 118 } 119 return gd != 0; 125 120 } 126 121 127 } // End of namespace Cruise 122 ADVANCED_DETECTOR_DEFINE_PLUGIN(CRUISE, Engine_CRUISE_createInstance, detectionParams); 123 124 REGISTER_PLUGIN(CRUISE, "Cinematique evo 2 engine", "Cruise for a Corpse (C) Delphine Software"); -
engines/cruise/cruise.cpp
44 44 45 45 CruiseEngine *g_cruise; 46 46 47 CruiseEngine::CruiseEngine(OSystem * syst ) : Engine(syst) {47 CruiseEngine::CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { 48 48 49 49 #ifdef PALMOS_MODE 50 50 _currentVolumeFile = new Common::File(); … … 75 75 } 76 76 77 77 int CruiseEngine::init() { 78 // Detect game79 if (!initGame()) {80 GUIErrorMessage ("No valid games were found in the specified directory.");81 return -1;82 }83 78 // Initialize backend 84 79 _system->beginGFXTransaction(); 85 80 initCommonGFX(false); -
engines/drascula/detection.cpp
164 164 Common::kADFlagAugmentPreferredTarget 165 165 }; 166 166 167 ADVANCED_DETECTOR_DEFINE_PLUGIN(DRASCULA, Drascula::DrasculaEngine, detectionParams); 168 169 REGISTER_PLUGIN(DRASCULA, "Drascula Engine", "Drascula Engine (C) 2000 Alcachofa Soft, 1996 (C) Digital Dreams Multimedia, 1994 (C) Emilio de Paz"); 170 171 namespace Drascula { 172 173 bool DrasculaEngine::initGame() { 174 Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); 175 _gameDescription = (const DrasculaGameDescription *)(encapsulatedDesc.realDesc); 176 177 return (_gameDescription != 0); 167 static bool Engine_DRASCULA_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { 168 const Drascula::DrasculaGameDescription *gd = (const Drascula::DrasculaGameDescription *)(encapsulatedDesc.realDesc); 169 if (gd) { 170 *engine = new Drascula::DrasculaEngine(syst, gd); 171 } 172 return gd != 0; 178 173 } 179 174 180 } // End of namespace Drascula 175 ADVANCED_DETECTOR_DEFINE_PLUGIN(DRASCULA, Engine_DRASCULA_createInstance, detectionParams); 181 176 177 REGISTER_PLUGIN(DRASCULA, "Drascula Engine", "Drascula Engine (C) 2000 Alcachofa Soft, 1996 (C) Digital Dreams Multimedia, 1994 (C) Emilio de Paz"); 178 -
engines/drascula/drascula.cpp
53 53 {NULL, NULL, 0, 0, NULL} 54 54 }; 55 55 56 DrasculaEngine::DrasculaEngine(OSystem *syst ) : Engine(syst) {56 DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { 57 57 58 58 // Setup mixer 59 59 if (!_mixer->isReady()) { … … 119 119 static char poder_v[6][14] = {"11.als", "109.als", "111.als", "110.als", "115.als", "116.als"}; 120 120 121 121 int DrasculaEngine::init() { 122 // Detect game123 if (!initGame()) {124 GUIErrorMessage("No valid games were found in the specified directory.");125 return -1;126 }127 128 122 // Initialize backend 129 123 _system->beginGFXTransaction(); 130 124 initCommonGFX(false); -
engines/drascula/drascula.h
337 337 int go(); 338 338 // void shutdown(); 339 339 340 bool initGame();341 342 340 public: 343 DrasculaEngine(OSystem *syst );341 DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gameDesc); 344 342 virtual ~DrasculaEngine(); 345 343 int getGameId() { 346 344 return _gameId; -
engines/agi/agi.cpp
605 605 setAmigaStyle(renderMode == Common::kRenderAmiga); 606 606 } 607 607 608 AgiBase::AgiBase(OSystem *syst ) : Engine(syst) {608 AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { 609 609 610 610 } 611 611 612 AgiEngine::AgiEngine(OSystem *syst ) : AgiBase(syst) {612 AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) { 613 613 614 614 // Setup mixer 615 615 if (!_mixer->isReady()) { … … 783 783 784 784 int AgiEngine::init() { 785 785 786 // Detect game787 if (!initGame()) {788 GUIErrorMessage("No valid games were found in the specified directory.");789 return -1;790 }791 792 793 786 // Initialize backend 794 787 _system->beginGFXTransaction(); 795 788 initCommonGFX(false); -
engines/agi/preagi.h
40 40 void shutdown(); 41 41 void initialize(); 42 42 43 bool initGame();44 45 43 public: 46 44 void agiTimerLow() {} 47 45 int agiGetKeypressLow() { return 0; } 48 46 int agiIsKeypressLow() { return 0; } 49 47 50 PreAgiEngine(OSystem *syst );48 PreAgiEngine(OSystem *syst, const AGIGameDescription *gameDesc); 51 49 virtual ~PreAgiEngine(); 52 50 int getGameId() { 53 51 return _gameId; -
engines/agi/detection.cpp
2253 2253 2254 2254 switch (gd->gameType) { 2255 2255 case Agi::GType_PreAGI: 2256 *engine = new Agi::PreAgiEngine(syst );2256 *engine = new Agi::PreAgiEngine(syst, gd); 2257 2257 break; 2258 2258 case Agi::GType_V2: 2259 *engine = new Agi::AgiEngine(syst );2259 *engine = new Agi::AgiEngine(syst, gd); 2260 2260 break; 2261 2261 case Agi::GType_V3: 2262 *engine = new Agi::AgiEngine(syst );2262 *engine = new Agi::AgiEngine(syst, gd); 2263 2263 break; 2264 2264 default: 2265 2265 res = false; … … 2269 2269 return res; 2270 2270 } 2271 2271 2272 ADVANCED_DETECTOR_DEFINE_PLUGIN _WITH_COMPLEX_CREATION(AGI, engineCreateAgi, detectionParams);2272 ADVANCED_DETECTOR_DEFINE_PLUGIN(AGI, engineCreateAgi, detectionParams); 2273 2273 2274 2274 REGISTER_PLUGIN(AGI, "AGI preAGI + v2 + v3 Engine", "Sierra AGI Engine (C) Sierra On-Line Software"); 2275 2275 2276 namespace Agi {2277 2278 bool AgiEngine::initGame() {2279 Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);2280 _gameDescription = (const AGIGameDescription *)(encapsulatedDesc.realDesc);2281 2282 return (_gameDescription != 0);2283 }2284 2285 bool PreAgiEngine::initGame() {2286 Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);2287 _gameDescription = (const AGIGameDescription *)(encapsulatedDesc.realDesc);2288 2289 return (_gameDescription != 0);2290 }2291 2292 } // End of namespace Agi2293 -
engines/agi/agi.h
656 656 virtual int agiGetKeypressLow() = 0; 657 657 virtual int agiIsKeypressLow() = 0; 658 658 659 AgiBase(OSystem *syst );659 AgiBase(OSystem *syst, const AGIGameDescription *gameDesc); 660 660 661 661 #define INITIAL_IMAGE_STACK_SIZE 32 662 662 … … 695 695 void shutdown(); 696 696 void initialize(); 697 697 698 bool initGame();699 700 698 public: 701 AgiEngine(OSystem *syst );699 AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc); 702 700 virtual ~AgiEngine(); 703 701 int getGameId() { 704 702 return _gameId; -
engines/agi/preagi.cpp
51 51 52 52 namespace Agi { 53 53 54 PreAgiEngine::PreAgiEngine(OSystem *syst ) : AgiBase(syst) {54 PreAgiEngine::PreAgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) { 55 55 56 56 // Setup mixer 57 57 if (!_mixer->isReady()) { … … 195 195 } 196 196 197 197 int PreAgiEngine::init() { 198 199 // Detect game200 if (!initGame()) {201 GUIErrorMessage("No valid games were found in the specified directory.");202 return -1;203 }204 205 198 // Initialize backend 206 199 _system->beginGFXTransaction(); 207 200 initCommonGFX(false); -
engines/kyra/detection.cpp
436 436 return res; 437 437 } 438 438 439 ADVANCED_DETECTOR_DEFINE_PLUGIN _WITH_COMPLEX_CREATION(KYRA, engineCreateKyra, detectionParams);439 ADVANCED_DETECTOR_DEFINE_PLUGIN(KYRA, engineCreateKyra, detectionParams); 440 440 441 441 REGISTER_PLUGIN(KYRA, "Legend of Kyrandia Engine", "The Legend of Kyrandia (C) Westwood Studios"); 442 442 -
engines/gob/gob.h
167 167 friend class Ptr; 168 168 }; 169 169 170 struct GOBGameDescription; 171 170 172 class GobEngine : public Engine { 171 173 protected: 172 174 GobEngine *_vm; … … 177 179 bool initGameParts(); 178 180 void deinitGameParts(); 179 181 180 bool detectGame();181 182 182 public: 183 183 static const Common::Language _gobToScummVMLang[]; 184 184 … … 237 237 238 238 GobEngine(OSystem *syst); 239 239 virtual ~GobEngine(); 240 241 void initGame(const GOBGameDescription *gd); 240 242 }; 241 243 242 244 } // End of namespace Gob -
engines/gob/gob.cpp
145 145 } 146 146 147 147 int GobEngine::init() { 148 // Detect game149 if (!detectGame()) {150 GUIErrorMessage("No valid games were found in the specified directory.");151 return -1;152 }153 154 148 if (!initGameParts()) { 155 149 GUIErrorMessage("GobEngine::init(): Unknown version of game engine"); 156 150 return -1; -
engines/gob/detection.cpp
1701 1701 kADFlagAugmentPreferredTarget 1702 1702 }; 1703 1703 1704 ADVANCED_DETECTOR_DEFINE_PLUGIN(GOB, Gob::GobEngine, detectionParams); 1704 static bool Engine_GOB_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { 1705 const Gob::GOBGameDescription *gd = (const Gob::GOBGameDescription *)(encapsulatedDesc.realDesc); 1706 if (gd) { 1707 *engine = new Gob::GobEngine(syst); 1708 ((Gob::GobEngine *)*engine)->initGame(gd); 1709 } 1710 return gd != 0; 1711 } 1705 1712 1713 ADVANCED_DETECTOR_DEFINE_PLUGIN(GOB, Engine_GOB_createInstance, detectionParams); 1714 1706 1715 REGISTER_PLUGIN(GOB, "Gob Engine", "Goblins Games (C) Coktel Vision"); 1707 1716 1708 1709 1717 namespace Gob { 1710 1718 1711 bool GobEngine::detectGame() { 1712 Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); 1713 const GOBGameDescription *gd = (const GOBGameDescription *)(encapsulatedDesc.realDesc); 1714 1715 if (gd == 0) 1716 return false; 1717 1719 void GobEngine::initGame(const GOBGameDescription *gd) { 1718 1720 if (gd->startTotBase == 0) { 1719 1721 _startTot = new char[10]; 1720 1722 _startTot0 = new char[11]; … … 1733 1735 _features = gd->features; 1734 1736 _language = gd->desc.language; 1735 1737 _platform = gd->desc.platform; 1736 1737 return true;1738 1738 } 1739 1739 1740 1740 } // End of namespace Gob -
engines/parallaction/parallaction.h
363 363 364 364 public: 365 365 366 Parallaction(OSystem *syst );366 Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc); 367 367 ~Parallaction(); 368 368 369 369 int init(); … … 640 640 class Parallaction_ns : public Parallaction { 641 641 642 642 public: 643 Parallaction_ns(OSystem* syst ) : Parallaction(syst) { }643 Parallaction_ns(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction(syst, gameDesc) { } 644 644 ~Parallaction_ns(); 645 645 646 646 int init(); … … 922 922 typedef Parallaction_ns Super; 923 923 924 924 public: 925 Parallaction_br(OSystem* syst ) : Parallaction_ns(syst) { }925 Parallaction_br(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction_ns(syst, gameDesc) { } 926 926 ~Parallaction_br(); 927 927 928 928 int init(); -
engines/parallaction/detection.cpp
184 184 Common::kADFlagAugmentPreferredTarget 185 185 }; 186 186 187 bool engineCreateParallaction(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) {187 static bool Engine_PARALLACTION_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { 188 188 const Parallaction::PARALLACTIONGameDescription *gd = (const Parallaction::PARALLACTIONGameDescription *)(encapsulatedDesc.realDesc); 189 189 bool res = true; 190 190 191 191 switch (gd->gameType) { 192 192 case Parallaction::GType_Nippon: 193 *engine = new Parallaction::Parallaction_ns(syst );193 *engine = new Parallaction::Parallaction_ns(syst, gd); 194 194 break; 195 195 case Parallaction::GType_BRA: 196 *engine = new Parallaction::Parallaction_br(syst );196 *engine = new Parallaction::Parallaction_br(syst, gd); 197 197 break; 198 198 default: 199 199 res = false; … … 203 203 return res; 204 204 } 205 205 206 ADVANCED_DETECTOR_DEFINE_PLUGIN _WITH_COMPLEX_CREATION(PARALLACTION, engineCreateParallaction, detectionParams);206 ADVANCED_DETECTOR_DEFINE_PLUGIN(PARALLACTION, Engine_PARALLACTION_createInstance, detectionParams); 207 207 208 208 REGISTER_PLUGIN(PARALLACTION, "Parallaction engine", "Nippon Safes Inc. (C) Dynabyte"); 209 210 211 namespace Parallaction {212 213 bool Parallaction::detectGame() {214 Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);215 _gameDescription = (const PARALLACTIONGameDescription *)(encapsulatedDesc.realDesc);216 217 return (_gameDescription != 0);218 }219 220 } // End of namespace Parallaction -
engines/parallaction/parallaction_br.cpp
59 59 60 60 int Parallaction_br::init() { 61 61 62 // Detect game63 if (!detectGame()) {64 GUIErrorMessage("No valid games were found in the specified directory.");65 return -1;66 }67 68 62 _screenWidth = 640; 69 63 _screenHeight = 400; 70 64 -
engines/parallaction/parallaction_ns.cpp
111 111 112 112 int Parallaction_ns::init() { 113 113 114 // Detect game115 if (!detectGame()) {116 GUIErrorMessage("No valid games were found in the specified directory.");117 return -1;118 }119 120 114 _screenWidth = 320; 121 115 _screenHeight = 200; 122 116 -
engines/parallaction/parallaction.cpp
91 91 static Job *_jRunScripts = NULL; 92 92 93 93 94 Parallaction::Parallaction(OSystem *syst ) :95 Engine(syst), _ char(this) {94 Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc) : 95 Engine(syst), _gameDescription(gameDesc), _char(this) { 96 96 97 97 // FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what 98 98 // needs fixing, or remove it! -
engines/saga/saga.cpp
59 59 60 60 #define MAX_TIME_DELTA 100 61 61 62 SagaEngine::SagaEngine(OSystem *syst )63 : Engine(syst) {62 SagaEngine::SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc) 63 : Engine(syst), _gameDescription(gameDesc) { 64 64 65 65 _leftMouseButtonPressed = _rightMouseButtonPressed = false; 66 66 -
engines/saga/detection.cpp
139 139 Common::kADFlagAugmentPreferredTarget 140 140 }; 141 141 142 ADVANCED_DETECTOR_DEFINE_PLUGIN(SAGA, Saga::SagaEngine, detectionParams); 142 static bool Engine_SAGA_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { 143 const Saga::SAGAGameDescription *gd = (const Saga::SAGAGameDescription *)(encapsulatedDesc.realDesc); 144 if (gd) { 145 *engine = new Saga::SagaEngine(syst, gd); 146 } 147 return gd != 0; 148 } 143 149 150 ADVANCED_DETECTOR_DEFINE_PLUGIN(SAGA, Engine_SAGA_createInstance, detectionParams); 151 144 152 REGISTER_PLUGIN(SAGA, "SAGA Engine", "Inherit the Earth (C) Wyrmkeep Entertainment"); 145 153 146 154 namespace Saga { 147 155 148 156 bool SagaEngine::initGame() { 149 Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams);150 _gameDescription = (const SAGAGameDescription *)(encapsulatedDesc.realDesc);151 152 if (_gameDescription == 0)153 return false;154 155 157 _displayClip.right = getDisplayInfo().logicalWidth; 156 158 _displayClip.bottom = getDisplayInfo().logicalHeight; 157 159 -
engines/saga/saga.h
504 504 int go(); 505 505 int init(); 506 506 public: 507 SagaEngine(OSystem *syst );507 SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc); 508 508 virtual ~SagaEngine(); 509 509 void shutDown() { _quit = true; } 510 510 -
engines/cine/detection.cpp
487 487 Common::kADFlagAugmentPreferredTarget 488 488 }; 489 489 490 ADVANCED_DETECTOR_DEFINE_PLUGIN(CINE, Cine::CineEngine, detectionParams); 491 492 REGISTER_PLUGIN(CINE, "Cinematique evo 1 engine", "Future Wars & Operation Stealth (C) Delphine Software"); 493 494 namespace Cine { 495 496 bool CineEngine::initGame() { 497 Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(detectionParams); 498 _gameDescription = (const CINEGameDescription *)(encapsulatedDesc.realDesc); 499 500 return (_gameDescription != 0); 490 static bool Engine_CINE_createInstance(OSystem *syst, Engine **engine, Common::EncapsulatedADGameDesc encapsulatedDesc) { 491 const Cine::CINEGameDescription *gd = (const Cine::CINEGameDescription *)(encapsulatedDesc.realDesc); 492 if (gd) { 493 *engine = new Cine::CineEngine(syst, gd); 494 } 495 return gd != 0; 501 496 } 502 497 503 } // End of namespace Cine 498 ADVANCED_DETECTOR_DEFINE_PLUGIN(CINE, Engine_CINE_createInstance, detectionParams); 499 500 REGISTER_PLUGIN(CINE, "Cinematique evo 1 engine", "Future Wars & Operation Stealth (C) Delphine Software"); -
engines/cine/cine.h
71 71 bool initGame(); 72 72 73 73 public: 74 CineEngine(OSystem *syst );74 CineEngine(OSystem *syst, const CINEGameDescription *gameDesc); 75 75 virtual ~CineEngine(); 76 76 77 77 int getGameType() const; -
engines/cine/cine.cpp
50 50 51 51 CineEngine *g_cine; 52 52 53 CineEngine::CineEngine(OSystem *syst ) : Engine(syst) {53 CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { 54 54 Common::addSpecialDebugLevel(kCineDebugScript, "Script", "Script debug level"); 55 55 56 56 // Setup mixer … … 74 74 } 75 75 76 76 int CineEngine::init() { 77 // Detect game78 if (!initGame()) {79 GUIErrorMessage("No valid games were found in the specified directory.");80 return -1;81 }82 83 77 // Initialize backend 84 78 _system->beginGFXTransaction(); 85 79 initCommonGFX(false); -
common/advancedDetector.h
236 236 // FIXME/TODO: Rename this function to something more sensible. 237 237 EncapsulatedADGameDesc detectBestMatchingGame(const Common::ADParams ¶ms); 238 238 239 // FIXME/TODO: Rename this function to something more sensible. 240 // Only used by ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_FUNC 241 PluginError detectGameForEngineCreation(const Common::ADParams ¶ms); 239 void upgradeTargetIfNecessary(const Common::ADParams ¶ms); 242 240 243 241 // Helper function to announce an unknown version of the game (useful for 244 242 // fallback detection functions). 245 243 void reportUnknown(StringList &files, int md5Bytes); 246 244 247 // FIXME: It would probably be good to merge detectBestMatchingGame248 // and detectGameForEngineCreation into a single function. Right now, the249 // detection code called priort to creating an engine instance250 // (i.e. detectGameForEngineCreation) differs from the detection code the251 // engines call internally (i.e. detectBestMatchingGame). This could lead252 // to hard to debug and odd errors.253 254 255 245 } // End of namespace AdvancedDetector 256 246 257 247 … … 267 257 } \ 268 258 void dummyFuncToAllowTrailingSemicolon() 269 259 270 #define _ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_PREDEFINED_FUNC(engine,factoryFunc,params) \260 #define ADVANCED_DETECTOR_DEFINE_PLUGIN(engine,factoryFunc,params) \ 271 261 _ADVANCED_DETECTOR_DEFINE_PLUGIN_HEAD(engine,params); \ 272 262 PluginError Engine_##engine##_create(OSystem *syst, Engine **engine) { \ 273 assert(syst); \274 263 assert(engine); \ 275 PluginError err = Common::AdvancedDetector::detectGameForEngineCreation(params); \ 276 if (err == kNoError) \ 277 *engine = factoryFunc(syst); \ 278 return err; \ 279 } \ 280 void dummyFuncToAllowTrailingSemicolon() 281 282 #define ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_COMPLEX_CREATION(engine,factoryFunc,params) \ 283 _ADVANCED_DETECTOR_DEFINE_PLUGIN_HEAD(engine,params); \ 284 PluginError Engine_##engine##_create(OSystem *syst, Engine **engine) { \ 285 assert(engine); \ 264 Common::AdvancedDetector::upgradeTargetIfNecessary(params); \ 286 265 Common::EncapsulatedADGameDesc encapsulatedDesc = Common::AdvancedDetector::detectBestMatchingGame(params); \ 287 266 if (encapsulatedDesc.realDesc == 0) { \ 288 267 return kNoGameDataFoundError; \ … … 294 273 } \ 295 274 void dummyFuncToAllowTrailingSemicolon() 296 275 297 #define ADVANCED_DETECTOR_DEFINE_PLUGIN(engine,className,params) \298 static Engine *engine##_createInstance(OSystem *syst) { \299 return new className(syst); \300 } \301 _ADVANCED_DETECTOR_DEFINE_PLUGIN_WITH_PREDEFINED_FUNC(engine,engine##_createInstance,params); \302 void dummyFuncToAllowTrailingSemicolon()303 304 305 276 } // End of namespace Common 306 277 307 278 #endif -
common/advancedDetector.cpp
70 70 return GameList(params.list); 71 71 } 72 72 73 staticvoid upgradeTargetIfNecessary(const Common::ADParams ¶ms) {73 void upgradeTargetIfNecessary(const Common::ADParams ¶ms) { 74 74 if (params.obsoleteList == 0) 75 75 return; 76 76 … … 264 264 return result; 265 265 } 266 266 267 PluginError detectGameForEngineCreation(268 const Common::ADParams ¶ms269 ) {270 271 upgradeTargetIfNecessary(params);272 273 Common::String gameid = ConfMan.get("gameid");274 275 FSList fslist;276 FilesystemNode dir(ConfMan.get("path"));277 if (!dir.getChildren(fslist, FilesystemNode::kListFilesOnly)) {278 return kInvalidPathError;279 }280 281 ADGameDescList matches = detectGame(&fslist, params, Common::UNK_LANG, Common::kPlatformUnknown);282 283 // We have single ID set, so we have a game if there are hits284 if (params.singleid != NULL && matches.size())285 return kNoError;286 287 for (uint i = 0; i < matches.size(); i++) {288 if (matches[i]->gameid == gameid) {289 return kNoError;290 }291 }292 293 // Use fallback detector if there were no matches by other means294 if (params.fallbackDetectFunc != NULL) {295 EncapsulatedADGameDesc fallbackDesc = (*params.fallbackDetectFunc)(&fslist);296 if (fallbackDesc.realDesc != 0 && (params.singleid != NULL || fallbackDesc.getGameID() == gameid)) {297 return kNoError;298 }299 }300 301 return kNoGameDataFoundError;302 }303 304 267 void reportUnknown(StringMap &filesMD5, HashMap<String, int32, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> &filesSize) { 305 268 // TODO: This message should be cleaned up / made more specific. 306 269 // For example, we should specify at least which engine triggered this.