[Scummvm-cvs-logs] CVS: residual costume.cpp,1.23,1.24

Pawel Kolodziejski aquadran at users.sourceforge.net
Sun Jan 2 11:10:05 CET 2005


Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6061

Modified Files:
	costume.cpp 
Log Message:
fix handle sfx sound costume component

Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/costume.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- costume.cpp	1 Jan 2005 21:07:52 -0000	1.23
+++ costume.cpp	2 Jan 2005 19:08:44 -0000	1.24
@@ -497,14 +497,18 @@
 
 void SoundComponent::setKey(int val) {
 	switch (val) {
-	case 0:
-		g_imuse->startSfx(_soundName.c_str(), 127);
+	case 0: // "Play"
+		if (!g_imuse->getSoundStatus(_soundName.c_str())) {
+//			g_imuse->stopSound(_soundName.c_str());
+//		} else {
+			g_imuse->startSfx(_soundName.c_str(), 127);
+		}
 		break;
-	case 1:
+	case 1: // "Stop"
 		g_imuse->stopSound(_soundName.c_str());
 		break;
-	case 2:
-		g_imuse->stopSound(_soundName.c_str());
+	case 2: // "Stop Looping"
+		g_imuse->setHookId(_soundName.c_str(), 0x80);
 		break;
 	default:
 		warning("Unknown key %d for sound %s\n", val, _soundName);
@@ -708,8 +712,10 @@
 		return new BitmapComponent(parent, parentID, name);
 	else if (std::memcmp(tag, "mat ", 4) == 0)
 		return new MaterialComponent(parent, parentID, name);
+	else if (std::memcmp(tag, "sprt", 4) == 0)
+		return NULL;// new SpriteComponent(parent, parentID, name);
 
-	warning("Unknown tag '%.4s', name '%s'\n", tag, name);
+	error("Unknown tag '%.4s', name '%s'\n", tag, name);
 	return NULL;
 }
 





More information about the Scummvm-git-logs mailing list