Merge branch 'fix_build_error' into refactors

This commit is contained in:
MeirGavish
2025-07-13 13:07:42 +03:00
7 changed files with 66 additions and 11 deletions
+20 -4
View File
@@ -4,6 +4,10 @@
#include "blinds_gfx.h"
static const u16 small_blind_token_palette[5] = {0x0000, 0x7FFF, 0x34A1, 0x5DCB, 0x5104};
static const u16 big_blind_token_palette[5] = {0x0000, 0x2527, 0x15F5, 0x36FC, 0x1E9C};
static const u16 boss_blind_token_palette[5] = {0x0000, 0x2CC9, 0x3D0D, 0x5E14, 0x5171}; // This variable is temporary, each boss blind will have its own unique palette
void blinds_init()
{
// Blind graphics (fighting grit every step of the way as usual)
@@ -11,15 +15,12 @@ void blinds_init()
// Palettes for the blinds (Transparency, Text Color, Shadow, Highlight, Main Color) Use this: http://www.budmelvin.com/dev/15bitconverter.html
// Small Blind
const u16 small_blind_token_palette[5] = {0x0000, 0x7FFF, 0x34A1, 0x5DCB, 0x5104};
memcpy16(&pal_obj_mem[16 * SMALL_BLIND_PB], &small_blind_token_palette, sizeof(small_blind_token_palette) / 2);
// Big Blind
const u16 big_blind_token_palette[5] = {0x0000, 0x2527, 0x15F5, 0x36FC, 0x1E9C};
memcpy16(&pal_obj_mem[16 * BIG_BLIND_PB], &big_blind_token_palette, sizeof(big_blind_token_palette) / 2);
// Boss Blind (This is temporary. Each boss blind is unique and will have to have its own graphics and palette which will probably be stored in some huge array)
const u16 boss_blind_token_palette[5] = {0x0000, 0x2CC9, 0x3D0D, 0x5E14, 0x5171};
memcpy16(&pal_obj_mem[16 * BOSS_BLIND_PB], &boss_blind_token_palette, sizeof(boss_blind_token_palette) / 2);
}
@@ -58,6 +59,21 @@ int blind_get_reward(int type)
}
}
u16 blind_get_color(int type, int index)
{
switch (type)
{
case SMALL_BLIND:
return small_blind_token_palette[index];
case BIG_BLIND:
return big_blind_token_palette[index];
case BOSS_BLIND:
return boss_blind_token_palette[index];
default:
return 0; // Invalid type
}
}
Sprite *blind_token_new(int type, int x, int y, int sprite_index)
{
Sprite *sprite = NULL;
+40 -5
View File
@@ -12,7 +12,6 @@
#include "graphic_utils.h"
#include "background_gfx.h"
#include "background_play_gfx.h"
#include "background_round_end_gfx.h"
#include "background_shop_gfx.h"
#include "background_blind_select_gfx.h"
@@ -370,13 +369,49 @@ void change_background(int id)
GRIT_CPY(&se_mem[MAIN_BG_SBB], background_gfxMap);
tte_erase_rect_wrapper(HAND_SIZE_RECT_PLAYING);
for (int y = 0; y < 6; y++) // Copies the blind panel from the bottom of the screen to the top. This code is identical to the one used in game_shop()
{
int y_from = 20 + y;
int y_to = 0 + y;
memcpy16(&se_mem[MAIN_BG_SBB][32 * y_to], &se_mem[MAIN_BG_SBB][32 * y_from], 9);
}
if (current_blind == BIG_BLIND) // Change text and palette depending on blind type
{
int y_from = 26;
int y_to = 1;
memcpy16(&se_mem[MAIN_BG_SBB][32 * y_to], &se_mem[MAIN_BG_SBB][32 * y_from], 9);
}
else if (current_blind == BOSS_BLIND)
{
int y_from = 27;
int y_to = 1;
memcpy16(&se_mem[MAIN_BG_SBB][32 * y_to], &se_mem[MAIN_BG_SBB][32 * y_from], 9);
}
// This would change the palette of the background to match the blind, but the backgroun doesn't use the blind token's exact colors so a different approach is required
// memset16(&pal_bg_mem[17], blind_get_color(current_blind, BLIND_HIGHLIGHT_COLOR_INDEX), 1);
// memset16(&pal_bg_mem[5], blind_get_color(current_blind, BLIND_MAIN_COLOR_INDEX), 1);
// memset16(&pal_bg_mem[13], blind_get_color(current_blind, BLIND_SHADOW_COLOR_INDEX), 1);
}
else if (id == BG_ID_CARD_PLAYING)
{
REG_DISPCNT |= DCNT_WIN0;
memcpy(pal_bg_mem, background_gfxPal, 64);
GRIT_CPY(&tile8_mem[MAIN_BG_CBB], background_gfxTiles);
memcpy(&se_mem[MAIN_BG_SBB], background_play_gfxMap, background_play_gfxMapLen);
// REG_DISPCNT |= DCNT_WIN0;
// memcpy(pal_bg_mem, background_gfxPal, 64);
// GRIT_CPY(&tile8_mem[MAIN_BG_CBB], background_gfxTiles);
// GRIT_CPY(&se_mem[MAIN_BG_SBB], background_gfxMap);
if (background != BG_ID_CARD_SELECTING)
{
change_background(BG_ID_CARD_SELECTING);
background = BG_ID_CARD_PLAYING;
}
for (int i = 0; i <= 2; i++)
{
main_bg_se_copy_rect_1_tile_vert(POP_MENU_ANIM_RECT_UP, SE_DOWN);
}
tte_erase_rect_wrapper(HAND_SIZE_RECT_SELECT);
}
-1
View File
@@ -11,7 +11,6 @@
// Graphics
#include "deck_gfx.h"
#include "background_gfx.h"
#include "background_play_gfx.h"
#include "affine_background_gfx.h"
// Audio