Implement new sprite_object_position function (#559)

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
This commit is contained in:
Geralt
2026-06-16 20:33:31 +03:00
committed by GitHub
co-authored by MathisMartin31
parent bf08d4eb78
commit 751a547059
4 changed files with 24 additions and 14 deletions
+1 -4
View File
@@ -106,11 +106,8 @@ void game_main_menu_on_init(void)
main_menu_ace = card_object_new(card_new(SPADES, ACE));
card_object_set_sprite(main_menu_ace, 0);
main_menu_ace->sprite_object->sprite->obj->attr0 |= ATTR0_AFF_DBL;
main_menu_ace->sprite_object->tx = int2fx(MAIN_MENU_ACE_T_X);
main_menu_ace->sprite_object->x = main_menu_ace->sprite_object->tx;
main_menu_ace->sprite_object->ty = int2fx(MAIN_MENU_ACE_T_Y);
main_menu_ace->sprite_object->y = main_menu_ace->sprite_object->ty;
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.
+5 -6
View File
@@ -583,12 +583,11 @@ void game_run_setup_on_init(void)
// both cards do not exist at the same time, one is destroyed before the other is created.
card_object_set_sprite_face_down(run_setup_deck, g_game_vars.deck, 0);
run_setup_deck->sprite_object->tx = int2fx(RUN_SETUP_DECK_SPRITE_T_X);
run_setup_deck->sprite_object->ty = int2fx(RUN_SETUP_DECK_SPRITE_T_Y);
// Need to do -1 here so that the sprite isn't at the target position and gets updated
run_setup_deck->sprite_object->x = run_setup_deck->sprite_object->tx - 1;
run_setup_deck->sprite_object->y = run_setup_deck->sprite_object->ty - 1;
sprite_object_position(
run_setup_deck->sprite_object,
RUN_SETUP_DECK_SPRITE_T_X,
RUN_SETUP_DECK_SPRITE_T_Y
);
card_object_update(run_setup_deck);