aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-07-15 15:23:19 +0000
committerTorbjörn Andersson2005-07-15 15:23:19 +0000
commit51e76c703f6b488d8fe190c225eac0c87b41270b (patch)
treee052932f9ffb4f38c096f80efc94e6d72ea66601
parentb0d342be1088f6898bd0bfcd693e4cce7367a1b2 (diff)
downloadscummvm-rg350-51e76c703f6b488d8fe190c225eac0c87b41270b.tar.gz
scummvm-rg350-51e76c703f6b488d8fe190c225eac0c87b41270b.tar.bz2
scummvm-rg350-51e76c703f6b488d8fe190c225eac0c87b41270b.zip
Added the puzzle voices from the CD version. I don't know if this breaks
the floppy version, and it's still not flawless. But it's a start. svn-id: r18544
-rw-r--r--saga/actor.cpp4
-rw-r--r--saga/actor.h2
-rw-r--r--saga/puzzle.cpp15
-rw-r--r--saga/puzzle.h8
-rw-r--r--saga/sfuncs.cpp2
5 files changed, 20 insertions, 11 deletions
diff --git a/saga/actor.cpp b/saga/actor.cpp
index e4c48c266a..bd59f79fe8 100644
--- a/saga/actor.cpp
+++ b/saga/actor.cpp
@@ -1886,7 +1886,7 @@ void Actor::actorSpeech(uint16 actorId, const char **strings, int stringsCount,
}
}
-void Actor::nonActorSpeech(const Common::Rect &box, const char **strings, int stringsCount, int speechFlags) {
+void Actor::nonActorSpeech(const Common::Rect &box, const char **strings, int stringsCount, int sampleResourceId, int speechFlags) {
int i;
_vm->_script->wakeUpThreads(kWaitTypeSpeech);
@@ -1898,7 +1898,7 @@ void Actor::nonActorSpeech(const Common::Rect &box, const char **strings, int st
_activeSpeech.speechFlags = speechFlags;
_activeSpeech.actorsCount = 1;
_activeSpeech.actorIds[0] = 0;
- _activeSpeech.sampleResourceId = -1;
+ _activeSpeech.sampleResourceId = sampleResourceId;
_activeSpeech.playing = false;
_activeSpeech.slowModeCharIndex = 0;
_activeSpeech.speechBox = box;
diff --git a/saga/actor.h b/saga/actor.h
index 271d7a39dc..69668dfcb5 100644
--- a/saga/actor.h
+++ b/saga/actor.h
@@ -554,7 +554,7 @@ public:
// speech
void actorSpeech(uint16 actorId, const char **strings, int stringsCount, int sampleResourceId, int speechFlags);
- void nonActorSpeech(const Common::Rect &box, const char **strings, int stringsCount, int speechFlags);
+ void nonActorSpeech(const Common::Rect &box, const char **strings, int stringsCount, int sampleResourceId, int speechFlags);
void simulSpeech(const char *string, uint16 *actorIds, int actorIdsCount, int speechFlags, int sampleResourceId);
void setSpeechColor(int speechColor, int outlineColor) {
_activeSpeech.speechColor[0] = speechColor;
diff --git a/saga/puzzle.cpp b/saga/puzzle.cpp
index 44cfde0a6c..3fda0eccc2 100644
--- a/saga/puzzle.cpp
+++ b/saga/puzzle.cpp
@@ -484,13 +484,14 @@ void Puzzle::solicitHint(void) {
if (_hintOffer >= NUM_SOLICIT_REPLIES)
_hintOffer = 0;
- _vm->_actor->nonActorSpeech(_hintBox, &solicitStr[_lang][i], 1, 0);
-
// Determine which of the journeymen will offer then
// hint, and then show that character's portrait.
_hintGiver = portraitList[i];
+ _hintSpeaker = _hintGiver - RID_ITE_JFERRET_SERIOUS;
_vm->_interface->setRightPortrait(_hintGiver);
+ _vm->_actor->nonActorSpeech(_hintBox, &solicitStr[_lang][i], 1, PUZZLE_SOLICIT_SOUNDS + i * 3 + _hintSpeaker, 0);
+
// Add Rif's reply to the list.
clearHint();
@@ -507,7 +508,7 @@ void Puzzle::solicitHint(void) {
case kRQHintRequested:
i = _vm->_rnd.getRandomNumber(NUM_SAKKA - 1);
- _vm->_actor->nonActorSpeech(_hintBox, &sakkaStr[_lang][i], 1, 0);
+ _vm->_actor->nonActorSpeech(_hintBox, &sakkaStr[_lang][i], 1, PUZZLE_SAKKA_SOUNDS + i, 0);
_vm->_interface->setRightPortrait(RID_ITE_SAKKA_APPRAISING);
@@ -524,7 +525,7 @@ void Puzzle::solicitHint(void) {
case kRQHintRequestedStage2:
if (_vm->_rnd.getRandomNumber(1)) { // Skip Reply part
i = _vm->_rnd.getRandomNumber(NUM_WHINES - 1);
- _vm->_actor->nonActorSpeech(_hintBox, &whineStr[_lang][i], 1, 0);
+ _vm->_actor->nonActorSpeech(_hintBox, &whineStr[_lang][i], 1, PUZZLE_WHINE_SOUNDS + i * 3 + _hintSpeaker, 0);
}
_vm->_interface->setRightPortrait(_hintGiver);
@@ -592,7 +593,7 @@ void Puzzle::giveHint(void) {
_vm->_actor->setSpeechColor(1, kITEColorBlack);
if (_hintCount < 3) {
- _vm->_actor->nonActorSpeech(_hintBox, &hintStr[_lang][_hintCount], 1, 0 );
+ _vm->_actor->nonActorSpeech(_hintBox, &hintStr[_lang][_hintCount], 1, PUZZLE_HINT_SOUNDS + _hintCount * 3 + _hintSpeaker, 0);
} else {
int piece = 0;
@@ -611,11 +612,11 @@ void Puzzle::giveHint(void) {
const char *hintPtr = hintBuf;
sprintf(hintBuf, optionsStr[_lang][kROHint], pieceNames[piece]);
- _vm->_actor->nonActorSpeech(_hintBox, &hintPtr, 1, 0);
+ _vm->_actor->nonActorSpeech(_hintBox, &hintPtr, 1, PUZZLE_TOOL_SOUNDS + _hintSpeaker + piece, 0);
}
else {
// If no pieces are in the wrong place
- _vm->_actor->nonActorSpeech(_hintBox, &hintStr[_lang][3], 1, 0);
+ _vm->_actor->nonActorSpeech(_hintBox, &hintStr[_lang][3], 1, PUZZLE_HINT_SOUNDS + 3 * 3 + _hintSpeaker, 0);
}
}
_hintCount++;
diff --git a/saga/puzzle.h b/saga/puzzle.h
index 6210c5c389..430c4d00f2 100644
--- a/saga/puzzle.h
+++ b/saga/puzzle.h
@@ -26,6 +26,13 @@ namespace Saga {
#define PUZZLE_PIECES 15
+#define PUZZLE_SOUNDS 3622
+#define PUZZLE_TOOL_SOUNDS (PUZZLE_SOUNDS + 0)
+#define PUZZLE_HINT_SOUNDS (PUZZLE_SOUNDS + 45)
+#define PUZZLE_SOLICIT_SOUNDS (PUZZLE_SOUNDS + 57)
+#define PUZZLE_WHINE_SOUNDS (PUZZLE_SOUNDS + 72)
+#define PUZZLE_SAKKA_SOUNDS (PUZZLE_SOUNDS + 87)
+
class Puzzle {
private:
enum kRQStates {
@@ -45,6 +52,7 @@ private:
kRQStates _hintRqState;
int _hintGiver;
+ int _hintSpeaker;
int _hintOffer;
int _hintCount;
int _helpCount;
diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp
index 5ec1fa45dd..4fc7b2c1b7 100644
--- a/saga/sfuncs.cpp
+++ b/saga/sfuncs.cpp
@@ -1538,7 +1538,7 @@ void Script::sfScriptText(SCRIPTFUNC_PARAMS) {
rect.setWidth(width);
_vm->_actor->setSpeechColor(color, kITEColorBlack);
- _vm->_actor->nonActorSpeech(rect, &text, 1, flags);
+ _vm->_actor->nonActorSpeech(rect, &text, 1, -1, flags);
}
// Script function #60 (0x3C)