2021-04-10 15:27:40 +02:00
|
|
|
#ifndef IMG_IMGDATA_H
|
|
|
|
#define IMG_IMGDATA_H
|
2019-05-10 18:56:19 +02:00
|
|
|
|
2020-02-09 23:24:48 +01:00
|
|
|
#include "mapdata.h"
|
2019-05-10 18:56:19 +02:00
|
|
|
|
2021-01-27 21:18:06 +01:00
|
|
|
class QFile;
|
|
|
|
|
2021-04-10 15:27:40 +02:00
|
|
|
namespace IMG {
|
|
|
|
|
|
|
|
class IMGData : public MapData
|
2019-05-10 18:56:19 +02:00
|
|
|
{
|
|
|
|
public:
|
2021-04-10 15:27:40 +02:00
|
|
|
IMGData(const QString &fileName);
|
2019-07-04 18:18:03 +02:00
|
|
|
|
2021-01-27 21:18:06 +01:00
|
|
|
const QString &fileName() const {return _fileName;}
|
2019-05-16 20:23:37 +02:00
|
|
|
|
2020-06-27 22:46:26 +02:00
|
|
|
unsigned blockBits() const {return _blockBits;}
|
2021-02-08 19:54:14 +01:00
|
|
|
bool readBlock(QFile &file, int blockNum, char *data) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
qint64 read(QFile &file, char *data, qint64 maxSize) const;
|
|
|
|
template<class T> bool readValue(QFile &file, T &val) const;
|
2019-05-10 18:56:19 +02:00
|
|
|
|
2021-01-27 21:18:06 +01:00
|
|
|
QString _fileName;
|
2019-05-10 18:56:19 +02:00
|
|
|
quint8 _key;
|
2020-06-27 22:46:26 +02:00
|
|
|
unsigned _blockBits;
|
2019-05-10 18:56:19 +02:00
|
|
|
};
|
|
|
|
|
2021-04-10 15:27:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // IMG_IMGDATA_H
|