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.
|
|
|
|
*
|
2021-12-26 18:47:58 +01:00
|
|
|
* 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.
|
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
|
2021-12-26 18:47:58 +01:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2016-08-23 09:41:00 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DIRECTOR_SPRITE_H
|
|
|
|
#define DIRECTOR_SPRITE_H
|
|
|
|
|
|
|
|
namespace Director {
|
|
|
|
|
2020-07-24 10:48:00 -04:00
|
|
|
class Frame;
|
2020-06-30 13:11:29 -04:00
|
|
|
class BitmapCastMember;
|
|
|
|
class ShapeCastMember;
|
|
|
|
class TextCastMember;
|
2019-12-24 00:02:44 +01:00
|
|
|
|
2016-08-23 09:41:00 +02:00
|
|
|
enum SpritePosition {
|
|
|
|
kSpritePositionUnk1 = 0,
|
2021-10-06 23:52:49 +08:00
|
|
|
kSpritePositionEnabled = 1,
|
|
|
|
kSpritePositionUnk2 = 2,
|
2016-08-23 09:41:00 +02:00
|
|
|
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,
|
2020-01-04 22:04:43 +08:00
|
|
|
kPalettePosition = 15
|
2016-08-23 09:41:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class Sprite {
|
|
|
|
public:
|
2021-10-06 23:52:49 +08:00
|
|
|
Sprite(Frame *frame = nullptr);
|
|
|
|
Sprite(const Sprite &sprite);
|
2021-10-19 08:17:18 +02:00
|
|
|
Sprite& operator=(const Sprite &sprite);
|
2016-08-23 09:41:00 +02:00
|
|
|
~Sprite();
|
2016-10-28 22:48:28 +02:00
|
|
|
|
2020-07-24 10:48:00 -04:00
|
|
|
Frame *getFrame() const { return _frame; }
|
|
|
|
Score *getScore() const { return _score; }
|
|
|
|
|
2021-08-18 20:19:01 +08:00
|
|
|
void updateEditable();
|
2020-07-04 10:57:00 -04:00
|
|
|
|
2020-07-27 16:42:42 -04:00
|
|
|
bool respondsToMouse();
|
|
|
|
bool isActive();
|
2020-07-04 10:57:00 -04:00
|
|
|
bool shouldHilite();
|
2021-07-17 13:59:23 +08:00
|
|
|
bool checkSpriteType();
|
2020-07-04 10:57:00 -04:00
|
|
|
|
2019-12-27 23:09:57 +01:00
|
|
|
uint16 getPattern();
|
|
|
|
void setPattern(uint16 pattern);
|
|
|
|
|
2021-07-08 10:10:07 +08:00
|
|
|
void setCast(CastMemberID memberID);
|
2020-07-06 10:37:51 -04:00
|
|
|
bool isQDShape();
|
2021-08-03 16:14:50 +08:00
|
|
|
Graphics::Surface *getQDMatte();
|
|
|
|
void createQDMatte();
|
2021-10-09 01:03:32 +08:00
|
|
|
MacShape *getShape();
|
|
|
|
uint32 getForeColor();
|
|
|
|
uint32 getBackColor();
|
2020-05-20 00:56:24 +08:00
|
|
|
|
2020-07-24 10:48:00 -04:00
|
|
|
Frame *_frame;
|
|
|
|
Score *_score;
|
|
|
|
Movie *_movie;
|
|
|
|
|
2021-08-03 16:14:50 +08:00
|
|
|
Graphics::FloodFill *_matte; // matte for quickdraw shape
|
|
|
|
|
2021-06-30 18:41:00 -04:00
|
|
|
CastMemberID _scriptId;
|
2021-06-27 13:33:26 +08:00
|
|
|
byte _colorcode; // x40 editable, 0x80 moveable
|
2020-03-24 23:17:25 +01:00
|
|
|
byte _blendAmount;
|
2016-10-28 22:48:28 +02:00
|
|
|
uint32 _unk3;
|
|
|
|
|
2016-08-23 09:41:00 +02:00
|
|
|
bool _enabled;
|
2020-05-05 21:46:15 +08:00
|
|
|
SpriteType _spriteType;
|
2020-03-24 23:33:05 +01:00
|
|
|
byte _inkData;
|
2016-08-23 09:41:00 +02:00
|
|
|
InkType _ink;
|
|
|
|
uint16 _trails;
|
2017-03-12 00:18:03 +11:00
|
|
|
|
2021-06-30 18:41:00 -04:00
|
|
|
CastMemberID _castId;
|
2020-07-06 10:37:51 -04:00
|
|
|
uint16 _pattern;
|
2020-06-30 13:11:29 -04:00
|
|
|
CastMember *_cast;
|
2017-03-12 00:18:03 +11:00
|
|
|
|
2020-03-24 23:33:05 +01:00
|
|
|
byte _thickness;
|
2016-08-23 09:41:00 +02:00
|
|
|
Common::Point _startPoint;
|
2020-06-01 18:51:59 +02:00
|
|
|
int16 _width;
|
|
|
|
int16 _height;
|
2020-04-11 17:08:04 +02:00
|
|
|
bool _moveable;
|
|
|
|
bool _editable;
|
2020-04-14 23:40:01 +02:00
|
|
|
bool _puppet;
|
2020-06-03 13:56:29 -04:00
|
|
|
bool _immediate;
|
2020-08-16 22:55:06 +02:00
|
|
|
uint32 _backColor;
|
|
|
|
uint32 _foreColor;
|
2019-12-27 22:43:42 +01:00
|
|
|
|
2016-08-23 09:41:00 +02:00
|
|
|
byte _volume;
|
|
|
|
byte _stretch;
|
|
|
|
};
|
|
|
|
|
2016-11-04 23:50:01 +01:00
|
|
|
} // End of namespace Director
|
2016-08-23 09:41:00 +02:00
|
|
|
|
|
|
|
#endif
|