2016-08-23 07:41:00 +00:00
|
|
|
/* 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 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2016-09-03 10:46:38 +00:00
|
|
|
*
|
2016-08-23 07:41:00 +00:00
|
|
|
* 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.
|
2016-09-03 10:46:38 +00:00
|
|
|
*
|
2016-08-23 07:41:00 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DIRECTOR_FRAME_H
|
|
|
|
#define DIRECTOR_FRAME_H
|
|
|
|
|
2016-08-23 11:30:00 +00:00
|
|
|
namespace Image {
|
2020-07-01 15:18:11 +00:00
|
|
|
class ImageDecoder;
|
2016-08-23 11:30:00 +00:00
|
|
|
}
|
2016-08-23 07:41:00 +00:00
|
|
|
|
2019-12-23 23:02:44 +00:00
|
|
|
namespace Graphics {
|
2020-07-01 15:18:11 +00:00
|
|
|
class ManagedSurface;
|
|
|
|
struct Surface;
|
2019-12-23 23:02:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace Common {
|
2020-07-01 15:18:11 +00:00
|
|
|
class ReadStreamEndian;
|
2019-12-23 23:02:44 +00:00
|
|
|
}
|
|
|
|
|
2016-08-23 07:41:00 +00:00
|
|
|
namespace Director {
|
|
|
|
|
2019-12-23 23:02:44 +00:00
|
|
|
class Score;
|
2016-08-23 07:41:00 +00:00
|
|
|
class Sprite;
|
2020-06-30 17:11:29 +00:00
|
|
|
class TextCastMember;
|
2016-08-23 07:41:00 +00:00
|
|
|
|
2016-10-28 20:48:28 +00:00
|
|
|
enum {
|
|
|
|
kChannelDataSize = (25 * 50)
|
|
|
|
};
|
|
|
|
|
2016-08-23 07:41:00 +00:00
|
|
|
struct PaletteInfo {
|
2020-07-27 02:21:01 +00:00
|
|
|
int paletteId;
|
2020-07-24 21:40:15 +00:00
|
|
|
|
2020-03-24 23:22:54 +00:00
|
|
|
byte firstColor;
|
|
|
|
byte lastColor;
|
|
|
|
byte flags;
|
|
|
|
byte speed;
|
2016-08-23 07:41:00 +00:00
|
|
|
uint16 frameCount;
|
2016-10-28 20:48:28 +00:00
|
|
|
uint16 cycleCount;
|
2020-08-04 04:26:15 +00:00
|
|
|
uint16 cycleLength;
|
2020-03-24 23:22:54 +00:00
|
|
|
byte fade;
|
|
|
|
byte delay;
|
|
|
|
byte style;
|
|
|
|
byte colorCode;
|
2020-07-27 10:14:19 +00:00
|
|
|
|
|
|
|
PaletteInfo() {
|
|
|
|
paletteId = 0;
|
|
|
|
firstColor = lastColor = 0;
|
|
|
|
flags = 0; speed = 0;
|
2020-08-04 04:26:15 +00:00
|
|
|
frameCount = cycleCount = cycleLength = 0;
|
2020-07-27 10:14:19 +00:00
|
|
|
fade = delay = style = colorCode = 0;
|
|
|
|
}
|
2016-08-23 07:41:00 +00:00
|
|
|
};
|
|
|
|
|
2017-01-11 22:45:23 +00:00
|
|
|
struct FrameEntity {
|
|
|
|
uint16 spriteId;
|
|
|
|
Common::Rect rect;
|
|
|
|
};
|
|
|
|
|
2016-08-23 07:41:00 +00:00
|
|
|
|
|
|
|
class Frame {
|
|
|
|
public:
|
2020-07-24 14:48:00 +00:00
|
|
|
Frame(Score *score, int numChannels);
|
2016-08-23 07:41:00 +00:00
|
|
|
Frame(const Frame &frame);
|
|
|
|
~Frame();
|
2020-07-24 14:48:00 +00:00
|
|
|
|
|
|
|
Score *getScore() const { return _score; }
|
|
|
|
|
2016-10-28 20:48:28 +00:00
|
|
|
void readChannels(Common::ReadStreamEndian *stream);
|
2016-08-23 07:41:00 +00:00
|
|
|
void readChannel(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size);
|
2017-03-12 18:17:32 +00:00
|
|
|
|
2017-03-14 08:25:45 +00:00
|
|
|
void executeImmediateScripts();
|
2016-08-23 07:41:00 +00:00
|
|
|
|
2020-05-16 03:09:46 +00:00
|
|
|
private:
|
|
|
|
|
2016-08-23 07:41:00 +00:00
|
|
|
void readPaletteInfo(Common::SeekableSubReadStreamEndian &stream);
|
|
|
|
void readSprite(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size);
|
|
|
|
void readMainChannels(Common::SeekableSubReadStreamEndian &stream, uint16 offset, uint16 size);
|
2017-01-13 01:17:36 +00:00
|
|
|
Image::ImageDecoder *getImageFrom(uint16 spriteId);
|
2020-06-30 17:11:29 +00:00
|
|
|
Common::String readTextStream(Common::SeekableSubReadStreamEndian *textStream, TextCastMember *textCast);
|
2020-05-16 03:09:46 +00:00
|
|
|
|
2020-07-24 21:40:15 +00:00
|
|
|
|
2016-08-23 07:41:00 +00:00
|
|
|
public:
|
2020-02-08 12:10:11 +00:00
|
|
|
int _numChannels;
|
2016-10-28 20:48:28 +00:00
|
|
|
byte _channelData[kChannelDataSize];
|
2020-07-21 20:42:18 +00:00
|
|
|
uint16 _actionId;
|
2020-03-25 01:00:10 +00:00
|
|
|
uint16 _transDuration;
|
2017-03-02 22:12:42 +00:00
|
|
|
uint8 _transArea; // 1 - Whole Stage, 0 - Changing Area
|
2016-08-23 07:41:00 +00:00
|
|
|
uint8 _transChunkSize;
|
|
|
|
TransitionType _transType;
|
2020-07-24 21:40:15 +00:00
|
|
|
PaletteInfo _palette;
|
2016-08-23 07:41:00 +00:00
|
|
|
uint8 _tempo;
|
|
|
|
|
|
|
|
uint16 _sound1;
|
|
|
|
uint8 _soundType1;
|
|
|
|
uint16 _sound2;
|
|
|
|
uint8 _soundType2;
|
|
|
|
|
2020-03-24 23:22:54 +00:00
|
|
|
byte _colorTempo;
|
|
|
|
byte _colorSound1;
|
|
|
|
byte _colorSound2;
|
|
|
|
byte _colorScript;
|
|
|
|
byte _colorTrans;
|
|
|
|
|
2016-08-23 07:41:00 +00:00
|
|
|
uint8 _skipFrameFlag;
|
|
|
|
uint8 _blend;
|
|
|
|
Common::Array<Sprite *> _sprites;
|
2020-07-24 14:48:00 +00:00
|
|
|
Score *_score;
|
2016-08-23 07:41:00 +00:00
|
|
|
DirectorEngine *_vm;
|
|
|
|
};
|
|
|
|
|
2016-11-04 22:50:01 +00:00
|
|
|
} // End of namespace Director
|
2016-08-23 07:41:00 +00:00
|
|
|
|
|
|
|
#endif
|