178 void load(
bool blankNPC =
false,
209 QVector<SpriteData*> spriteData);
264 void reset(
bool blankNPC =
false);
265 static QVector<SpriteData*>
randomizeAll(QVector<MapDBEntrySprite*> mapSprites);
266 void randomize(QVector<TmpSpritePos*>* tmpPos);
269 static QVector<SpriteData*>
setToAll(QVector<MapDBEntrySprite*> spriteSigns);
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
void movementStatusChanged()
void loadSpriteData1(SaveFile *saveFile, var8 index)
Expand the first sprite-data table for index.
int grassPriority
(0x80 in grass, 0x00 otherwise) - Prioritizing grass drawn around sprite
void movementDelayChanged()
void setMissableIndex(int val)
int movementByte
(0xFF not moving, 0xFE random movements, others move without collision)
void load(bool blankNPC=false, SaveFile *saveFile=nullptr, var8 index=0)
std::optional< int > missableIndex
Sprite data that applies to all non-player missable sprites (All sprites that aren't sprite #0 and ha...
void yStepVectorChanged()
int getTrainerClassOrItemID()
std::optional< int > textID
Text id when this sprite is interacted with.
void setTrainerSetID(int val)
void setXStepVector(int val)
void saveSpriteData2(SaveFile *saveFile, var8 index)
Flatten the second sprite-data table.
void saveSpriteData1(SaveFile *saveFile, var8 index)
Flatten the first sprite-data table.
void randomize(QVector< TmpSpritePos * > *tmpPos)
Randomize this sprite (avoiding tmpPos clashes).
void resetMissableIndex()
Clear the optional missableIndex.
SpriteData(bool blankNPC=false, SaveFile *saveFile=nullptr, var8 index=0)
Create a blank sprite or load one from a map.
void setTrainerClassOrItemID(int val)
int movementDelay
Delay until next movement, counts downward and flags movementStatus ready once reached.
void setRangeDirByte(int val)
void movementByteChanged()
std::optional< int > trainerSetID
Trainer data id.
void imageBaseOffsetChanged()
void trainerClassOrItemIDChanged()
void xStepVectorChanged()
void animFrameCounterChanged()
void save(SaveFile *saveFile, var8 index)
void loadSpriteData2(SaveFile *saveFile, var8 index)
Expand the second sprite-data table for index.
int imageBaseOffset
Used to help compute imageIndex based on vram.
int yDisp
Important to set to 0x8 Keep sprites from wandering too far however it's noted that it's bugged to be...
int yPixels
Screen position in pixels aligned to 4 pixels offset from the grid (To appear centered).
void loadSpriteDataNPC(SaveFile *saveFile, var8 index)
Expand the NPC-only sprite data for index.
void reset(bool blankNPC=false)
Blank this sprite (optionally as a blank NPC).
void setYStepVector(int val)
void resetTextID()
Clear the optional textID.
std::optional< int > rangeDirByte
How far a walking sprite can wander, or if still the facing direction A walking sprite having a value...
int mapY
These are very important to set, just usual coordinates for map placement +4 Coordinate 0,...
void walkAnimationCounterChanged()
static QVector< SpriteData * > setToAll(QVector< MapDBEntrySprite * > spriteSigns)
Build sprites from a map's sprite list.
var8 yStepVector
These actually don't really matter and can be zero I'm not sure if the game even uses these values in...
static void saveMissables(SaveFile *saveFile, QVector< SpriteData * > spriteData)
void setTo(MapDBEntrySprite *spriteData)
Copy values from a map-defined sprite.
static QVector< SpriteData * > randomizeAll(QVector< MapDBEntrySprite * > mapSprites)
Randomize a whole map's sprites.
void saveSpriteDataNPC(SaveFile *saveFile, var8 index)
Flatten the NPC-only sprite data.
void resetTrainerClassOrItemID()
Clear the optional trainerClassOrItemID.
protected::void pictureIDChanged()
int movementStatus
(0: uninitialized, 1: ready, 2: delayed, 3: moving) Advised to use ready
void missableIndexChanged()
std::optional< int > trainerClassOrItemID
If this is an item sprite, the item id, otherwise the trainer class.
void resetTrainerSetID()
Clear the optional trainerSetID.
int animFrameCounter
Animation frame counter.
int walkAnimationCounter
Tracks movement & wandering, sprites are given 0x10 and it's decremented.
int faceDir
(0: down, 4: up, 8: left, $c: right)
SpriteDBEntry * toSprite()
Resolve this sprite to its DB entry.
int intraAnimationFrameCounter
Counter that helps delay between animation frames so things aren't so instant and fast.
void grassPriorityChanged()
int pictureID
Sprite data that applies to all sprites.
void intraAnimationFrameCounterChanged()
void resetRangeDirByte()
Clear the optional rangeDirByte.
void rangeDirByteChanged()
int imageIndex
Basically, in the sprite sheet strip, which "pane" or "tile" is it at 0xFF if not on the screen.
void trainerSetIDChanged()
void checkMissable(SaveFile *saveFile, var8 index)
Resolve whether this sprite is a missable.
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 savefile library, plus the central list of QObject types kept deliberatel...
#define SAVEFILE_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
A map's sprite definition – base class for the four sprite kinds.
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.
Sprite facing-direction values, QML-visible.
static var8 random()
A random valid facing.
Sprite in-grass byte values, QML-visible.
static var8 random()
A random grass value.
Sprite mobility byte values, QML-visible.
static var8 random()
A random mobility value.
Sprite movement-status byte values, QML-visible.
@ Ready
Ready (advised value).
Sprite movement-pattern byte values, QML-visible.
static var8 random()
A random movement pattern.