Add FRAMES macros to code (again)

This commit is contained in:
expected-ingot
2025-06-30 01:06:08 +02:00
parent de6060eee3
commit 9e16e8adc7
+7 -7
View File
@@ -696,7 +696,7 @@ static void game_playing_process_card_draw()
static void game_playing_discarded_cards_loop() static void game_playing_discarded_cards_loop()
{ {
if (hand_get_size() == 0 && hand_state == HAND_SHUFFLING && discard_top >= -1 && timer > 10) if (hand_get_size() == 0 && hand_state == HAND_SHUFFLING && discard_top >= -1 && timer > FRAMES(10))
{ {
// We take each discarded card and put it back into the deck with a short animation // We take each discarded card and put it back into the deck with a short animation
static CardObject* discarded_card_object = NULL; static CardObject* discarded_card_object = NULL;
@@ -834,7 +834,7 @@ static void cards_in_hand_update_loop(bool* discarded_card, int* played_selectio
hand_x = hand_x + (int2fx(i) - int2fx(hand_top) / 2) * -spacing_lut[hand_top]; hand_x = hand_x + (int2fx(i) - int2fx(hand_top) / 2) * -spacing_lut[hand_top];
} }
if (i == 0 && *discarded_card == false && timer % 10 == 0) if (i == 0 && *discarded_card == false && timer % FRAMES(10) == 0)
{ {
hand_state = HAND_DRAW; hand_state = HAND_DRAW;
*sound_played = false; *sound_played = false;
@@ -849,7 +849,7 @@ static void cards_in_hand_update_loop(bool* discarded_card, int* played_selectio
hand_x = hand_x + (int2fx(i) - int2fx(hand_top) / 2) * -spacing_lut[hand_top]; hand_x = hand_x + (int2fx(i) - int2fx(hand_top) / 2) * -spacing_lut[hand_top];
hand_y += (24 << FIX_SHIFT); hand_y += (24 << FIX_SHIFT);
if (hand[i]->selected && timer % 10 == 0) if (hand[i]->selected && timer % FRAMES(10) == 0)
{ {
hand[i]->selected = false; hand[i]->selected = false;
played_push(hand[i]); played_push(hand[i]);
@@ -868,7 +868,7 @@ static void cards_in_hand_update_loop(bool* discarded_card, int* played_selectio
timer = 1; timer = 1;
} }
if (i == 0 && timer % 10 == 0) if (i == 0 && timer % FRAMES(10) == 0)
{ {
hand_state = HAND_PLAYING; hand_state = HAND_PLAYING;
cards_drawn = 0; cards_drawn = 0;
@@ -1057,7 +1057,7 @@ static void played_cards_update_loop(bool* discarded_card, int* played_selection
switch (play_state) switch (play_state)
{ {
case PLAY_PLAYING: case PLAY_PLAYING:
if (i == 0 && (timer % 10 == 0 || played[played_top - *played_selections]->selected == false) && timer > 40) if (i == 0 && (timer % FRAMES(10) == 0 || played[played_top - *played_selections]->selected == false) && timer > FRAMES(40))
{ {
(*played_selections)--; (*played_selections)--;
@@ -1126,7 +1126,7 @@ static void played_cards_update_loop(bool* discarded_card, int* played_selection
} }
break; break;
case PLAY_ENDING: // This is the reverse of PLAY_PLAYING. The cards get reset back to their neutral position sequentially case PLAY_ENDING: // This is the reverse of PLAY_PLAYING. The cards get reset back to their neutral position sequentially
if (i == 0 && (timer % 10 == 0 || played[played_top - *played_selections]->selected == false) && timer > 40) if (i == 0 && (timer % FRAMES(10) == 0 || played[played_top - *played_selections]->selected == false) && timer > FRAMES(40))
{ {
(*played_selections)--; (*played_selections)--;
@@ -1143,7 +1143,7 @@ static void played_cards_update_loop(bool* discarded_card, int* played_selection
} }
break; break;
case PLAY_ENDED: // Basically a copy of HAND_DISCARD case PLAY_ENDED: // Basically a copy of HAND_DISCARD
if (!*discarded_card && played[i] != NULL && timer > 40) if (!*discarded_card && played[i] != NULL && timer > FRAMES(40))
{ {
played_x = int2fx(240); played_x = int2fx(240);
played_y = int2fx(70); played_y = int2fx(70);