-
Notifications
You must be signed in to change notification settings - Fork 4
/
tibiasprite.h
44 lines (33 loc) · 1017 Bytes
/
tibiasprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef TIBIASPRITE_H
#define TIBIASPRITE_H
#include <QImage>
#include <QHash>
#include "tibiaobject.h"
#define SPRITE_FORMAT QImage::Format_ARGB32
#define SPRITE_BACKGROUND 0x00FF00FF
#define SPRITE_BG_R 0xFF
#define SPRITE_BG_G 0x00
#define SPRITE_BG_B 0xFF
class TibiaSprite : public TibiaObject
{
public:
TibiaSprite( quint16 _id = 0, quint8 _width = 1, quint8 _height = 1 );
virtual ~TibiaSprite( void );
bool isDummy() const {
return dummy;
};
void setDummy( bool dummy );
virtual void reset( void );
void setImage( const QImage& );
static void formatImage( QImage& image );
quint16 id;
quint8 width, height, r, g, b;
QImage image;
bool dummy;
};
QDataStream& operator<< ( QDataStream& stream, const TibiaSprite& tibiaSprite );
QDataStream& operator>> ( QDataStream& stream, TibiaSprite& tibiaSprite );
static TibiaSprite dummy;
//typedef QCache<quint16, TibiaSprite> SpriteCache;
typedef QHash<quint32, TibiaSprite> SpriteHash;
#endif