[Scummvm-cvs-logs] scummvm master -> 6bde2926c1834bf90865d3a112dbe29de97ca35f

somaen einarjohan at somadalen.com
Sun Dec 9 16:44:47 CET 2012


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:
6bde2926c1 WINTERMUTE: Move "GetSoundLength" to BaseGameMusic


Commit: 6bde2926c1834bf90865d3a112dbe29de97ca35f
    https://github.com/scummvm/scummvm/commit/6bde2926c1834bf90865d3a112dbe29de97ca35f
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2012-12-09T07:41:18-08:00

Commit Message:
WINTERMUTE: Move "GetSoundLength" to BaseGameMusic

Changed paths:
    engines/wintermute/base/base_game_music.cpp



diff --git a/engines/wintermute/base/base_game_music.cpp b/engines/wintermute/base/base_game_music.cpp
index 0fd0961..365fa6e 100644
--- a/engines/wintermute/base/base_game_music.cpp
+++ b/engines/wintermute/base/base_game_music.cpp
@@ -479,6 +479,25 @@ bool BaseGameMusic::scCallMethod(ScScript *script, ScStack *stack, ScStack *this
 		
 		stack->pushBool(true);
 		return STATUS_OK;
+	} 
+
+	//////////////////////////////////////////////////////////////////////////
+	// GetSoundLength
+	//////////////////////////////////////////////////////////////////////////
+	else if (strcmp(name, "GetSoundLength") == 0) {
+		stack->correctParams(1);
+		
+		int length = 0;
+		const char *filename = stack->pop()->getString();
+		
+		BaseSound *sound = new BaseSound(_gameRef);
+		if (sound && DID_SUCCEED(sound->setSound(filename, Audio::Mixer::kMusicSoundType, true))) {
+			length = sound->getLength();
+			delete sound;
+			sound = NULL;
+		}
+		stack->pushInt(length);
+		return STATUS_OK;
 	} else {
 		return STATUS_FAILED;
 	}






More information about the Scummvm-git-logs mailing list