mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-01 00:12:59 +00:00
TSAGE: Bugfixes and extra commenting for R2R conversation display
This commit is contained in:
parent
546c6a07e4
commit
18cfbc6c2d
@ -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);
|
||||
|
@ -178,12 +178,13 @@ public:
|
||||
};
|
||||
|
||||
#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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -239,6 +239,9 @@ public:
|
||||
|
||||
namespace Ringworld2 {
|
||||
|
||||
#define SPEECH_TEXT 1
|
||||
#define SPEECH_VOICE 2
|
||||
|
||||
class Ringworld2Globals: public TsAGE2Globals {
|
||||
public:
|
||||
ASoundExt _sound1, _sound2, _sound3, _sound4;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user