Stop repeated parsing of src/data/object_events

This commit is contained in:
GriffinR
2022-01-24 17:17:31 -05:00
committed by huderlem
parent 366fb5c8a8
commit ddc0f01460
9 changed files with 95 additions and 90 deletions

View File

@@ -83,7 +83,7 @@ public:
OrderedJson::object buildSignEventJSON();
OrderedJson::object buildHiddenItemEventJSON();
OrderedJson::object buildSecretBaseEventJSON();
void setPixmapFromSpritesheet(QImage, int, int, int, bool);
void setPixmapFromSpritesheet(QImage, int, int, bool);
int getPixelX();
int getPixelY();
QMap<QString, bool> getExpectedFields();
@@ -99,7 +99,6 @@ public:
int frame = 0;
bool hFlip = false;
bool usingSprite;
bool inanimate;
DraggablePixmapItem *pixmapItem = nullptr;
void setPixmapItem(DraggablePixmapItem *item) { pixmapItem = item; }

View File

@@ -18,6 +18,14 @@
#include <QVariant>
#include <QFileSystemWatcher>
struct EventGraphics
{
QImage spritesheet;
int spriteWidth;
int spriteHeight;
bool inanimate;
};
static QString NONE_MAP_CONSTANT = "MAP_NONE";
static QString NONE_MAP_NAME = "None";
@@ -51,6 +59,7 @@ public:
QMap<QString, QString> mapSecToMapHoverName;
QMap<QString, int> mapSectionNameToValue;
QMap<int, QString> mapSectionValueToName;
QMap<QString, EventGraphics*> eventGraphicsMap;
QStringList gfxNames;
QStringList songNames;
QStringList itemNames;
@@ -176,8 +185,10 @@ public:
bool readEventScriptLabels();
bool readObjEventGfxConstants();
bool readSongNames();
bool readEventGraphics();
void setEventPixmap(Event * event, bool forceLoad = false);
void loadEventPixmaps(QList<Event*> objects);
QString fixPalettePath(QString path);
QString fixGraphicPath(QString path);