Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate sprite anim subsystems #1016

Open
6 of 8 tasks
mid-kid opened this issue Oct 17, 2022 · 0 comments
Open
6 of 8 tasks

Consolidate sprite anim subsystems #1016

mid-kid opened this issue Oct 17, 2022 · 0 comments

Comments

@mid-kid
Copy link
Member

mid-kid commented Oct 17, 2022

The two subsystems are structured as follows:

Overworld:

  • data/sprite_anims/sequences.asm:SpriteAnimSeqData contains each SPRITE_ANIM_INDEX_* entry, and references:
    • data/sprite_anims/framesets.asm:SpriteAnimFrameData containing each SPRITE_ANIM_FRAMESET_* entry
    • engine/gfx/sprite_anims.asm:DoAnimFrame containing each SPRITE_ANIM_SEQ_* entry
    • The SPRITE_ANIM_DICT_* dictionary entries for the base sprite offset
  • engine/gfx/sprites.asm:DoNextFrameForAllSprites contains the update loop for the objects.

Battle:

  • data/battle_anims/objects.asm:BattleAnimObjects contains each ANIM_OBJ_* entry, and references:
    • data/battle_anims/framesets.asm:BattleAnimFrameData containing each BATTLEANIMFRAMESET_* entry
    • engine/battle_anims/functions.asm:DoBattleAnimFrame containing each BATTLEANIMFUNC_* entry
    • The ANIM_GFX_* dictionary entries for the base sprite offset
  • engine/battle_anims/anim_commands.asm:BattleAnim_UpdateOAM_All contains the update loop for the objects.

This is quite the disarray for two subsystems that are so strikingly similar. I'd propose a few changes:

  • Make the formatting of the constants match, BATTLE_ANIM_X or SPRITEANIMX
  • Consolidate "sequence" vs "function" naming.
  • data/sprite_anims/sequences.asm:SpriteAnimSeqData should be data/sprite_anims/objects.asm:SpriteAnimObjects
  • Similarly, ANIM_OBJ_* vs SPRITE_ANIM_INDEX_*. Make the two resemble eachother.
  • engine/gfx/sprite_anims.asm:DoAnimFrame -> engine/gfx/sprite_anims.asm:DoSpriteAnimFrame maybe
  • Reflect the layout of engine/gfx/sprites.asm (look for INCLUDE) in engine/battle_anims/*.asm, for example like this. I wouldn't be surprised if both subsystems were originally held in a single file.
  • Similarly, move engine/gfx/sprites.asm and engine/gfx/sprite_anims.asm into engine/sprite_anims/core.asm and engine/sprite_anims/functions.asm, respectively.
  • probably more I can't think of right now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants