diff --git a/engines/director/castmember.h b/engines/director/castmember.h index 0ac3e3c977c..4b11389a039 100644 --- a/engines/director/castmember.h +++ b/engines/director/castmember.h @@ -344,9 +344,10 @@ struct CastMemberInfo { }; struct Label { + Common::String comment; Common::String name; uint16 number; - Label(Common::String name1, uint16 number1) { name = name1; number = number1; } + Label(Common::String name1, uint16 number1, Common::String comment1) { name = name1; number = number1; comment = comment1;} }; class PaletteCastMember : public CastMember { diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 5ef3b19f2d2..2a23fbe577a 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -916,13 +916,30 @@ void Score::loadLabels(Common::SeekableReadStreamEndian &stream) { stream.seek(stringPos); Common::String label; + Common::String comment = ""; + char ch; - for (uint32 j = stringPos; j < nextStringPos; j++) { - label += stream.readByte(); + uint32 j = stringPos; + // handle label + while(j < nextStringPos) { + j++; + ch = stream.readByte(); + if (ch == '\r') + break; + label += ch; } + // handle label comments + while(j < nextStringPos) { + j++; + ch = stream.readByte(); + if (ch == '\r') + ch = '\n'; + comment += ch; + } + label = _movie->getCast()->decodeString(label).encode(Common::kUtf8); - _labels->insert(new Label(label, frame)); + _labels->insert(new Label(label, frame, comment)); stream.seek(streamPos); frame = nextFrame; @@ -933,7 +950,7 @@ void Score::loadLabels(Common::SeekableReadStreamEndian &stream) { debugC(2, kDebugLoading, "****** Loading labels"); for (j = _labels->begin(); j != _labels->end(); ++j) { - debugC(2, kDebugLoading, "Frame %d, Label '%s'", (*j)->number, utf8ToPrintable((*j)->name).c_str()); + debugC(2, kDebugLoading, "Frame %d, Label '%s', Comment '%s'", (*j)->number, utf8ToPrintable((*j)->name).c_str(), (*j)->comment.c_str()); } }