/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #include "common/config-manager.h" #include "common/file.h" #include "common/memstream.h" #include "common/substream.h" #include "audio/audiostream.h" #include "graphics/macgui/mactext.h" #ifdef USE_PNG #include "image/png.h" #endif #include "director/director.h" #include "director/cast.h" #include "director/castmember.h" #include "director/score.h" #include "director/frame.h" #include "director/movie.h" #include "director/sound.h" #include "director/cursor.h" #include "director/channel.h" #include "director/sprite.h" #include "director/window.h" #include "director/util.h" #include "director/lingo/lingo.h" namespace Director { #include "director/palette-fade.h" Score::Score(Movie *movie) { _movie = movie; _window = movie->getWindow(); _vm = _movie->getVM(); _lingo = _vm->getLingo(); _soundManager = _window->getSoundManager(); _puppetTempo = 0x00; _puppetPalette = false; _lastPalette = 0; _paletteTransitionIndex = 0; memset(_paletteSnapshotBuffer, 0, 768); _labels = nullptr; _currentFrameRate = 20; _currentFrame = 0; _nextFrame = 0; _currentLabel = 0; _nextFrameTime = 0; _lastTempo = 0; _waitForChannel = 0; _waitForVideoChannel = 0; _cursorDirty = false; _waitForClick = false; _waitForClickCursor = false; _activeFade = 0; _playState = kPlayNotStarted; _numChannelsDisplayed = 0; _framesRan = 0; // used by kDebugFewFramesOnly and kDebugScreenshot } Score::~Score() { for (uint i = 0; i < _frames.size(); i++) delete _frames[i]; for (uint i = 0; i < _channels.size(); i++) delete _channels[i]; if (_labels) for (Common::SortedArray