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:
@@ -108,7 +108,6 @@ void game_main_menu_on_init(void)
|
||||
main_menu_ace->sprite_object->sprite->obj->attr0 |= ATTR0_AFF_DBL;
|
||||
main_menu_ace->sprite_object->tscale = float2fx(0.8f);
|
||||
sprite_object_position(main_menu_ace->sprite_object, MAIN_MENU_ACE_T_X, MAIN_MENU_ACE_T_Y);
|
||||
card_object_update(main_menu_ace);
|
||||
|
||||
// Select last highlighted button, Play button by default.
|
||||
// e.g. if we return from the options menu, we want the Options button to be highlighted.
|
||||
@@ -122,7 +121,6 @@ void game_main_menu_on_init(void)
|
||||
void game_main_menu_on_update(void)
|
||||
{
|
||||
main_menu_ace->sprite_object->trotation = lu_sin((g_game_vars.timer << 8) / 2) / 3;
|
||||
card_object_update(main_menu_ace);
|
||||
|
||||
selection_grid_process_input(&main_menu_selection_grid);
|
||||
}
|
||||
|
||||
@@ -589,8 +589,6 @@ void game_run_setup_on_init(void)
|
||||
RUN_SETUP_DECK_SPRITE_T_Y
|
||||
);
|
||||
|
||||
card_object_update(run_setup_deck);
|
||||
|
||||
/* Uncomment these lines when we figure out how to properly restore a game save
|
||||
is_saved_game_valid = is_game_data_valid();
|
||||
if (is_saved_game_valid)
|
||||
|
||||
@@ -990,21 +990,6 @@ void game_shop_on_update(void)
|
||||
{
|
||||
timer++;
|
||||
|
||||
List* shop_jokers_list = &s_shop_jokers_list;
|
||||
|
||||
if (!list_is_empty(shop_jokers_list))
|
||||
{
|
||||
ListItr itr = list_itr_create(shop_jokers_list);
|
||||
JokerObject* joker_object;
|
||||
while ((joker_object = list_itr_next(&itr)))
|
||||
{
|
||||
if (joker_object != NULL)
|
||||
{
|
||||
joker_object_update(joker_object);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (timer % 20 == 0)
|
||||
{
|
||||
game_shop_lights_anim_frame();
|
||||
|
||||
Reference in New Issue
Block a user