Implement a global SpriteObject update loop (#553)
* Implement `sprite_object_update_all` * clang format * Change update order * tmp * make it crash * Fix bad address crash * Address @MeirGavish's comments * Tweaked card draw position further * Tweaked card draw position further, again --------- Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
This commit is contained in:
@@ -75,7 +75,6 @@ u8 card_get_value(Card* card);
|
||||
// CardObject methods
|
||||
CardObject* card_object_new(Card* card);
|
||||
void card_object_destroy(CardObject** card_object);
|
||||
void card_object_update(CardObject* card_object); // Update the card object position and scale
|
||||
void card_object_set_sprite(CardObject* card_object, int layer);
|
||||
void card_object_set_sprite_face_down(CardObject* card_object, enum DeckType deck, int layer);
|
||||
void card_object_shake(CardObject* card_object, mm_word sound_id);
|
||||
|
||||
@@ -195,7 +195,6 @@ int joker_get_sell_value(const Joker* joker);
|
||||
|
||||
JokerObject* joker_object_new(Joker* joker);
|
||||
void joker_object_destroy(JokerObject** joker_object);
|
||||
void joker_object_update(JokerObject* joker_object);
|
||||
// This doesn't actually score anything, it just performs an animation and plays a sound effect
|
||||
void joker_object_shake(JokerObject* joker_object, mm_word sound_id);
|
||||
// This scores the joker and returns true if it was scored successfully
|
||||
|
||||
@@ -238,6 +238,13 @@ void sprite_object_reset_transform(SpriteObject* sprite_object);
|
||||
*/
|
||||
IWRAM_CODE void sprite_object_update(SpriteObject* sprite_object);
|
||||
|
||||
/**
|
||||
* @brief Update all SpriteObjects, to be called once per frame in the main update loop.
|
||||
*
|
||||
* TODO: try and put this function in IWRAM for performance purposes. Crashed the last time I tried.
|
||||
*/
|
||||
void sprite_object_update_all(void);
|
||||
|
||||
/**
|
||||
* @brief Shake SpriteObject on screen and play a sound
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user