22 #ifndef MM_SHARED_XEEN_SPRITES_H 23 #define MM_SHARED_XEEN_SPRITES_H 25 #include "common/scummsys.h" 26 #include "common/array.h" 27 #include "common/file.h" 28 #include "graphics/surface.h" 29 #include "mm/shared/xeen/file.h" 30 #include "mm/shared/xeen/xsurface.h" 42 SCALE_MASK = 0x7FFF, SCALE_ENLARGE = 0x8000
46 SPRFLAG_MODE_MASK = 0xF00, SPRFLAG_DRAWER1 = 0x100, SPRFLAG_DRAWER2 = 0x200,
47 SPRFLAG_DRAWER3 = 0x300, SPRFLAG_DRAWER4 = 0x400, SPRFLAG_DRAWER5 = 0x500, SPRFLAG_DRAWER6 = 0x600,
48 SPRFLAG_DRAWER7 = 0x700, SPRFLAG_800 = 0x800, SPRFLAG_SCENE_CLIPPED = 0x2000,
49 SPRFLAG_BOTTOM_CLIPPED = 0x4000, SPRFLAG_HORIZ_FLIPPED = 0x8000, SPRFLAG_RESIZE = 0x10000
55 uint16 _offset1, _offset2;
61 static int _clippedBottom;
110 uint flags = 0,
int scale = 0)
const;
117 void draw(
XSurface &dest,
int frame)
const;
133 return _index.
size();
140 return _index.
size() == 0;
157 byte *_data =
nullptr;
158 size_t _filesize = 0;
160 byte *_destTop =
nullptr, *_destBottom =
nullptr;
161 byte *_destLeft =
nullptr, *_destRight =
nullptr;
167 static uint getScaledVal(
int xy, uint16 &scaleMask);
172 void rcr(uint16 &val,
bool &cf);
177 virtual void drawPixel(byte *dest, byte pixel);
182 SpriteDrawer(byte *data,
size_t filesize) : _data(data), _filesize(filesize) {
200 byte _offset = 0, _mask = 0;
205 void drawPixel(byte *dest, byte pixel)
override;
219 uint16 _mask1 = 0, _mask2 = 0;
220 uint16 _random1 = 0, _random2 = 0;
225 void drawPixel(byte *dest, byte pixel)
override;
238 uint16 _offset = 0, _mask = 0;
239 byte _palette[256 * 3];
240 bool _hasPalette =
false;
245 void drawPixel(byte *dest, byte pixel)
override;
260 void drawPixel(byte *dest, byte pixel)
override;
273 uint16 _threshold = 0, _random1 = 0, _random2 = 0;
278 void drawPixel(byte *dest, byte pixel)
override;
293 void drawPixel(byte *dest, byte pixel)
override;
Definition: managed_surface.h:51
bool empty() const
Definition: sprites.h:139
Definition: sprites.h:198
Definition: xsurface.h:45
Definition: sprites.h:286
static void setClippedBottom(int y)
Definition: sprites.h:147
Out copy(In first, In last, Out dst)
Definition: algorithm.h:52
size_t size() const
Definition: sprites.h:132
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: sprites.h:271
Definition: detection.h:27
size_type size() const
Definition: array.h:318
Definition: sprites.h:253
SpriteDrawer(byte *data, size_t filesize)
Definition: sprites.h:182
virtual ~SpriteDrawer()
Definition: sprites.h:188
Definition: sprites.h:217
Definition: sprites.h:236
Definition: sprites.h:155