[Scummvm-cvs-logs] scummvm master -> 56af32f2ad06ea61f1a7c6662325e36d176f2c35

lukaslw lukaslw at gmail.com
Sat Nov 8 20:19:09 CET 2014


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

Summary:
ccb051f0e3 PRINCE: Implement pauseEngineIntern() - pause and resume music in GMM
56af32f2ad PRINCE: Reduce pause() and pause2() to one function and rename it to pausePrinceEngine()


Commit: ccb051f0e37481161a8546f74e6e96e2013de9e9
    https://github.com/scummvm/scummvm/commit/ccb051f0e37481161a8546f74e6e96e2013de9e9
Author: lukaslw (lukaslw at gmail.com)
Date: 2014-11-08T19:44:06+01:00

Commit Message:
PRINCE: Implement pauseEngineIntern() - pause and resume music in GMM

Changed paths:
    engines/prince/prince.cpp
    engines/prince/prince.h



diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index 00e1736..43ff218 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -427,6 +427,16 @@ Common::Error PrinceEngine::run() {
 	return Common::kNoError;
 }
 
+void PrinceEngine::pauseEngineIntern(bool pause) {
+	Engine::pauseEngineIntern(pause);
+	if (pause) {
+		_midiPlayer->pause();
+	}
+	else {
+		_midiPlayer->resume();
+	}
+}
+
 bool AnimListItem::loadFromStream(Common::SeekableReadStream &stream) {
 	int32 pos = stream.pos();
 
diff --git a/engines/prince/prince.h b/engines/prince/prince.h
index 48491c6..15887b2 100644
--- a/engines/prince/prince.h
+++ b/engines/prince/prince.h
@@ -256,6 +256,7 @@ public:
 	virtual ~PrinceEngine();
 
 	virtual bool hasFeature(EngineFeature f) const;
+	virtual void pauseEngineIntern(bool pause);
 	virtual bool canSaveGameStateCurrently();
 	virtual bool canLoadGameStateCurrently();
 	virtual Common::Error saveGameState(int slot, const Common::String &desc);


Commit: 56af32f2ad06ea61f1a7c6662325e36d176f2c35
    https://github.com/scummvm/scummvm/commit/56af32f2ad06ea61f1a7c6662325e36d176f2c35
Author: lukaslw (lukaslw at gmail.com)
Date: 2014-11-08T20:14:33+01:00

Commit Message:
PRINCE: Reduce pause() and pause2() to one function and rename it to pausePrinceEngine()

Changed paths:
    engines/prince/prince.cpp
    engines/prince/prince.h



diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index 43ff218..ad682c4 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -1983,7 +1983,7 @@ void PrinceEngine::blackPalette() {
 			free(blackPalette1);
 			return;
 		}
-		pause();
+		pausePrinceEngine();
 	}
 	free(paletteBackup);
 	free(blackPalette1);
@@ -2010,22 +2010,15 @@ void PrinceEngine::setPalette(const byte *palette) {
 				free(blackPalette_);
 				return;
 			}
-			pause();
+			pausePrinceEngine();
 		}
 		_graph->setPalette(palette);
 		free(blackPalette_);
 	}
 }
 
-void PrinceEngine::pause() {
-	int delay = 1000 / kFPS - int32(_system->getMillis() - _currentTime);
-	delay = delay < 0 ? 0 : delay;
-	_system->delayMillis(delay);
-	_currentTime = _system->getMillis();
-}
-
-void PrinceEngine::pause2() {
-	int delay = 1000 / (kFPS * 2) - int32(_system->getMillis() - _currentTime);
+void PrinceEngine::pausePrinceEngine(int fps) {
+	int delay = 1000 / fps - int32(_system->getMillis() - _currentTime);
 	delay = delay < 0 ? 0 : delay;
 	_system->delayMillis(delay);
 	_currentTime = _system->getMillis();
@@ -2138,7 +2131,7 @@ void PrinceEngine::addInvObj() {
 			if (shouldQuit()) {
 				return;
 			}
-			pause();
+			pausePrinceEngine();
 		}
 		while (_mst_shadow2 > 256) {
 			rememberScreenInv();
@@ -2152,7 +2145,7 @@ void PrinceEngine::addInvObj() {
 			if (shouldQuit()) {
 				return;
 			}
-			pause();
+			pausePrinceEngine();
 		}
 	} else {
 		//CURSEBLINK:
@@ -2170,7 +2163,7 @@ void PrinceEngine::addInvObj() {
 				if (shouldQuit()) {
 					return;
 				}
-				pause();
+				pausePrinceEngine();
 			}
 			while (_mst_shadow2 > 256) {
 				rememberScreenInv();
@@ -2184,7 +2177,7 @@ void PrinceEngine::addInvObj() {
 				if (shouldQuit()) {
 					return;
 				}
-				pause();
+				pausePrinceEngine();
 			}
 		}
 	}
@@ -2200,7 +2193,7 @@ void PrinceEngine::addInvObj() {
 		if (shouldQuit()) {
 			return;
 		}
-		pause();
+		pausePrinceEngine();
 	}
 }
 
@@ -2828,7 +2821,7 @@ void PrinceEngine::displayInventory() {
 
 		getDebugger()->onFrame();
 		_graph->update(_graph->_screenForInventory);
-		pause();
+		pausePrinceEngine();
 	}
 
 	if (_currentPointerNumber == 2) {
@@ -2953,7 +2946,7 @@ void PrinceEngine::dialogRun() {
 
 		getDebugger()->onFrame();
 		_graph->update(_graph->_frontScreen);
-		pause();
+		pausePrinceEngine();
 	}
 	_dialogImage->free();
 	delete _dialogImage;
@@ -3212,7 +3205,7 @@ void PrinceEngine::scrollCredits() {
 			}
 			_graph->change();
 			_graph->update(_graph->_frontScreen);
-			pause2();
+			pausePrinceEngine(kFPS * 2);
 		}
 		char letter2;
 		byte *scan2 = scrollAdress;
@@ -4816,7 +4809,7 @@ void PrinceEngine::mainLoop() {
 
 		openInventoryCheck();
 
-		pause();
+		pausePrinceEngine();
 	}
 }
 
diff --git a/engines/prince/prince.h b/engines/prince/prince.h
index 15887b2..c9cb83d 100644
--- a/engines/prince/prince.h
+++ b/engines/prince/prince.h
@@ -640,8 +640,7 @@ private:
 	static bool compareDrawNodes(DrawNode d1, DrawNode d2);
 	void runDrawNodes();
 	void makeShadowTable(int brightness);
-	void pause();
-	void pause2();
+	void pausePrinceEngine(int fps = kFPS);
 
 	uint32 getTextWidth(const char *s);
 	void debugEngine(const char *s, ...);






More information about the Scummvm-git-logs mailing list