1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-06 23:03:22 +02:00
GPXSee/src/ozf.h

44 lines
740 B
C
Raw Normal View History

2017-04-14 22:39:33 +02:00
#ifndef OZF_H
#define OZF_H
#include <QString>
#include <QSize>
#include <QColor>
#include <QVector>
#include <QFile>
#include <QPixmap>
class OZF
{
public:
2017-05-03 21:34:13 +02:00
OZF() : _decrypt(false), _key(0) {}
2017-04-14 22:39:33 +02:00
bool load(const QString &path);
QString fileName() const {return _file.fileName();}
bool isOpen() const {return _file.isOpen();}
QSize size() const {return _size;}
QSize tileSize() const {return QSize(64, 64);}
QPixmap tile(int x, int y);
private:
template<class T> bool readValue(T &val);
2017-05-03 21:34:13 +02:00
bool read(void *data, size_t size);
bool readKey();
2017-04-14 22:39:33 +02:00
bool readHeaders();
bool readTileTable();
2017-05-03 21:34:13 +02:00
bool _decrypt;
quint8 _key;
2017-04-14 22:39:33 +02:00
QSize _size;
QSize _dim;
QVector<QRgb> _palette;
QVector<quint32> _tiles;
QFile _file;
};
#endif // OZF_H