[Scummvm-git-logs] scummvm master -> eaa602bb3d18ce9b3a66e2fa82d505fe2b69b4c0
rvanlaar
noreply at scummvm.org
Thu Jan 20 23:00:39 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
eaa602bb3d DIRECTOR: LINGO: store comments from frame labels
Commit: eaa602bb3d18ce9b3a66e2fa82d505fe2b69b4c0
https://github.com/scummvm/scummvm/commit/eaa602bb3d18ce9b3a66e2fa82d505fe2b69b4c0
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2022-01-20T23:59:17+01:00
Commit Message:
DIRECTOR: LINGO: store comments from frame labels
In Director only the first line of a label is seen as the frame label.
The other lines are treated as comments.
The label comment is now shown with debugging ouput.
Changed paths:
engines/director/castmember.h
engines/director/score.cpp
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;
-
- for (uint32 j = stringPos; j < nextStringPos; j++) {
- label += stream.readByte();
+ Common::String comment = "";
+ char ch;
+
+ 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());
}
}
More information about the Scummvm-git-logs
mailing list