84 static SpriteSetDB*
inst();
86 [[nodiscard]]
const QVector<SpriteSetDBEntry*>
getStore()
const;
87 [[nodiscard]]
const QHash<QString, SpriteSetDBEntry*>
getInd()
const;
97 void qmlProtect(
const QQmlEngine*
const engine)
const;
100 void qmlRegister()
const;
105 QVector<SpriteSetDBEntry*> store;
106 QHash<QString, SpriteSetDBEntry*> ind;
int getStoreSize() const
Set count.
void deepLink()
Resolve sprites, split neighbours, and maps.
void load()
Load sprite-sets from JSON.
static SpriteSetDB * inst()
< Number of sprite-sets.
const QVector< SpriteSetDBEntry * > getStore() const
All sprite-sets.
const QHash< QString, SpriteSetDBEntry * > getInd() const
Name->entry index.
SpriteSetDBEntry * getStoreAt(int idx) const
Set by store index (for QML).
void index()
Build the name->entry index.
SpriteSetDBEntry * getIndAt(const QString &key) const
Set by name key (for QML).
void qmlProtect(const QQmlEngine *const engine) const
Pin to C++ ownership.
Project-wide fixed-width integer aliases (var8, var16, ...).
var8e var8
Everyday 8-bit alias. Exact (not "fastest") to dodge the pointer-width bug noted above.
Import/export macro for the db library, plus the central list of DB entry pointer types declared opaq...
#define DB_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
One map's complete static definition – the root of the MapDBEntry family.
One sprite definition: its name/picture-id and the maps that use it.
One sprite-set: the pre-loaded sprite group for an outdoor area.
SpriteSetDBEntry()
Empty entry.
QVector< SpriteDBEntry * > toSprites
Resolved sprites (deepLink).
SpriteSetDBEntry * toSetES
Resolved East/South set (deepLink).
bool isDynamic() const
True if this set is split by coordinate.
void deepLink()
Resolve sprite list + split neighbours + maps.
QVector< SpriteDBEntry * > getSprites(var8 x, var8 y) const
Sprites active at (x,y).
std::optional< var8 > splitAt
Coordinate the set splits at, if dynamic.
QVector< QString > spriteList
Sprite names in this set.
std::optional< var8 > setES
East/South sub-set index, if split.
std::optional< var8 > setWN
West/North sub-set index, if split.
QVector< MapDBEntry * > toMaps
Maps using this set (back-ref).
SpriteSetDBEntry * toSetWN
Resolved West/North set (deepLink).
QString split
Split descriptor.