porymap/include/core/tileset.h

47 lines
1.3 KiB
C
Raw Normal View History

#ifndef TILESET_H
#define TILESET_H
2018-09-25 01:12:29 +01:00
#include "metatile.h"
#include "tile.h"
#include <QImage>
class Tileset
{
public:
Tileset();
public:
QString name;
QString is_compressed;
QString is_secondary;
QString padding;
QString tiles_label;
QString palettes_label;
QString metatiles_label;
QString metatiles_path;
QString callback_label;
QString metatile_attrs_label;
QString metatile_attrs_path;
2018-10-03 01:01:24 +01:00
QString tilesImagePath;
QImage tilesImage;
2018-10-03 01:01:41 +01:00
QList<QString> palettePaths;
QList<QImage> *tiles = nullptr;
QList<Metatile*> *metatiles = nullptr;
QList<QList<QRgb>> *palettes = nullptr;
2020-05-03 16:31:44 +01:00
QList<QList<QRgb>> *palettePreviews = nullptr;
2018-10-03 01:01:15 +01:00
Tileset* copy();
static Tileset* getBlockTileset(int, Tileset*, Tileset*);
static Metatile* getMetatile(int, Tileset*, Tileset*);
2020-05-03 16:31:44 +01:00
static QList<QList<QRgb>> getBlockPalettes(Tileset*, Tileset*, bool useTruePalettes = false);
static QList<QRgb> getPalette(int, Tileset*, Tileset*, bool useTruePalettes = false);
static bool metatileIsValid(uint16_t metatileId, Tileset *, Tileset *);
2019-03-21 23:50:50 +00:00
bool appendToHeaders(QString headerFile, QString friendlyName);
bool appendToGraphics(QString graphicsFile, QString friendlyName, bool primary);
bool appendToMetatiles(QString metatileFile, QString friendlyName, bool primary);
};
#endif // TILESET_H