diff options
author | lukaslw | 2014-07-07 00:19:15 +0200 |
---|---|---|
committer | lukaslw | 2014-07-07 00:19:15 +0200 |
commit | bdd7206fe2f508989331525563a586574d19bfe4 (patch) | |
tree | 27f9ab93c09a5e0bae2f016fd1b84d9e6e4e5476 | |
parent | 0301b635deae45fac6ea8dd66917b5e1c09213e8 (diff) | |
download | scummvm-rg350-bdd7206fe2f508989331525563a586574d19bfe4.tar.gz scummvm-rg350-bdd7206fe2f508989331525563a586574d19bfe4.tar.bz2 scummvm-rg350-bdd7206fe2f508989331525563a586574d19bfe4.zip |
PRINCE: setVoice() fix
-rw-r--r-- | engines/prince/prince.cpp | 7 | ||||
-rw-r--r-- | engines/prince/script.cpp | 2 | ||||
-rw-r--r-- | engines/prince/variatxt.cpp | 4 | ||||
-rw-r--r-- | engines/prince/variatxt.h | 2 |
4 files changed, 8 insertions, 7 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index 62b5197cac..29cd43c079 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -643,7 +643,8 @@ void PrinceEngine::setVoice(uint16 slot, uint32 sampleSlot, uint16 flag) { uint32 currentString = _interpreter->getCurrentString(); if (currentString >= 80000) { - sampleName = Common::String::format("%05d-%02d.WAV", currentString - 80000, flag); + uint32 nr = currentString - 80000; + sampleName = Common::String::format("%02d0%02d-%02d.WAV", nr / 100, nr % 100, flag); } else if (currentString >= 70000) { sampleName = Common::String::format("inv%02d-01.WAV", currentString - 70000); } else if (currentString >= 60000) { @@ -2072,7 +2073,7 @@ void PrinceEngine::inventoryLeftMouseButton() { textNr = 80020; // "Nothing is happening." } _interpreter->setCurrentString(textNr); - printAt(0, 216, _variaTxt->getString(textNr - 80000), kNormalWidth / 2, 100); + printAt(0, 216, (char *)_variaTxt->getString(textNr - 80000), kNormalWidth / 2, 100); setVoice(0, 28, 1); playSample(28, 0); //exit_normally @@ -2147,7 +2148,7 @@ void PrinceEngine::inventoryLeftMouseButton() { textNr = 80020; // "Nothing is happening." } _interpreter->setCurrentString(textNr); - printAt(0, 216, _variaTxt->getString(textNr - 80000), kNormalWidth / 2, 100); + printAt(0, 216, (char *)_variaTxt->getString(textNr - 80000), kNormalWidth / 2, 100); setVoice(0, 28, 1); playSample(28, 0); //exit_normally diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp index 84dfd7754a..93a4b9621e 100644 --- a/engines/prince/script.cpp +++ b/engines/prince/script.cpp @@ -932,7 +932,7 @@ void Interpreter::O_SETSTRING() { _currentString = offset; if (offset >= 80000) { - _string = (byte *)_vm->_variaTxt->getString(offset - 80000); + _string = _vm->_variaTxt->getString(offset - 80000); debugInterpreter("GetVaria %s", _string); } else if (offset < 2000) { diff --git a/engines/prince/variatxt.cpp b/engines/prince/variatxt.cpp index 56fbd2911a..eb4efd8877 100644 --- a/engines/prince/variatxt.cpp +++ b/engines/prince/variatxt.cpp @@ -42,12 +42,12 @@ bool VariaTxt::loadFromStream(Common::SeekableReadStream &stream) { return true; } -char *VariaTxt::getString(uint32 stringId) { +byte *VariaTxt::getString(uint32 stringId) { uint32 stringOffset = READ_LE_UINT32(_data + stringId * 4); if (stringOffset > _dataSize) { assert(false); } - return (char *)_data + stringOffset; + return _data + stringOffset; } } diff --git a/engines/prince/variatxt.h b/engines/prince/variatxt.h index b7fc7e3ac5..98efad2059 100644 --- a/engines/prince/variatxt.h +++ b/engines/prince/variatxt.h @@ -32,7 +32,7 @@ public: bool loadFromStream(Common::SeekableReadStream &stream); - char *getString(uint32 stringId); + byte *getString(uint32 stringId); private: uint32 _dataSize; |