2016-08-23 09:41:00 +02: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 12:46:38 +02:00
|
|
|
*
|
2016-08-23 09:41:00 +02: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 12:46:38 +02:00
|
|
|
*
|
2016-08-23 09:41:00 +02: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_SPRITE_H
|
|
|
|
#define DIRECTOR_SPRITE_H
|
|
|
|
|
|
|
|
namespace Director {
|
|
|
|
|
2019-12-24 00:02:44 +01:00
|
|
|
class BitmapCast;
|
|
|
|
class ButtonCast;
|
|
|
|
class ShapeCast;
|
|
|
|
class TextCast;
|
|
|
|
|
2016-08-23 09:41:00 +02:00
|
|
|
enum SpritePosition {
|
|
|
|
kSpritePositionUnk1 = 0,
|
|
|
|
kSpritePositionEnabled,
|
|
|
|
kSpritePositionUnk2,
|
|
|
|
kSpritePositionFlags = 4,
|
|
|
|
kSpritePositionCastId = 6,
|
|
|
|
kSpritePositionY = 8,
|
|
|
|
kSpritePositionX = 10,
|
|
|
|
kSpritePositionHeight = 12,
|
|
|
|
kSpritePositionWidth = 14
|
|
|
|
};
|
|
|
|
|
|
|
|
enum MainChannelsPosition {
|
|
|
|
kScriptIdPosition = 0,
|
|
|
|
kSoundType1Position,
|
|
|
|
kTransFlagsPosition,
|
|
|
|
kTransChunkSizePosition,
|
|
|
|
kTempoPosition,
|
|
|
|
kTransTypePosition,
|
|
|
|
kSound1Position,
|
|
|
|
kSkipFrameFlagsPosition = 8,
|
|
|
|
kBlendPosition,
|
|
|
|
kSound2Position,
|
|
|
|
kSound2TypePosition = 11,
|
|
|
|
kPaletePosition = 15
|
|
|
|
};
|
|
|
|
|
|
|
|
class Sprite {
|
|
|
|
public:
|
|
|
|
Sprite();
|
|
|
|
Sprite(const Sprite &sprite);
|
|
|
|
~Sprite();
|
2016-10-28 22:48:28 +02:00
|
|
|
|
2019-12-27 23:09:57 +01:00
|
|
|
uint16 getPattern();
|
|
|
|
void setPattern(uint16 pattern);
|
|
|
|
|
2016-10-28 22:48:28 +02:00
|
|
|
uint16 _scriptId;
|
|
|
|
byte _flags2; // x40 editable, 0x80 moveable
|
|
|
|
byte _unk2;
|
|
|
|
uint32 _unk3;
|
|
|
|
|
2016-08-23 09:41:00 +02:00
|
|
|
bool _enabled;
|
2017-01-09 09:46:51 +11:00
|
|
|
uint16 _castId;
|
|
|
|
byte _spriteType;
|
2016-08-23 09:41:00 +02:00
|
|
|
InkType _ink;
|
|
|
|
uint16 _trails;
|
2017-03-12 00:18:03 +11:00
|
|
|
|
2019-12-30 13:16:10 +01:00
|
|
|
Cast *_cast;
|
2017-03-12 00:18:03 +11:00
|
|
|
|
2016-08-23 09:41:00 +02:00
|
|
|
uint16 _flags;
|
|
|
|
Common::Point _startPoint;
|
|
|
|
uint16 _width;
|
|
|
|
uint16 _height;
|
2016-11-04 23:50:01 +01:00
|
|
|
// TODO: default constraint = 0, if turned on, sprite is constrainted to the bounding rect
|
|
|
|
// As i know, constrainted != 0 only if sprite moveable
|
2016-08-23 09:41:00 +02:00
|
|
|
byte _constraint;
|
|
|
|
byte _moveable;
|
|
|
|
byte _backColor;
|
|
|
|
byte _foreColor;
|
2019-12-27 22:43:42 +01:00
|
|
|
|
2016-08-23 09:41:00 +02:00
|
|
|
uint16 _left;
|
|
|
|
uint16 _right;
|
|
|
|
uint16 _top;
|
|
|
|
uint16 _bottom;
|
|
|
|
byte _blend;
|
|
|
|
bool _visible;
|
|
|
|
SpriteType _type;
|
2016-11-04 23:50:01 +01:00
|
|
|
// Using in digital movie sprites
|
2016-08-23 09:41:00 +02:00
|
|
|
byte _movieRate;
|
|
|
|
uint16 _movieTime;
|
|
|
|
uint16 _startTime;
|
|
|
|
uint16 _stopTime;
|
|
|
|
byte _volume;
|
|
|
|
byte _stretch;
|
2016-11-04 23:50:01 +01:00
|
|
|
// Using in shape sprites
|
2016-08-23 09:41:00 +02:00
|
|
|
byte _lineSize;
|
2016-11-04 23:50:01 +01:00
|
|
|
// Using in text sprites
|
2016-08-23 09:41:00 +02:00
|
|
|
Common::String _editableText;
|
|
|
|
};
|
|
|
|
|
2016-11-04 23:50:01 +01:00
|
|
|
} // End of namespace Director
|
2016-08-23 09:41:00 +02:00
|
|
|
|
|
|
|
#endif
|