[Scummvm-cvs-logs] CVS: residual actor.cpp,1.5,1.6 actor.h,1.2,1.3 lua.cpp,1.15,1.16 mixer.cpp,1.1,1.2 mixer.h,1.2,1.3

James Brown ender at users.sourceforge.net
Fri Aug 22 14:53:35 CEST 2003


Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1:/tmp/cvs-serv8709

Modified Files:
	actor.cpp actor.h lua.cpp mixer.cpp mixer.h 
Log Message:
Implement '.' sentence skipping, and other shutUpActor use


Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/actor.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- actor.cpp	20 Aug 2003 14:29:59 -0000	1.5
+++ actor.cpp	21 Aug 2003 06:51:02 -0000	1.6
@@ -91,6 +91,13 @@
   return true;
 }
 
+void Actor::shutUp() {
+    if (talkSound_) {
+    	Mixer::instance()->stopVoice(talkSound_);
+	talkSound_ = NULL;
+    }
+}
+
 void Actor::pushCostume(const char *name) {
   Costume *newCost = ResourceLoader::instance()->
     loadCostume(name, currentCostume());

Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/residual/actor.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- actor.h	20 Aug 2003 14:29:59 -0000	1.2
+++ actor.h	21 Aug 2003 06:51:02 -0000	1.3
@@ -60,6 +60,7 @@
   void turn(int dir);
 
   void sayLine(const char *msg);
+  void shutUp();
   bool talking();
 
   void pushCostume(const char *name);

Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- lua.cpp	20 Aug 2003 20:04:52 -0000	1.15
+++ lua.cpp	21 Aug 2003 06:51:02 -0000	1.16
@@ -467,6 +467,12 @@
   }
 }
 
+static void ShutUpActor() {
+ Actor *act = check_actor(1);
+ if (act)
+  act->shutUp();
+}
+
 // Sector functions
 static void GetActorSector(void) {
   Actor *act = check_actor(1);
@@ -854,7 +860,6 @@
   "GetPointSector",
   "IsPointInSector",
   "SetActorFrustrumCull",
-  "ShutUpActor",
   "SetActorFollowBoxes",
   "SetActorHead",
   "GetCameraActor",
@@ -1122,7 +1127,8 @@
   { "InputDialog", InputDialog },
   { "ChangeTextObject", ChangeTextObject },
   { "GetTextObjectDimensions", GetTextObjectDimensions },
-  { "MakeTextObject", MakeTextObject }
+  { "MakeTextObject", MakeTextObject },
+  { "ShutUpActor", ShutUpActor }
 };
 
 void register_lua() {

Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/mixer.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mixer.cpp	15 Aug 2003 19:41:26 -0000	1.1
+++ mixer.cpp	21 Aug 2003 06:51:02 -0000	1.2
@@ -312,6 +312,18 @@
   }
 }
 
+void Mixer::stopVoice(Sound *s) {
+  AudioLock l;
+
+  for (sound_list::iterator i = voiceSounds_.begin();
+       i != voiceSounds_.end(); ) {
+    if (*i == s)
+      i = voiceSounds_.erase(i);
+    else
+      i++;
+  }
+}
+
 static int compareStates(const void *p1, const void *p2) {
   const imuseTableEntry *e1 = static_cast<const imuseTableEntry *>(p1);
   const imuseTableEntry *e2 = static_cast<const imuseTableEntry *>(p2);

Index: mixer.h
===================================================================
RCS file: /cvsroot/scummvm/residual/mixer.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mixer.h	15 Aug 2003 20:16:25 -0000	1.2
+++ mixer.h	21 Aug 2003 06:51:02 -0000	1.3
@@ -33,6 +33,7 @@
   void playVoice(Sound *s);
   void playSfx(Sound *s);
   void stopSfx(Sound *s);
+  void stopVoice(Sound *s);
   void setImuseState(int state);
   void setImuseSeq(int seq);
 





More information about the Scummvm-git-logs mailing list