DIRECTOR: Fix processing channels

This commit is contained in:
Eugene Sandulenko 2020-02-09 18:55:23 +01:00
parent 2177e685b7
commit 69ffcba521
3 changed files with 4 additions and 4 deletions

View File

@ -87,7 +87,7 @@ Frame::Frame(const Frame &frame) {
_sprites.resize(_numChannels + 1);
for (uint16 i = 0; i < _numChannels + 1; i++) {
for (uint16 i = 0; i <= _numChannels; i++) {
_sprites[i] = new Sprite(*frame._sprites[i]);
}
}
@ -581,7 +581,7 @@ void Frame::playTransition(Score *score) {
}
void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
for (uint16 i = 0; i < _numChannels; i++) {
for (uint16 i = 0; i <= _numChannels; i++) {
if (!_sprites[i]->_enabled)
continue;

View File

@ -258,7 +258,7 @@ void Lingo::processSpriteEvent(LEvent event) {
Frame *currentFrame = score->_frames[score->getCurrentFrame()];
if (event == kEventBeginSprite) {
// TODO: Check if this is also possibly a kSpriteScript?
for (uint16 i = 0; i < score->_numChannelsDisplayed; i++)
for (uint16 i = 0; i <= score->_numChannelsDisplayed; i++)
if (currentFrame->_sprites[i]->_enabled)
processEvent(event, kCastScript, currentFrame->_sprites[i]->_scriptId);

View File

@ -601,7 +601,7 @@ void Lingo::runTests() {
}
void Lingo::executeImmediateScripts(Frame *frame) {
for (uint16 i = 0; i < _vm->getCurrentScore()->_numChannelsDisplayed; i++) {
for (uint16 i = 0; i <= _vm->getCurrentScore()->_numChannelsDisplayed; i++) {
if (_vm->getCurrentScore()->_immediateActions.contains(frame->_sprites[i]->_scriptId)) {
g_lingo->processEvent(kEventMouseUp, kFrameScript, frame->_sprites[i]->_scriptId);
}