2020-09-13 23:37:55 +01:00
|
|
|
#pragma once
|
2018-09-23 00:47:28 +01:00
|
|
|
#ifndef TILESET_H
|
|
|
|
#define TILESET_H
|
|
|
|
|
2018-09-25 01:12:29 +01:00
|
|
|
#include "metatile.h"
|
|
|
|
#include "tile.h"
|
2018-09-23 00:47:28 +01:00
|
|
|
#include <QImage>
|
|
|
|
|
|
|
|
class Tileset
|
|
|
|
{
|
|
|
|
public:
|
2021-02-17 02:45:54 +00:00
|
|
|
Tileset() = default;
|
2021-03-08 00:17:17 +00:00
|
|
|
Tileset(const Tileset &other);
|
|
|
|
Tileset &operator=(const Tileset &other);
|
2021-02-17 02:45:54 +00:00
|
|
|
|
2018-09-23 00:47:28 +01:00
|
|
|
public:
|
|
|
|
QString name;
|
|
|
|
QString is_secondary;
|
|
|
|
QString tiles_label;
|
|
|
|
QString palettes_label;
|
|
|
|
QString metatiles_label;
|
2018-10-03 01:01:09 +01:00
|
|
|
QString metatiles_path;
|
2018-09-23 00:47:28 +01:00
|
|
|
QString metatile_attrs_label;
|
2018-10-03 01:01:09 +01:00
|
|
|
QString metatile_attrs_path;
|
2018-10-03 01:01:24 +01:00
|
|
|
QString tilesImagePath;
|
|
|
|
QImage tilesImage;
|
2021-02-17 02:45:54 +00:00
|
|
|
QStringList palettePaths;
|
2018-09-23 00:47:28 +01:00
|
|
|
|
2021-02-17 02:45:54 +00:00
|
|
|
QList<QImage> tiles;
|
|
|
|
QList<Metatile*> metatiles;
|
|
|
|
QList<QList<QRgb>> palettes;
|
|
|
|
QList<QList<QRgb>> palettePreviews;
|
2018-10-03 01:01:15 +01:00
|
|
|
|
2022-01-04 02:35:15 +00:00
|
|
|
static Tileset* getMetatileTileset(int, Tileset*, Tileset*);
|
|
|
|
static Tileset* getTileTileset(int, Tileset*, Tileset*);
|
2018-09-23 00:47:28 +01:00
|
|
|
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);
|
2020-04-09 20:12:52 +01:00
|
|
|
static bool metatileIsValid(uint16_t metatileId, Tileset *, Tileset *);
|
2022-10-08 18:51:48 +01:00
|
|
|
static QHash<int, QString> getHeaderMemberMap(bool usingAsm);
|
2022-10-07 19:29:51 +01:00
|
|
|
static QString getExpectedDir(QString tilesetName, bool isSecondary);
|
|
|
|
QString getExpectedDir();
|
2022-09-28 01:17:55 +01:00
|
|
|
bool appendToHeaders(QString root, QString friendlyName, bool usingAsm);
|
2022-10-07 19:29:51 +01:00
|
|
|
bool appendToGraphics(QString root, QString friendlyName, bool usingAsm);
|
|
|
|
bool appendToMetatiles(QString root, QString friendlyName, bool usingAsm);
|
2018-09-23 00:47:28 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TILESET_H
|