Ticket #9121: dott_mm.patch
File dott_mm.patch, 8.6 KB (added by , 14 years ago) |
---|
-
backends/events/default/default-events.h
90 90 virtual int shouldQuit() const { return _shouldQuit; } 91 91 virtual int shouldRTL() const { return _shouldRTL; } 92 92 virtual void resetRTL() { _shouldRTL = false; } 93 #ifdef FORCE_RTL94 93 virtual void resetQuit() { _shouldQuit = false; } 95 #endif96 94 97 95 #ifdef ENABLE_KEYMAPPER 98 96 virtual Common::Keymapper *getKeymapper() { return _keymapper; } -
base/main.cpp
393 393 // TODO: Show an informative error dialog if starting the selected game failed. 394 394 } 395 395 396 bool forceRTL = false; 397 #ifdef FORCE_RTL 398 forceRTL = true; 399 #endif 400 if (ConfMan.hasNextDomain()) 401 forceRTL = true; 402 396 403 // Quit unless an error occurred, or Return to launcher was requested 397 #ifndef FORCE_RTL 398 if (result == 0 && !g_system->getEventManager()->shouldRTL()) 404 if (result == 0 && !forceRTL && !g_system->getEventManager()->shouldRTL()) 399 405 break; 400 #endif 406 401 407 // Reset RTL flag in case we want to load another engine 402 408 g_system->getEventManager()->resetRTL(); 403 #ifdef FORCE_RTL 404 g_system->getEventManager()->resetQuit(); 405 #endif 409 if (forceRTL) 410 g_system->getEventManager()->resetQuit(); 406 411 412 Common::ConfigManager::Domain *transientDomain = ConfMan.getDomain(Common::ConfigManager::kTransientDomain); 413 407 414 // Discard any command line options. It's unlikely that the user 408 415 // wanted to apply them to *all* games ever launched. 409 ConfMan.getDomain(Common::ConfigManager::kTransientDomain)->clear();416 transientDomain->clear(); 410 417 411 // Clear the active config domain 412 ConfMan.setActiveDomain(""); 418 // setup the domain 419 if (ConfMan.hasNextDomain()) { 420 // set active domain to next pending domain 421 Common::ConfigManager::DomainQueueEntry nextDomain = ConfMan.dequeueNextDomain(); 422 ConfMan.setActiveDomain(nextDomain.getName()); 413 423 424 // set transient options 425 const Common::StringMap &transientOptions = nextDomain.getTransientOptions(); 426 Common::StringMap::const_iterator iter; 427 for (iter = transientOptions.begin(); iter != transientOptions.end(); ++iter) { 428 transientDomain->setVal(iter->_key, iter->_value); 429 } 430 } else { 431 // Clear the active config domain 432 ConfMan.setActiveDomain(""); 433 } 434 414 435 // PluginManager::instance().unloadPlugins(); 415 436 PluginManager::instance().loadPlugins(); 416 437 } else { … … 430 451 431 452 // reset the graphics to default 432 453 setupGraphics(system); 433 launcherDialog(); 454 if (0 == ConfMan.getActiveDomain()) { 455 launcherDialog(); 456 } 434 457 } 435 458 PluginManager::instance().unloadPlugins(); 436 459 PluginManager::destroy(); -
common/config-manager.cpp
632 632 return isValidDomainName(domName) && _gameDomains.contains(domName); 633 633 } 634 634 635 void ConfigManager::enqueueNextDomain(const String &domName, const StringMap &transientOptions) { 636 DomainQueueEntry entry(domName, transientOptions); 637 _domainQueue.push_back(entry); 638 } 635 639 640 ConfigManager::DomainQueueEntry ConfigManager::dequeueNextDomain() { 641 if (_domainQueue.empty()) 642 return DomainQueueEntry(); 643 else 644 return _domainQueue.remove_at(0); 645 } 646 647 636 648 #pragma mark - 637 649 638 650 -
common/config-manager.h
68 68 69 69 typedef HashMap<String, Domain, IgnoreCase_Hash, IgnoreCase_EqualTo> DomainMap; 70 70 71 class DomainQueueEntry { 72 private: 73 String _domainName; 74 StringMap _transientOptions; 75 public: 76 DomainQueueEntry() 77 : _domainName("") {} 78 DomainQueueEntry(const String &domName, const StringMap &transientOptions) 79 : _domainName(domName), _transientOptions(transientOptions) {} 80 const String &getName() { return _domainName; } 81 const StringMap &getTransientOptions() { return _transientOptions; } 82 }; 83 71 84 #if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__)) 72 85 /** The name of the application domain (normally 'scummvm'). */ 73 86 static const String kApplicationDomain; … … 150 163 const Domain * getActiveDomain() const { return _activeDomain; } 151 164 const String & getActiveDomainName() const { return _activeDomainName; } 152 165 166 bool hasNextDomain() { return !_domainQueue.empty(); } 167 void enqueueNextDomain(const String &domName, const StringMap &transientOptions = StringMap()); 168 DomainQueueEntry dequeueNextDomain(); 169 153 170 void addGameDomain(const String &domName); 154 171 void removeGameDomain(const String &domName); 155 172 void renameGameDomain(const String &oldName, const String &newName); … … 178 195 String _activeDomainName; 179 196 Domain * _activeDomain; 180 197 198 Array<DomainQueueEntry> _domainQueue; 199 181 200 String _filename; 182 201 }; 183 202 -
common/events.h
377 377 * Used when we have returned to the launcher. 378 378 */ 379 379 virtual void resetRTL() = 0; 380 #ifdef FORCE_RTL381 380 virtual void resetQuit() = 0; 382 #endif 381 383 382 // Optional: check whether a given key is currently pressed ???? 384 383 //virtual bool isKeyPressed(int keycode) = 0; 385 384 -
engines/scumm/script.cpp
1038 1038 } 1039 1039 } 1040 1040 1041 void ScummEngine::killAllScripts() { 1042 for (int i = 0; i < NUM_SCRIPT_SLOT; i++) { 1043 vm.slot[i].status = ssDead; 1044 vm.slot[i].cutsceneOverride = 0; 1045 } 1046 } 1047 1041 1048 void ScummEngine::doSentence(int verb, int objectA, int objectB) { 1042 1049 SentenceTab *st; 1043 1050 -
engines/scumm/scumm.cpp
30 30 #include "common/system.h" 31 31 32 32 #include "gui/message.h" 33 #include "gui/launcher.h" 33 34 #include "gui/GuiManager.h" 34 35 35 36 #include "graphics/cursorman.h" … … 2365 2366 #endif 2366 2367 2367 2368 void ScummEngine::startManiac() { 2368 debug(0, "stub startManiac()"); 2369 displayMessage(0, "Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' directory inside the Tentacle game directory."); 2369 // prevent to start MM again after a restart of DOTT 2370 if (ConfMan.hasKey("dott_restart_after_mm")) { 2371 ConfMan.removeKey("dott_restart_after_mm", Common::ConfigManager::kTransientDomain); 2372 return; 2373 } 2374 2375 // find maniac mansion launcher entry 2376 Common::String mmDomain; 2377 Common::ConfigManager::DomainMap &domains = ConfMan.getGameDomains(); 2378 Common::ConfigManager::DomainMap::iterator iter = domains.begin(); 2379 for (iter = domains.begin(); iter != domains.end(); ++iter) { 2380 Common::ConfigManager::Domain &dom = iter->_value; 2381 Common::String gameid(dom.get("gameid")); 2382 if (gameid.equals("maniac")) 2383 mmDomain = iter->_key; 2384 } 2385 2386 if (mmDomain.empty()) { 2387 displayMessage(0, "To play Maniac Mansion you have to add it to the ScummVM launcher first. Go to 'Add Game' in the ScummVM start menu and select the 'Maniac' directory inside the Tentacle game directory."); 2388 return; 2389 } 2390 2391 // save current state for restart 2392 strcpy(_saveLoadName, "Autosave 0"); 2393 if (!saveState(0, false)) { 2394 displayMessage(0, "Could not save state. Maniac Mansion will not be executed!"); 2395 return; 2396 } 2397 2398 // add MM to launcher queue 2399 ConfMan.enqueueNextDomain(mmDomain); 2400 2401 // add DOTT (with current savestate and transient options) to launcher queue 2402 Common::StringMap dottOptions = *ConfMan.getDomain(Common::ConfigManager::kTransientDomain); 2403 dottOptions.setVal("save_slot", "0"); 2404 dottOptions.setVal("dott_restart_after_mm", "true"); 2405 ConfMan.enqueueNextDomain(ConfMan.getActiveDomainName(), dottOptions); 2406 2407 // return to launcher 2408 killAllScripts(); 2409 quitGame(); 2370 2410 } 2371 2411 2372 2412 #pragma mark - -
engines/scumm/scumm.h
729 729 bool isScriptRunning(int script) const; 730 730 731 731 void killAllScriptsExceptCurrent(); 732 void killAllScripts(); 732 733 void killScriptsAndResources(); 733 734 void decreaseScriptDelay(int amount); 734 735