diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index 2424064dda51..b802f71ff3e4 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -552,7 +552,7 @@ void Obj44::load(const byte *dataP) { s.skip(4); } - for (int idx = 0; idx < OBJ44_LIST_SIZE; ++idx) { + for (int idx = 0; idx < OBJ0A_LIST_SIZE; ++idx) { _list[idx]._id = s.readSint16LE(); _list[idx]._scriptOffset = s.readSint16LE(); s.skip(6); @@ -565,7 +565,7 @@ void Obj44::synchronize(Serializer &s) { s.syncAsSint32LE(_id); for (int idx = 0; idx < OBJ44_LIST_SIZE; ++idx) s.syncAsSint32LE(_callbackId[idx]); - for (int idx = 0; idx < OBJ44_LIST_SIZE; ++idx) + for (int idx = 0; idx < OBJ0A_LIST_SIZE; ++idx) _list[idx].synchronize(s); s.syncAsUint32LE(_speakerOffset); @@ -645,10 +645,12 @@ void StripManager::load() { // Get the object list byte *obj44List = g_resourceManager->getResource(RES_STRIP, _stripNum, 1); int dataSize = g_vm->_memoryManager.getSize(obj44List); - assert((dataSize % 0x44) == 0); + + int obj44Size = (g_vm->getGameID() == GType_Ringworld2) ? 126 : 68; + assert((dataSize % obj44Size) == 0); byte *dataP = obj44List; - for (int idx = 0; idx < (dataSize / 0x44); ++idx, dataP += 0x44) { + for (int idx = 0; idx < (dataSize / obj44Size); ++idx, dataP += obj44Size) { Obj44 obj; obj.load(dataP); _obj44List.push_back(obj); diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h index 2a08c78b210a..0c4eb9539dbf 100644 --- a/engines/tsage/converse.h +++ b/engines/tsage/converse.h @@ -178,12 +178,13 @@ class Obj0A : public Serialisable { }; #define OBJ44_LIST_SIZE 5 +#define OBJ0A_LIST_SIZE ((g_vm->getGameID() == GType_Ringworld2) ? 8 : 5) class Obj44 : public Serialisable { public: int _id; int _callbackId[OBJ44_LIST_SIZE]; - Obj0A _list[OBJ44_LIST_SIZE]; + Obj0A _list[8]; uint _speakerOffset; // Return to Ringworld specific field diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h index 360dbac0ae65..d6b1760b8072 100644 --- a/engines/tsage/detection_tables.h +++ b/engines/tsage/detection_tables.h @@ -150,7 +150,7 @@ static const tSageGameDescription gameDescriptions[] = { Common::EN_ANY, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, - GUIO2(GUIO_NOSPEECH, GUIO_NOSFX) + GUIO0() }, GType_Ringworld2, GF_CD | GF_ALT_REGIONS diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 9f137f4b92e7..769ad4c05411 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -383,7 +383,7 @@ void Ringworld2Globals::reset() { _v57C2C = 0; _v58CE2 = 0; Common::fill(&_v565F1[0], &_v565F1[MAX_CHARACTERS], 0); - _speechSubtitles = 0; + _speechSubtitles = SPEECH_VOICE | SPEECH_TEXT; _insetUp = 0; Common::fill(&_v565F1[0], &_v565F1[MAX_CHARACTERS], 0); diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 43e4af5cf90f..9048899953cc 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -239,6 +239,9 @@ class BlueForceGlobals: public TsAGE2Globals { namespace Ringworld2 { +#define SPEECH_TEXT 1 +#define SPEECH_VOICE 2 + class Ringworld2Globals: public TsAGE2Globals { public: ASoundExt _sound1, _sound2, _sound3, _sound4; diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index b442ab8c461c..214853ce86fa 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -774,7 +774,7 @@ void Scene125::signal() { case 12: if (_soundCount > 0) --_soundCount; - if (!_soundCount || (R2_GLOBALS._speechSubtitles & 2)) { + if (!_soundCount || (R2_GLOBALS._speechSubtitles & SPEECH_VOICE)) { _soundIndex = 0; R2_GLOBALS._playStream.stop(); } else { @@ -1148,7 +1148,7 @@ void Scene125::setDetails(int resNum, int lineNum) { R2_GLOBALS._sceneObjects->draw(); - if ((_soundCount > 0) && (R2_GLOBALS._speechSubtitles & 2)) { + if ((_soundCount > 0) && (R2_GLOBALS._speechSubtitles & SPEECH_VOICE)) { _sceneMode = 12; R2_GLOBALS._playStream.play(_soundIndexes[_soundIndex], this); } diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp index 7f39e3d63017..8c8bd7171ad8 100644 --- a/engines/tsage/ringworld2/ringworld2_speakers.cpp +++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp @@ -110,7 +110,7 @@ void VisualSpeaker::setText(const Common::String &msg) { Common::String s = msg; if (s.hasPrefix("!")) { s.deleteChar(0); - _soundId = atoi(msg.c_str()); + _soundId = atoi(s.c_str()); while (!s.empty() && (*s.c_str() >= '0' && *s.c_str() <= '9')) s.deleteChar(0); @@ -123,7 +123,7 @@ void VisualSpeaker::setText(const Common::String &msg) { _sceneText._width = _textWidth; _sceneText._fontNumber = _fontNumber; _sceneText._textMode = _textMode; - _sceneText.setup(msg); + _sceneText.setup(s); //_sceneText.clone(); @@ -131,12 +131,12 @@ void VisualSpeaker::setText(const Common::String &msg) { _sceneText.setPriority(0x100); // If subtitles are turned off, don't show the text - if (!(R2_GLOBALS._speechSubtitles & 1)) { + if (!(R2_GLOBALS._speechSubtitles & SPEECH_TEXT)) { _sceneText.hide(); } // Figure out the text delay if subtitles are turned on, or there's no speech resource specified - if ((R2_GLOBALS._speechSubtitles & 1) || !_soundId) { + if ((R2_GLOBALS._speechSubtitles & SPEECH_TEXT) || !_soundId) { const char *msgP = s.c_str(); int numWords = 0; while (*msgP != '\0') { @@ -159,10 +159,10 @@ void VisualSpeaker::setText(const Common::String &msg) { if (_fieldF6) { - if ((R2_GLOBALS._speechSubtitles & 1) || !_soundId) + if ((R2_GLOBALS._speechSubtitles & SPEECH_TEXT) || !_soundId) _sceneText.hide(); } else { - if ((R2_GLOBALS._speechSubtitles & 2) && _soundId) { + if ((R2_GLOBALS._speechSubtitles & SPEECH_VOICE) && _soundId) { if (!R2_GLOBALS._playStream.play(_soundId, NULL)) _sceneText.show(); }