diff options
| author | Paul Gilbert | 2011-07-18 21:13:39 +1000 | 
|---|---|---|
| committer | Paul Gilbert | 2011-07-18 21:13:39 +1000 | 
| commit | b3a05ee089e8f657f8ad1e5416ec06c56d95adf3 (patch) | |
| tree | ff95070d27f6214486a9e8921340a45fde8a0aa7 | |
| parent | c378aadc3f8b438fcb081945681dd2a370f617dc (diff) | |
| download | scummvm-rg350-b3a05ee089e8f657f8ad1e5416ec06c56d95adf3.tar.gz scummvm-rg350-b3a05ee089e8f657f8ad1e5416ec06c56d95adf3.tar.bz2 scummvm-rg350-b3a05ee089e8f657f8ad1e5416ec06c56d95adf3.zip | |
TSAGE: Bugfix to make Return to Launcher work correctly
| -rw-r--r-- | engines/tsage/converse.cpp | 6 | ||||
| -rw-r--r-- | engines/tsage/core.cpp | 2 | ||||
| -rw-r--r-- | engines/tsage/dialogs.cpp | 8 | ||||
| -rw-r--r-- | engines/tsage/events.cpp | 4 | ||||
| -rw-r--r-- | engines/tsage/graphics.cpp | 6 | ||||
| -rw-r--r-- | engines/tsage/ringworld_logic.cpp | 2 | ||||
| -rw-r--r-- | engines/tsage/ringworld_scenes3.cpp | 6 | ||||
| -rw-r--r-- | engines/tsage/scenes.cpp | 2 | ||||
| -rw-r--r-- | engines/tsage/tsage.cpp | 4 | ||||
| -rw-r--r-- | engines/tsage/tsage.h | 1 | 
10 files changed, 23 insertions, 18 deletions
| diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index b475310533..0ae575c557 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -416,13 +416,13 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) {  	// Event handling loop  	Event event; -	while (!_vm->getEventManager()->shouldQuit()) { +	while (!_vm->shouldQuit()) {  		while (!_globals->_events.getEvent(event, EVENT_KEYPRESS | EVENT_BUTTON_DOWN | EVENT_MOUSE_MOVE) && -				!_vm->getEventManager()->shouldQuit()) { +				!_vm->shouldQuit()) {  			g_system->delayMillis(10);  			g_system->updateScreen();  		} -		if (_vm->getEventManager()->shouldQuit()) +		if (_vm->shouldQuit())  			break;  		if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode >= Common::KEYCODE_1) && diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 76714a6f10..d0075d5acf 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1552,7 +1552,7 @@ void SceneItem::display(int resNum, int lineNum, ...) {  		Event event;  		// Keep event on-screen until a mouse or keypress -		while (!_vm->getEventManager()->shouldQuit() && !_globals->_events.getEvent(event, +		while (!_vm->shouldQuit() && !_globals->_events.getEvent(event,  				EVENT_BUTTON_DOWN | EVENT_KEYPRESS)) {  			g_system->updateScreen();  			g_system->delayMillis(10); diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp index 86fbbc8e43..d315ce092b 100644 --- a/engines/tsage/dialogs.cpp +++ b/engines/tsage/dialogs.cpp @@ -243,7 +243,7 @@ void RightClickDialog::execute() {  	// Dialog event handler loop  	_gfxManager.activate(); -	while (!_vm->getEventManager()->shouldQuit() && (_selectedAction == -1)) { +	while (!_vm->shouldQuit() && (_selectedAction == -1)) {  		Event evt;  		while (_globals->_events.getEvent(evt, EVENT_MOUSE_MOVE | EVENT_BUTTON_DOWN)) {  			evt.mousePos.x -= _bounds.left; @@ -465,14 +465,14 @@ void InventoryDialog::execute() {  	bool lookFlag = false;  	_gfxManager.activate(); -	while (!_vm->getEventManager()->shouldQuit()) { +	while (!_vm->shouldQuit()) {  		// Get events  		Event event; -		while (!_globals->_events.getEvent(event) && !_vm->getEventManager()->shouldQuit()) { +		while (!_globals->_events.getEvent(event) && !_vm->shouldQuit()) {  			g_system->delayMillis(10);  			g_system->updateScreen();  		} -		if (_vm->getEventManager()->shouldQuit()) +		if (_vm->shouldQuit())  			break;  		hiliteObj = NULL; diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp index a24f65421b..010117ec78 100644 --- a/engines/tsage/events.cpp +++ b/engines/tsage/events.cpp @@ -78,7 +78,7 @@ bool EventsClass::pollEvent() {  void EventsClass::waitForPress(int eventMask) {  	Event evt; -	while (!_vm->getEventManager()->shouldQuit() && !getEvent(evt, eventMask)) +	while (!_vm->shouldQuit() && !getEvent(evt, eventMask))  		g_system->delayMillis(10);  } @@ -86,7 +86,7 @@ void EventsClass::waitForPress(int eventMask) {   * Standard event retrieval, which only returns keyboard and mouse clicks   */  bool EventsClass::getEvent(Event &evt, int eventMask) { -	while (pollEvent() && !_vm->getEventManager()->shouldQuit()) { +	while (pollEvent() && !_vm->shouldQuit()) {  		evt.handled = false;  		evt.eventType = EVENT_NONE;  		evt.mousePos = _event.mouse; diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index fce9e1317d..87ffdf4494 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -408,7 +408,7 @@ bool GfxSurface::displayText(const Common::String &msg, const Common::Point &pt)  	// Write for a  mouse or keypress  	Event event; -	while (!_globals->_events.getEvent(event, EVENT_BUTTON_DOWN | EVENT_KEYPRESS) && !_vm->getEventManager()->shouldQuit()) +	while (!_globals->_events.getEvent(event, EVENT_BUTTON_DOWN | EVENT_KEYPRESS) && !_vm->shouldQuit())  		;  	// Restore the display area @@ -718,7 +718,7 @@ bool GfxElement::focusedEvent(Event &event) {  	int xOffset = mousePos.x - _globals->_events._mousePos.x;  	int yOffset = mousePos.y - _globals->_events._mousePos.y; -	while (event.eventType != EVENT_BUTTON_UP && !_vm->getEventManager()->shouldQuit()) { +	while (event.eventType != EVENT_BUTTON_UP && !_vm->shouldQuit()) {  		g_system->delayMillis(10);  		if (_bounds.contains(mousePos)) { @@ -1029,7 +1029,7 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) {  	GfxButton *selectedButton = NULL;  	bool breakFlag = false; -	while (!_vm->getEventManager()->shouldQuit() && !breakFlag) { +	while (!_vm->shouldQuit() && !breakFlag) {  		Event event;  		while (_globals->_events.getEvent(event) && !breakFlag) {  			// Adjust mouse positions to be relative within the dialog diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index 58501172af..070d8afd25 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -296,7 +296,7 @@ void SceneArea::draw(bool flag) {  void SceneArea::wait() {  	// Wait until a mouse or keypress  	Event event; -	while (!_vm->getEventManager()->shouldQuit() && !_globals->_events.getEvent(event)) { +	while (!_vm->shouldQuit() && !_globals->_events.getEvent(event)) {  		g_system->updateScreen();  		g_system->delayMillis(10);  	} diff --git a/engines/tsage/ringworld_scenes3.cpp b/engines/tsage/ringworld_scenes3.cpp index 824a96a18b..3f9921b0ad 100644 --- a/engines/tsage/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld_scenes3.cpp @@ -526,7 +526,7 @@ void Scene2100::Action1::signal() {  		_state = 0;  		_globals->_events.setCursor(CURSOR_USE); -		while (!_state && !_vm->getEventManager()->shouldQuit()) { +		while (!_state && !_vm->shouldQuit()) {  			// Wait for an event  			Event event;  			if (!_globals->_events.getEvent(event)) { @@ -2257,7 +2257,7 @@ void Scene2150::Action1::signal() {  		_state = 0;  		_globals->_events.setCursor(CURSOR_USE); -		while (!_state && !_vm->getEventManager()->shouldQuit()) { +		while (!_state && !_vm->shouldQuit()) {  			// Wait for an event  			Event event;  			if (!_globals->_events.getEvent(event)) { @@ -5112,7 +5112,7 @@ void Scene2320::Action3::signal() {  		_state = 0;  		_globals->_events.setCursor(CURSOR_USE); -		while (!_state && !_vm->getEventManager()->shouldQuit()) { +		while (!_state && !_vm->shouldQuit()) {  			// Wait for an event  			Event event;  			if (!_globals->_events.getEvent(event)) { diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index 18b3da2698..b94e95c696 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -511,7 +511,7 @@ void Game::execute() {  				activeFlag = true;  			}  		} -	} while (activeFlag && !_vm->getEventManager()->shouldQuit()); +	} while (activeFlag && !_vm->shouldQuit());  }  } // End of namespace tSage diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index 41f3d58897..23a0193b7c 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -147,4 +147,8 @@ void TSageEngine::syncSoundSettings() {  	_globals->_soundManager.syncSounds();  } +bool TSageEngine::shouldQuit() { +	return getEventManager()->shouldQuit() || getEventManager()->shouldRTL(); +} +  } // End of namespace tSage diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h index f004c7f625..805461886a 100644 --- a/engines/tsage/tsage.h +++ b/engines/tsage/tsage.h @@ -78,6 +78,7 @@ public:  	uint32 getGameID() const;  	uint32 getFeatures() const;  	Common::String getPrimaryFilename() const; +	bool shouldQuit();  	virtual Common::Error init();  	virtual Common::Error run(); | 
