mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-14 12:57:06 -05:00
Allow custom metatile attribute layouts
This commit is contained in:
@@ -36,6 +36,7 @@ protected:
|
||||
virtual void setUnreadKeys() = 0;
|
||||
bool getConfigBool(QString key, QString value);
|
||||
int getConfigInteger(QString key, QString value, int min, int max, int defaultValue);
|
||||
long getConfigLong(QString key, QString value, long min, long max, long defaultValue);
|
||||
};
|
||||
|
||||
class PorymapConfig: public KeyValueConfigBase
|
||||
@@ -264,6 +265,11 @@ public:
|
||||
bool getTilesetsHaveCallback();
|
||||
void setTilesetsHaveIsCompressed(bool has);
|
||||
bool getTilesetsHaveIsCompressed();
|
||||
int getMetatileAttributesSize();
|
||||
uint32_t getMetatileBehaviorMask();
|
||||
uint32_t getMetatileTerrainTypeMask();
|
||||
uint32_t getMetatileEncounterTypeMask();
|
||||
uint32_t getMetatileLayerTypeMask();
|
||||
protected:
|
||||
virtual QString getConfigFilepath() override;
|
||||
virtual void parseConfigKeyValue(QString key, QString value) override;
|
||||
@@ -295,6 +301,11 @@ private:
|
||||
bool prefabImportPrompted;
|
||||
bool tilesetsHaveCallback;
|
||||
bool tilesetsHaveIsCompressed;
|
||||
int metatileAttributesSize;
|
||||
uint32_t metatileBehaviorMask;
|
||||
uint32_t metatileTerrainTypeMask;
|
||||
uint32_t metatileEncounterTypeMask;
|
||||
uint32_t metatileLayerTypeMask;
|
||||
};
|
||||
|
||||
extern ProjectConfig projectConfig;
|
||||
|
||||
@@ -40,19 +40,34 @@ public:
|
||||
|
||||
public:
|
||||
QList<Tile> tiles;
|
||||
uint16_t behavior; // 8 bits RSE, 9 bits FRLG
|
||||
uint8_t layerType;
|
||||
uint8_t encounterType; // FRLG only
|
||||
uint8_t terrainType; // FRLG only
|
||||
uint32_t behavior;
|
||||
uint32_t layerType;
|
||||
uint32_t encounterType;
|
||||
uint32_t terrainType;
|
||||
uint32_t unusedAttributes;
|
||||
QString label;
|
||||
|
||||
uint32_t getAttributes();
|
||||
void setAttributes(uint32_t data);
|
||||
void setAttributes(uint32_t data, BaseGameVersion version);
|
||||
uint32_t getAttributes(BaseGameVersion version);
|
||||
|
||||
static int getIndexInTileset(int);
|
||||
static QPoint coordFromPixmapCoord(const QPointF &pixelCoord);
|
||||
static int getAttributesSize(BaseGameVersion version);
|
||||
static void calculateAttributeLayout();
|
||||
|
||||
private:
|
||||
static uint32_t behaviorMask;
|
||||
static uint32_t terrainTypeMask;
|
||||
static uint32_t encounterTypeMask;
|
||||
static uint32_t layerTypeMask;
|
||||
static uint32_t unusedAttrMask;
|
||||
static int behaviorShift;
|
||||
static int terrainTypeShift;
|
||||
static int encounterTypeShift;
|
||||
static int layerTypeShift;
|
||||
|
||||
static int getShiftValue(uint32_t mask);
|
||||
};
|
||||
|
||||
inline bool operator==(const Metatile &a, const Metatile &b) {
|
||||
|
||||
Reference in New Issue
Block a user