[Scummvm-cvs-logs] scummvm master -> 7011e8122e6f090ed540e4683a5229c8c471327e

clone2727 clone2727 at gmail.com
Thu Apr 24 02:33:51 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7011e8122e PEGASUS: Poll for events in more places


Commit: 7011e8122e6f090ed540e4683a5229c8c471327e
    https://github.com/scummvm/scummvm/commit/7011e8122e6f090ed540e4683a5229c8c471327e
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2014-04-23T20:33:08-04:00

Commit Message:
PEGASUS: Poll for events in more places

Based on a patch by Keith Kaisershot (blitter)

Changed paths:
    engines/pegasus/ai/ai_area.cpp
    engines/pegasus/energymonitor.cpp
    engines/pegasus/fader.cpp
    engines/pegasus/input.cpp
    engines/pegasus/input.h
    engines/pegasus/interface.cpp
    engines/pegasus/items/inventorypicture.cpp
    engines/pegasus/neighborhood/mars/mars.cpp
    engines/pegasus/neighborhood/neighborhood.cpp
    engines/pegasus/neighborhood/wsc/wsc.cpp
    engines/pegasus/pegasus.cpp



diff --git a/engines/pegasus/ai/ai_area.cpp b/engines/pegasus/ai/ai_area.cpp
index 5ac8af8..9cab568 100644
--- a/engines/pegasus/ai/ai_area.cpp
+++ b/engines/pegasus/ai/ai_area.cpp
@@ -234,6 +234,7 @@ void AIArea::playAIAreaSequence(const LowerClientSignature, const LowerAreaSigna
 		vm->_cursor->hide();
 
 		while (_middleAreaMovie.isRunning()) {
+			InputDevice.pumpEvents();
 			vm->checkCallBacks();
 			vm->refreshDisplay();
 			g_system->delayMillis(10);
@@ -258,6 +259,7 @@ void AIArea::playAIAreaSequence(const LowerClientSignature, const LowerAreaSigna
 		vm->_cursor->hide();
 
 		while (_rightAreaMovie.isRunning()) {
+			InputDevice.pumpEvents();
 			vm->checkCallBacks();
 			vm->refreshDisplay();
 			g_system->delayMillis(10);
diff --git a/engines/pegasus/energymonitor.cpp b/engines/pegasus/energymonitor.cpp
index be9d205..40e54af 100644
--- a/engines/pegasus/energymonitor.cpp
+++ b/engines/pegasus/energymonitor.cpp
@@ -269,6 +269,7 @@ void EnergyMonitor::calibrateEnergyBar() {
 	// Make sure warning light is hidden...
 	_energyLight.hide();
 	while (getCurrentEnergy() != (int32)kMaxJMPEnergy) {
+		InputDevice.pumpEvents();
 		vm->checkCallBacks();
 		vm->refreshDisplay();
 		g_system->delayMillis(10);
diff --git a/engines/pegasus/fader.cpp b/engines/pegasus/fader.cpp
index a2bbf22..80ce8ef 100644
--- a/engines/pegasus/fader.cpp
+++ b/engines/pegasus/fader.cpp
@@ -94,6 +94,7 @@ void Fader::startFaderSync(const FaderMoveSpec &spec) {
 		start();
 
 		while (isFading()) {
+			InputDevice.pumpEvents();
 			((PegasusEngine *)g_engine)->checkCallBacks();
 			useIdleTime();
 		}
diff --git a/engines/pegasus/input.cpp b/engines/pegasus/input.cpp
index b74e4a4..283d554 100644
--- a/engines/pegasus/input.cpp
+++ b/engines/pegasus/input.cpp
@@ -81,9 +81,7 @@ void InputDeviceManager::getInput(Input &input, const InputBits filter) {
 	// (ie. if one uses enter to access the restore menu, we never receive
 	// the key up event, which leads to bad things)
 	// This is to closely emulate what the GetKeys() function did on Mac OS
-	Common::Event event;
-	while (g_system->getEventManager()->pollEvent(event))
-		;
+	pumpEvents();
 
 	// Now create the bitfield
 	InputBits currentBits = 0;
@@ -206,6 +204,13 @@ bool InputDeviceManager::notifyEvent(const Common::Event &event) {
 	return false;
 }
 
+void InputDeviceManager::pumpEvents() {
+	// Just poll for events. notifyEvent() will pick up on them.
+	Common::Event event;
+	while (g_system->getEventManager()->pollEvent(event))
+		;
+}
+
 int operator==(const Input &arg1, const Input &arg2) {
 	return arg1._inputState == arg2._inputState;
 }
diff --git a/engines/pegasus/input.h b/engines/pegasus/input.h
index 3e938fa..ba6f11d 100644
--- a/engines/pegasus/input.h
+++ b/engines/pegasus/input.h
@@ -50,6 +50,8 @@ public:
 
 	void waitInput(const InputBits);
 
+	void pumpEvents();
+
 protected:
 	friend class Common::Singleton<SingletonBaseType>;
 
diff --git a/engines/pegasus/interface.cpp b/engines/pegasus/interface.cpp
index f2429bf..f8ae6a0 100644
--- a/engines/pegasus/interface.cpp
+++ b/engines/pegasus/interface.cpp
@@ -604,6 +604,7 @@ void Interface::raiseInventoryDrawerSync() {
 	raiseInventoryDrawer(false);
 
 	while (_inventoryLid.isRunning()) {
+		InputDevice.pumpEvents();
 		vm->checkCallBacks();
 		vm->refreshDisplay();
 		g_system->delayMillis(10);
@@ -613,6 +614,7 @@ void Interface::raiseInventoryDrawerSync() {
 	inventoryLidOpen(false);
 
 	while (_inventoryPush.isFading()) {
+		InputDevice.pumpEvents();
 		vm->checkCallBacks();
 		vm->refreshDisplay();
 		g_system->delayMillis(10);
@@ -628,6 +630,7 @@ void Interface::lowerInventoryDrawerSync() {
 	lowerInventoryDrawer(false);
 
 	while (_inventoryPush.isFading()) {
+		InputDevice.pumpEvents();
 		vm->checkCallBacks();
 		vm->refreshDisplay();
 		g_system->delayMillis(10);
@@ -637,6 +640,7 @@ void Interface::lowerInventoryDrawerSync() {
 	inventoryDrawerDown(false);
 
 	while (_inventoryLid.isRunning()) {
+		InputDevice.pumpEvents();
 		vm->checkCallBacks();
 		vm->refreshDisplay();
 		g_system->delayMillis(10);
@@ -652,6 +656,7 @@ void Interface::raiseBiochipDrawerSync() {
 	raiseBiochipDrawer(false);
 
 	while (_biochipLid.isRunning()) {
+		InputDevice.pumpEvents();
 		vm->checkCallBacks();
 		vm->refreshDisplay();
 		g_system->delayMillis(10);
@@ -661,6 +666,7 @@ void Interface::raiseBiochipDrawerSync() {
 	biochipLidOpen(false);
 
 	while (_biochipPush.isFading()) {
+		InputDevice.pumpEvents();
 		vm->checkCallBacks();
 		vm->refreshDisplay();
 		g_system->delayMillis(10);
@@ -676,6 +682,7 @@ void Interface::lowerBiochipDrawerSync() {
 	lowerBiochipDrawer(false);
 
 	while (_biochipPush.isFading()) {
+		InputDevice.pumpEvents();
 		vm->checkCallBacks();
 		vm->refreshDisplay();
 		g_system->delayMillis(10);
@@ -685,6 +692,7 @@ void Interface::lowerBiochipDrawerSync() {
 	biochipDrawerDown(false);
 
 	while (_biochipLid.isRunning()) {
+		InputDevice.pumpEvents();
 		vm->checkCallBacks();
 		vm->refreshDisplay();
 		g_system->delayMillis(10);
diff --git a/engines/pegasus/items/inventorypicture.cpp b/engines/pegasus/items/inventorypicture.cpp
index fc812fa..bfdc382 100644
--- a/engines/pegasus/items/inventorypicture.cpp
+++ b/engines/pegasus/items/inventorypicture.cpp
@@ -331,6 +331,7 @@ void InventoryItemsPicture::playEndMessage(DisplayElement *pushElement) {
 	endMessage.start();
 
 	while (endMessage.isRunning()) {
+		InputDevice.pumpEvents();
 		vm->checkCallBacks();
 		vm->refreshDisplay();
 		g_system->delayMillis(10);
diff --git a/engines/pegasus/neighborhood/mars/mars.cpp b/engines/pegasus/neighborhood/mars/mars.cpp
index a83b780..f7493db 100644
--- a/engines/pegasus/neighborhood/mars/mars.cpp
+++ b/engines/pegasus/neighborhood/mars/mars.cpp
@@ -2480,6 +2480,7 @@ void Mars::doCanyonChase() {
 	_shuttleEnergyMeter.initShuttleEnergyMeter();
 	_shuttleEnergyMeter.powerUpMeter();
 	while (_shuttleEnergyMeter.isFading()) {
+		InputDevice.pumpEvents();
 		_vm->checkCallBacks();
 		_vm->refreshDisplay();
 		g_system->updateScreen();
@@ -2816,6 +2817,7 @@ void Mars::marsTimerExpired(MarsTimerEvent &event) {
 		GameState.setScoringEnteredLaunchTube();
 
 		while (_canyonChaseMovie.isRunning()) {
+			InputDevice.pumpEvents();
 			_vm->checkCallBacks();
 			_vm->refreshDisplay();
 			_vm->_system->delayMillis(10);
@@ -2949,6 +2951,7 @@ void Mars::marsTimerExpired(MarsTimerEvent &event) {
 		showBigExplosion(r, kShuttleAlienShipOrder);
 
 		while (_explosions.isRunning()) {
+			InputDevice.pumpEvents();
 			_vm->checkCallBacks();
 			_vm->refreshDisplay();
 			g_system->delayMillis(10);
@@ -3142,6 +3145,7 @@ void Mars::spaceChaseClick(const Input &input, const HotSpotID id) {
 				_shuttleEnergyMeter.drainForTractorBeam();
 
 				while (_shuttleEnergyMeter.isFading()) {
+					InputDevice.pumpEvents();
 					_vm->checkCallBacks();
 					_vm->refreshDisplay();
 					_vm->_system->delayMillis(10);
@@ -3176,6 +3180,7 @@ void Mars::spaceChaseClick(const Input &input, const HotSpotID id) {
 
 					// wait here until any junk clears...
 					while (_junk.junkFlying()) {
+						InputDevice.pumpEvents();
 						_vm->checkCallBacks();
 						_vm->refreshDisplay();
 						_vm->_system->delayMillis(10);
diff --git a/engines/pegasus/neighborhood/neighborhood.cpp b/engines/pegasus/neighborhood/neighborhood.cpp
index 3116bd7..320fbda 100644
--- a/engines/pegasus/neighborhood/neighborhood.cpp
+++ b/engines/pegasus/neighborhood/neighborhood.cpp
@@ -470,6 +470,7 @@ void Neighborhood::requestSpotSound(const TimeValue in, const TimeValue out, con
 void Neighborhood::playSpotSoundSync(const TimeValue in, const TimeValue out) {
 	// Let the action queue play out first...
 	while (!actionQueueEmpty()) {
+		InputDevice.pumpEvents();
 		_vm->checkCallBacks();
 		_vm->refreshDisplay();
 		_vm->checkNotifications();
@@ -480,6 +481,7 @@ void Neighborhood::playSpotSoundSync(const TimeValue in, const TimeValue out) {
 	_spotSounds.playSoundSegment(in, out);
 
 	while (_spotSounds.isPlaying()) {
+		InputDevice.pumpEvents();
 		_vm->checkCallBacks();
 		_vm->refreshDisplay();
 		_vm->_system->delayMillis(10);
@@ -1105,6 +1107,7 @@ void Neighborhood::startTurnPush(const TurnDirection turnDirection, const TimeVa
 	_turnPush.continueFader();
 
 	do {
+		InputDevice.pumpEvents();
 		_vm->checkCallBacks();
 		_vm->refreshDisplay();
 		_vm->_system->delayMillis(10);
@@ -1616,6 +1619,7 @@ void Neighborhood::playMovieSegment(Movie *movie, TimeValue startTime, TimeValue
 	movie->start();
 
 	while (movie->isRunning()) {
+		InputDevice.pumpEvents();
 		_vm->checkCallBacks();
 		_vm->refreshDisplay();
 		_vm->_system->delayMillis(10);
diff --git a/engines/pegasus/neighborhood/wsc/wsc.cpp b/engines/pegasus/neighborhood/wsc/wsc.cpp
index 09e2a48..f009b35 100644
--- a/engines/pegasus/neighborhood/wsc/wsc.cpp
+++ b/engines/pegasus/neighborhood/wsc/wsc.cpp
@@ -2029,6 +2029,7 @@ void WSC::moleculeGameClick(const HotSpotID id) {
 			_moleculesMovie.start();
 
 			while (_moleculesMovie.isRunning()) {
+				InputDevice.pumpEvents();
 				_vm->checkCallBacks();
 				_vm->refreshDisplay();
 				_vm->_system->delayMillis(10);
@@ -2063,6 +2064,7 @@ void WSC::moleculeGameClick(const HotSpotID id) {
 		_moleculesMovie.start();
 
 		while (_moleculesMovie.isRunning()) {
+			InputDevice.pumpEvents();
 			_vm->checkCallBacks();
 			_vm->refreshDisplay();
 			_vm->_system->delayMillis(10);
@@ -2076,6 +2078,7 @@ void WSC::moleculeGameClick(const HotSpotID id) {
 
 
 		while (_moleculesMovie.isRunning()) {
+			InputDevice.pumpEvents();
 			_vm->checkCallBacks();
 			_vm->refreshDisplay();
 			_vm->_system->delayMillis(10);
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp
index 2062fe6..a0ec12a 100644
--- a/engines/pegasus/pegasus.cpp
+++ b/engines/pegasus/pegasus.cpp
@@ -836,6 +836,7 @@ void PegasusEngine::delayShell(TimeValue time, TimeScale scale) {
 	uint32 timeInMillis = time * 1000 / scale;
 
 	while (g_system->getMillis() < startTime + timeInMillis) {
+		InputDevice.pumpEvents();
 		checkCallBacks();
 		_gfx->updateDisplay();
 	}
@@ -2175,6 +2176,7 @@ void PegasusEngine::autoDragItemIntoRoom(Item *item, Sprite *draggingSprite) {
 	_autoDragger.autoDrag(draggingSprite, start, stop, time, kDefaultTimeScale);
 
 	while (_autoDragger.isDragging()) {
+		InputDevice.pumpEvents();
 		checkCallBacks();
 		refreshDisplay();
 		_system->delayMillis(10);
@@ -2208,6 +2210,7 @@ void PegasusEngine::autoDragItemIntoInventory(Item *, Sprite *draggingSprite) {
 	_autoDragger.autoDrag(draggingSprite, start, stop, time, kDefaultTimeScale);
 
 	while (_autoDragger.isDragging()) {
+		InputDevice.pumpEvents();
 		checkCallBacks();
 		refreshDisplay();
 		_system->delayMillis(10);
@@ -2284,10 +2287,7 @@ void PegasusEngine::doSubChase() {
 				drawScaledFrame(frame, 0, 0);
 		}
 
-		Common::Event event;
-		while (_eventMan->pollEvent(event))
-			;
-
+		InputDevice.pumpEvents();
 		_system->delayMillis(10);
 	}
 






More information about the Scummvm-git-logs mailing list