Updated all static variables to have the s_ prefix and constants to upper case (#591)

* Updated all static variables to have the s_ prefix and constants to upper case

* Renamed missed sneaky functions in round.c (+ clang-format...)

* Renamed a few more missed constants

* Updated rng_update() documentation

* Apply suggestions from Copilot's code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Added missed suggestion

* Updated rng_update() comment

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
MeirGavish
2026-07-16 20:21:18 +03:00
committed by GitHub
co-authored by Copilot Autofix powered by AI
parent 6e7d8a8399
commit 7a5a4a1276
21 changed files with 615 additions and 608 deletions
+12 -12
View File
@@ -78,10 +78,10 @@ static SelectionGrid main_menu_selection_grid = {
// clang-format on
// Main menu sprite - the ace of spades
static CardObject* main_menu_ace = NULL;
static CardObject* s_main_menu_ace = NULL;
// Keep track of last highlighted button
static enum MainButtons last_highlighted_button = PLAY_BTN_IDX;
static enum MainButtons s_last_highlighted_button = PLAY_BTN_IDX;
void game_main_menu_change_background(void)
{
@@ -103,16 +103,16 @@ void game_main_menu_on_init(void)
{
affine_background_change_background(AFFINE_BG_MAIN_MENU);
change_background(BG_MAIN_MENU, true);
main_menu_ace = card_object_new(card_new(SPADES, ACE));
card_object_set_sprite(main_menu_ace, 0);
s_main_menu_ace = card_object_new(card_new(SPADES, ACE));
card_object_set_sprite(s_main_menu_ace, 0);
// TODO: NULL-check sprite
main_menu_ace->sprite->obj->attr0 |= ATTR0_AFF_DBL;
main_menu_ace->tscale = float2fx(0.8f);
sprite_object_position((SpriteObject*)main_menu_ace, MAIN_MENU_ACE_T_X, MAIN_MENU_ACE_T_Y);
s_main_menu_ace->sprite->obj->attr0 |= ATTR0_AFF_DBL;
s_main_menu_ace->tscale = float2fx(0.8f);
sprite_object_position((SpriteObject*)s_main_menu_ace, MAIN_MENU_ACE_T_X, MAIN_MENU_ACE_T_Y);
// 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.
Selection sel_init = {last_highlighted_button, 0};
Selection sel_init = {s_last_highlighted_button, 0};
main_menu_selection_grid.selection = sel_init;
// Highlight current button
@@ -121,7 +121,7 @@ void game_main_menu_on_init(void)
void game_main_menu_on_update(void)
{
main_menu_ace->trotation = lu_sin((g_game_vars.timer << 8) / 2) / 3;
s_main_menu_ace->trotation = lu_sin((g_game_vars.timer << 8) / 2) / 3;
selection_grid_process_input(&main_menu_selection_grid);
}
@@ -129,12 +129,12 @@ void game_main_menu_on_update(void)
void game_main_menu_on_exit(void)
{
// Save selected button
last_highlighted_button = main_menu_selection_grid.selection.x;
s_last_highlighted_button = main_menu_selection_grid.selection.x;
// Normally I would just cache these and hide/unhide but I didn't feel like dealing with
// defining a layer for it
card_destroy(&main_menu_ace->card);
card_object_destroy(&main_menu_ace);
card_destroy(&s_main_menu_ace->card);
card_object_destroy(&s_main_menu_ace);
}
// Implement SelectionGrid handler functions