[Scummvm-cvs-logs] CVS: residual actor.cpp,1.2,1.3 costume.cpp,1.3,1.4 costume.h,1.2,1.3

James Brown ender at users.sourceforge.net
Tue Aug 19 20:22:22 CEST 2003


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

Modified Files:
	actor.cpp costume.cpp costume.h 
Log Message:
Just commit some WIP stuff before bed


Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/actor.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- actor.cpp	17 Aug 2003 22:52:15 -0000	1.2
+++ actor.cpp	19 Aug 2003 17:51:36 -0000	1.3
@@ -70,12 +70,19 @@
   talkSound_ = ResourceLoader::instance()->loadSound((msgId + ".wav").c_str());
   if (talkSound_ != NULL)
     Mixer::instance()->playVoice(talkSound_);
+
+  if (!costumeStack_.empty()) {
+    printf("Requesting talk chore\n");
+    costumeStack_.back()->playTalkChores();
+  }
 }
 
 bool Actor::talking() {
   if (talkSound_ == NULL)
     return false;
   if (talkSound_->done()) {
+    if (!costumeStack_.empty())
+      costumeStack_.back()->stopTalkChores();
     talkSound_ = NULL;
     return false;
   }

Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/costume.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- costume.cpp	19 Aug 2003 14:02:25 -0000	1.3
+++ costume.cpp	19 Aug 2003 17:51:36 -0000	1.4
@@ -532,6 +532,9 @@
     chores_[which].load(this, ts);
   }
 
+  for (int i=0; i < MAX_TALK_CHORES; i++)
+    talkChores_[i] = -1;
+
 delete[] tags;
 }
 
@@ -716,10 +719,29 @@
   return -1;
 }
 
+void Costume::playTalkChores() {
+ for (int i=0; i<MAX_TALK_CHORES; i++) {
+  if (talkChores_[i] > -1) {
+   printf("Running talk chore %d (%d)!\n", i, talkChores_[i], chores_[talkChores_[i]].name_);
+   chores_[talkChores_[i]].playLooping(); }
+   printf("Woo\n");
+  }
+}
+
+void Costume::stopTalkChores() {
+ for (int i=0; i<MAX_TALK_CHORES; i++) {
+  if ((talkChores_[i] > -1) && (chores_[i].playing_)) {
+   printf("Stopping talk chore %d!\n", i);
+   chores_[talkChores_[i]-1].stop();
+  }
+ }
+}
+
 void Costume::setTalkChore(int index, int chore) {
  if (index > MAX_TALK_CHORES)
   return;
 
+ printf("Setting chore %d(+1) to %d - %s\n", index, chore, chores_[chore].name_);
  talkChores_[index-1] = chore;
 }
 
@@ -736,3 +758,4 @@
     if (components_[i] != NULL)
       components_[i]->update();
 }
+

Index: costume.h
===================================================================
RCS file: /cvsroot/scummvm/residual/costume.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- costume.h	19 Aug 2003 12:27:17 -0000	1.2
+++ costume.h	19 Aug 2003 17:51:37 -0000	1.3
@@ -20,7 +20,7 @@
 
 #include "resource.h"
 
-#define MAX_TALK_CHORES 6	// Ender: Pulled this number from thin air. Check.
+#define MAX_TALK_CHORES 10
 class TextSplitter;
 class Actor;
 
@@ -42,7 +42,10 @@
   int isChoring(int num, bool excludeLooping);
   int isChoring(bool excludeLooping);
 
+  void playTalkChores();
+  void stopTalkChores();
   void setTalkChore(int index, int chore);
+
   void update();
   void draw();
 





More information about the Scummvm-git-logs mailing list