Fix Iterating over every blind instead of 3 max

This commit is contained in:
Rickey Fehr
2025-10-12 11:43:59 -07:00
parent 54d955d1e7
commit f885fa9164
3 changed files with 17 additions and 20 deletions
+7 -5
View File
@@ -5,6 +5,8 @@
#define MAX_ANTE 8 // The GBA's max uint value is around 4 billion, so we're going to not add endless mode for simplicity's sake
#define BLIND_COUNT 3
#define SMALL_BLIND_PB 1
#define BIG_BLIND_PB 2
#define BOSS_BLIND_PB 3
@@ -25,14 +27,14 @@ enum BlindColorIndex
BLIND_BACKGROUND_SHADOW_COLOR_INDEX = 7,
};
#define BLIND_INFO_TABLE \
BLIND_INFO(SMALL, small, FIX_ONE) \
BLIND_INFO(BIG, big, FIX_ONE) \
BLIND_INFO(BOSS, boss, FIX_ONE)
#define BLIND_INFO_TABLE \
BLIND_INFO(SMALL, small, FIX_ONE, 3) \
BLIND_INFO(BIG, big, (FIX_ONE * 3) / 2, 4) \
BLIND_INFO(BOSS, boss, FIX_ONE * 2, 5)
enum BlindType
{
#define BLIND_INFO(NAME, name, multi) \
#define BLIND_INFO(NAME, name, multi, reward) \
BLIND_TYPE_##NAME ,
BLIND_INFO_TABLE
BLIND_TYPE_MAX,
+3 -7
View File
@@ -4,10 +4,6 @@
#include "blinds_gfx.h"
#include "graphic_utils.h"
#define SMALL_BLIND_REWARD 3
#define BIG_BLIND_REWARD 4
#define BOSS_BLIND_REWARD 5
// +1 is added because we'll actually be indexing at 1, but if something causes you to go to ante 0, there will still be a value there.
static const int ante_lut[MAX_ANTE + 1] = {100, 300, 800, 2000, 5000, 11000, 20000, 35000, 50000};
@@ -19,7 +15,7 @@ static const u16 boss_blind_token_palette[PAL_ROW_LEN] = {0x0000, 0x2CC9, 0x3D0D
static const Blind blindMap[BLIND_TYPE_MAX] =
{
#define BLIND_INFO(NAME, name, multi) \
#define BLIND_INFO(NAME, name, multi, _reward) \
{ \
.type = BLIND_TYPE_##NAME , \
.pal_info = \
@@ -29,7 +25,7 @@ static const Blind blindMap[BLIND_TYPE_MAX] =
.pb = NAME##_BLIND_PB, \
}, \
.score_req_multipler = multi , \
.reward = NAME##_BLIND_REWARD, \
.reward = _reward , \
},
BLIND_INFO_TABLE
#undef BLIND_INFO
@@ -40,7 +36,7 @@ void blind_init()
// Blind graphics (fighting grit every step of the way as usual)
GRIT_CPY(&tile_mem[4][SMALL_BLIND_TID], blinds_gfxTiles);
for(int i = 0; i < BLIND_TYPE_MAX; i++)
for(int i = 0; i < BLIND_COUNT; i++)
{
const u16* pal = blindMap[i].pal_info.palette;
+7 -8
View File
@@ -78,12 +78,12 @@ static CardObject *main_menu_ace = NULL;
static Sprite *playing_blind_token = NULL; // The sprite that displays the blind when in "GAME_PLAYING/GAME_ROUND_END" state
static Sprite *round_end_blind_token = NULL; // The sprite that displays the blind when in "GAME_ROUND_END" state
static Sprite *blind_select_tokens[BLIND_TYPE_MAX] = {NULL}; // The sprites that display the blinds when in "GAME_BLIND_SELECT" state
static Sprite *blind_select_tokens[BLIND_COUNT] = {NULL}; // The sprites that display the blinds when in "GAME_BLIND_SELECT" state
static int current_blind = BLIND_TYPE_SMALL;
// The current state of the blinds, this is used to determine what the game is doing at any given time
static enum BlindState blinds[BLIND_TYPE_MAX] =
static enum BlindState blinds[BLIND_COUNT] =
{
BLIND_STATE_CURRENT,
BLIND_STATE_UPCOMING,
@@ -341,7 +341,6 @@ static const BG_POINT MAIN_MENU_ACE_T = {88, 26};
#define PITCH_STEP_DRAW_SFX 24
#define PITCH_STEP_UNDISCARD_SFX 2*PITCH_STEP_DRAW_SFX
#define BLIND_COUNT 3
#define TEN_K 10000
#define ONE_K 1000
@@ -1102,7 +1101,7 @@ void deck_shuffle()
void increment_blind(enum BlindState increment_reason)
{
current_blind++;
if (current_blind >= BLIND_TYPE_MAX)
if (current_blind >= BLIND_COUNT)
{
current_blind = 0;
blinds[0] = BLIND_STATE_CURRENT; // Reset the blinds to the first one
@@ -2902,7 +2901,7 @@ void game_blind_select()
change_background(BG_ID_BLIND_SELECT);
main_bg_se_copy_rect_1_tile_vert(POP_MENU_ANIM_RECT, SE_UP);
for (int i = 0; i < BLIND_TYPE_MAX; i++)
for (int i = 0; i < BLIND_COUNT; i++)
{
sprite_position(blind_select_tokens[i], blind_select_tokens[i]->pos.x, blind_select_tokens[i]->pos.y - TILE_SIZE);
}
@@ -2952,7 +2951,7 @@ void game_blind_select()
main_bg_se_copy_rect_1_tile_vert(POP_MENU_ANIM_RECT, SE_UP);
}
for (int i = 0; i < BLIND_TYPE_MAX; i++)
for (int i = 0; i < BLIND_COUNT; i++)
{
sprite_position(blind_select_tokens[i], blind_select_tokens[i]->pos.x, blind_select_tokens[i]->pos.y - (TILE_SIZE * 12));
}
@@ -2983,14 +2982,14 @@ void game_blind_select()
blinds_rect.top -= 1; // Because of the raised blind
main_bg_se_move_rect_1_tile_vert(blinds_rect, SE_DOWN);
for (int i = 0; i < BLIND_TYPE_MAX; i++)
for (int i = 0; i < BLIND_COUNT; i++)
{
sprite_position(blind_select_tokens[i], blind_select_tokens[i]->pos.x, blind_select_tokens[i]->pos.y + TILE_SIZE);
}
}
else if (timer >= MENU_POP_OUT_ANIM_FRAMES)
{
for (int i = 0; i < BLIND_TYPE_MAX; i++)
for (int i = 0; i < BLIND_COUNT; i++)
{
obj_hide(blind_select_tokens[i]->obj);
}