pmd-red/include/sprite.h
2023-08-26 10:29:55 -04:00

98 lines
2.9 KiB
C

#ifndef GUARD_SPRITE_H
#define GUARD_SPRITE_H
#include "axdata.h"
#include "ground_sprite.h"
#include "position.h"
#include "sprite_oam.h"
// size: 0x8
struct UnkSpriteLink
{
struct UnkSpriteLink *unk0;
struct SpriteOAM *unk4;
};
// size: 0x808
struct SpriteList
{
struct UnkSpriteLink sprites[256];
u32 unk800;
u32 unk804;
};
// size: 0xC
struct unkStruct_20266B0
{
/* 0x0 */ s32 byteCount;
/* 0x4 */ void *src;
/* 0x8 */ void *dest;
};
// size: ? 0x3C for now
struct Entity_Sub28
{
u16 unk0;
// 0x2 and 0x6 seem to be related to the sprite animation, though not sure how they're related.
/* 0x2 */ u16 spriteAnimationCounter;
// Each animation has a few different sprites that it transitions between.
// This is the index of the currently displayed sprite within the animation.
// Differs from 0xC as this index is only between the sprites used by the animation,
// while 0xC is a shared index among all sprites.
/* 0x4 */ u16 spriteAnimationIndex;
/* 0x6 */ u16 spriteAnimationCounter2;
// The position of the sprite within the tile. The animation may change the position slightly.
/* 0x8 */ struct Position spritePos;
// Offset of the sprite from its position at the start of the animation. Changes alongside spritePos.
/* 0xC */ struct Position spritePosOffset;
u8 fill10[0x14 - 0x10];
u32 unk14;
u32 unk18;
u16 unk1C;
u8 fill1E[0x20 - 0x1E];
// The sprite index to display, among the Pokémon's possible sprites.
/* 0x20 */ u16 spriteIndexForEntity;
/* 0x22 */ u16 spriteIndexForEntity2;
u8 unk24[0x28 - 0x24];
// Some kind of base sprite index depending on which way the Pokémon is facing.
// and which animation is playing (e.g., idle, moving).
// Compared to 0x20, 0x28 and 0x2C are much larger and could be global indexes among all sprites in the game.
/* 0x28 */ u32 spriteBaseForDirection;
/* 0x2C */ u32 spriteGlobalIndex;
u32 unk30;
u32 unk34;
u32 unk38;
};
// size: ?
struct Dungeon_Sub17B44_Sub4
{
u32 unk0;
u32 **unk4;
u8 fill8[0xC - 0x8];
u32 unkC;
u32 unk10;
};
// size: ?
struct Dungeon_Sub17B44
{
u8 fill0[0x4 - 0x0];
struct Dungeon_Sub17B44_Sub4 *unk4;
};
void AddSprite(struct SpriteOAM *, s32, struct UnkSpriteMem *, struct unkStruct_2039DB0 *);
void BlinkSavingIcon(void);
void CopySpritesToOam(void);
void InitSprites(void);
void ResetSprites(bool8);
void SetSavingIconCoords(struct Position *);
void sub_8004E8C(struct unkStruct_2039DB0 *);
void sub_8005180(void);
void sub_8005304(void);
void sub_80053AC(struct Entity_Sub28 *, struct Dungeon_Sub17B44 *, u32, u32, u32, u32, bool8);
void sub_80053D0(struct Entity_Sub28 *, struct Dungeon_Sub17B44_Sub4 *, u32, u32, u32, u32, bool8);
void sub_800543C(struct Entity_Sub28 *, struct Dungeon_Sub17B44 *, u32, u32, u32, bool8);
void sub_80054BC(struct axPokemon *);
#endif // GUARD_SPRITE_H