aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-12-13 19:03:27 +0100
committerEugene Sandulenko2019-12-13 19:03:27 +0100
commitd09cb00df11701282c809467b45d6d41df14bf0f (patch)
treec58ee94c34a530a1c920b3c7d121f085c3dab79f
parentfc2acdd8bb0fb44a151aaf12bbc7441988f4ac35 (diff)
downloadscummvm-rg350-d09cb00df11701282c809467b45d6d41df14bf0f.tar.gz
scummvm-rg350-d09cb00df11701282c809467b45d6d41df14bf0f.tar.bz2
scummvm-rg350-d09cb00df11701282c809467b45d6d41df14bf0f.zip
DIRECTOR: Fix label processing
-rw-r--r--engines/director/score.cpp12
-rw-r--r--engines/director/score.h2
2 files changed, 4 insertions, 10 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index c6317b9fd5..1c7fed1ade 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -83,6 +83,7 @@ Score::Score(DirectorEngine *vm) {
_currentFrameRate = 20;
_castArrayStart = _castArrayEnd = 0;
_currentFrame = 0;
+ _currentLabel = 0;
_nextFrameTime = 0;
_flags = 0;
_stopPlay = false;
@@ -1059,18 +1060,11 @@ void Score::loadCastInfo(Common::SeekableSubReadStreamEndian &stream, uint16 id)
void Score::gotoLoop() {
// This command has the playback head contonuously return to the first marker to to the left and then loop back.
// If no marker are to the left of the playback head, the playback head continues to the right.
- Common::SortedArray<Label *>::iterator i;
-
if (_labels == NULL) {
_currentFrame = 0;
return;
} else {
- for (i = _labels->begin(); i != _labels->end(); ++i) {
- if ((*i)->name == _currentLabel) {
- _currentFrame = (*i)->number;
- return;
- }
- }
+ _currentFrame = _currentLabel;
}
_vm->_skipFrameAdvance = true;
@@ -1328,7 +1322,7 @@ void Score::update() {
if (_labels != NULL) {
for (i = _labels->begin(); i != _labels->end(); ++i) {
if ((*i)->number == _currentFrame) {
- _currentLabel = (*i)->name;
+ _currentLabel = _currentFrame;
}
}
}
diff --git a/engines/director/score.h b/engines/director/score.h
index bc7a41a733..d217a47227 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -164,7 +164,7 @@ private:
byte _currentFrameRate;
uint16 _castArrayStart;
uint16 _currentFrame;
- Common::String _currentLabel;
+ int _currentLabel;
uint32 _flags;
uint16 _castArrayEnd;
uint16 _movieScriptCount;