-
Notifications
You must be signed in to change notification settings - Fork 1
/
abstracttile.h
47 lines (34 loc) · 912 Bytes
/
abstracttile.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
#ifndef ABSTRACTTILE_H
#define ABSTRACTTILE_H
#include <QByteArray>
#include <QString>
#include <string.h>
#include "rom.h"
struct AbstractTile {
int i;
int size;
unsigned ptraddr;
unsigned dataaddr;
bool compressed;
uint8_t data[128+128/8]; // this is the maximum amount a block can use in theory
unsigned romsize;
QByteArray pixels;
virtual ~AbstractTile() {}
QString toString() const // TODO: remove qt dependency
{
return QStringLiteral("#%1 -> $%2 -> $%3 %4B ").arg(i, 4, 10).arg(ptraddr, 0, 16).arg(dataaddr, 0, 16).arg(romsize, 3, 10) + (compressed ? "compressed" : "uncompressed");
}
const QByteArray& getPixels() const
{
return pixels;
}
virtual bool setPixels(const QByteArray&)
{
return false;
}
virtual bool save(Rom*) const
{
return false;
}
};
#endif // ABSTRACTTILE_H