-
Notifications
You must be signed in to change notification settings - Fork 1
/
clipboardtile.h
78 lines (71 loc) · 1.72 KB
/
clipboardtile.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef CLIPBOARDTILE_H
#define CLIPBOARDTILE_H
#include <QImage>
#include "snesgfxconverter.h"
#include "spritepalettecreator.h"
enum class TileChangeType {
All,
BottomLeft,
BottomRight,
TopLeft,
TopRight
};
struct ExternalGfxInfo {
qsizetype start;
qsizetype end;
int basetile;
};
struct TileInfo {
TileInfo(quint16 tile);
TileInfo() = default;
bool is_this_tile = true;
bool vflip;
bool hflip;
bool prio;
quint8 pal;
quint16 tilenum;
QImage get8x8Tile(int offset);
QImage get8x8Scaled(int width, int offset);
bool isEmpty();
bool isThisTile();
quint16 TileValue();
};
struct FullTile {
FullTile(quint16 tl, quint16 bl, quint16 tr, quint16 br, TileChangeType type = TileChangeType::All);
FullTile(TileInfo tl, TileInfo bl, TileInfo tr, TileInfo br, TileChangeType type = TileChangeType::All);
FullTile() = default;
int offset = -1;
TileInfo topleft;
TileInfo bottomleft;
TileInfo topright;
TileInfo bottomright;
QImage getFullTile();
QImage getScaled(int width);
void SetPalette(int pal);
void SetOffset(int off);
void FlipX();
void FlipY();
bool isEmpty();
bool isFullTile();
void setTileInfoByType(TileInfo info, TileChangeType type);
TileInfo getTileInfoByType(TileChangeType type);
QImage getPartialTile(TileChangeType type);
};
class ClipboardTile
{
private:
bool valid;
FullTile tile;
int map16tile;
public:
ClipboardTile();
void update(const FullTile& tile);
void update(const ClipboardTile& other);
QImage draw();
FullTile getTile();
int size();
bool isValid();
void setTileNum(int num);
int TileNum();
};
#endif // CLIPBOARDTILE_H