Refactor - removed tile_mem obj charblock index magic number (#293)
This commit is contained in:
@@ -58,6 +58,12 @@
|
|||||||
*/
|
*/
|
||||||
#define TILE_SIZE 8
|
#define TILE_SIZE 8
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @def TILE_MEM_OBJ_CHARBLOCK0_IDX
|
||||||
|
* @brief The index for the first charblock of the object memory in tonc's tile_mem
|
||||||
|
*/
|
||||||
|
#define TILE_MEM_OBJ_CHARBLOCK0_IDX 4
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+6
-2
@@ -107,8 +107,12 @@ static void s_blind_gfx_init(enum BlindType type)
|
|||||||
{
|
{
|
||||||
// TODO: Re-add grit copy. You need to decouple the blind graphics first.
|
// TODO: Re-add grit copy. You need to decouple the blind graphics first.
|
||||||
// This will allow this function to change the boss graphics info
|
// This will allow this function to change the boss graphics info
|
||||||
// GRIT_CPY(&tile_mem[4][_blind_type_map[type].pal_info.tid], tiles);
|
// GRIT_CPY(&tile_mem[TILE_MEM_OBJ_CHARBLOCK0_IDX][_blind_type_map[type].pal_info.tid], tiles);
|
||||||
BlindGfxInfo* p_gfx = &_blind_type_map[type].gfx_info;
|
BlindGfxInfo* p_gfx = &_blind_type_map[type].gfx_info;
|
||||||
memcpy32(&tile_mem[4][p_gfx->tid], p_gfx->tiles, BLIND_SPRITE_COPY_SIZE);
|
memcpy32(
|
||||||
|
&tile_mem[TILE_MEM_OBJ_CHARBLOCK0_IDX][p_gfx->tid],
|
||||||
|
p_gfx->tiles,
|
||||||
|
BLIND_SPRITE_COPY_SIZE
|
||||||
|
);
|
||||||
memcpy16(&pal_obj_bank[p_gfx->pb], p_gfx->palette, PAL_ROW_LEN);
|
memcpy16(&pal_obj_bank[p_gfx->pb], p_gfx->palette, PAL_ROW_LEN);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -90,7 +90,7 @@ void card_object_set_sprite(CardObject* card_object, int layer)
|
|||||||
{
|
{
|
||||||
int tile_index = CARD_TID + (layer * CARD_SPRITE_OFFSET);
|
int tile_index = CARD_TID + (layer * CARD_SPRITE_OFFSET);
|
||||||
memcpy32(
|
memcpy32(
|
||||||
&tile_mem[4][tile_index],
|
&tile_mem[TILE_MEM_OBJ_CHARBLOCK0_IDX][tile_index],
|
||||||
&deck_gfxTiles
|
&deck_gfxTiles
|
||||||
[_card_sprite_lut[card_object->card->suit][card_object->card->rank] * TILE_SIZE],
|
[_card_sprite_lut[card_object->card->suit][card_object->card->rank] * TILE_SIZE],
|
||||||
TILE_SIZE * CARD_SPRITE_OFFSET
|
TILE_SIZE * CARD_SPRITE_OFFSET
|
||||||
|
|||||||
+1
-1
@@ -150,7 +150,7 @@ JokerObject* joker_object_new(Joker* joker)
|
|||||||
s_joker_pb_add_sprite_user(joker_pb);
|
s_joker_pb_add_sprite_user(joker_pb);
|
||||||
|
|
||||||
memcpy32(
|
memcpy32(
|
||||||
&tile_mem[4][tile_index],
|
&tile_mem[TILE_MEM_OBJ_CHARBLOCK0_IDX][tile_index],
|
||||||
&joker_gfxTiles[joker_spritesheet_idx][joker_idx * TILE_SIZE * JOKER_SPRITE_OFFSET],
|
&joker_gfxTiles[joker_spritesheet_idx][joker_idx * TILE_SIZE * JOKER_SPRITE_OFFSET],
|
||||||
TILE_SIZE * JOKER_SPRITE_OFFSET
|
TILE_SIZE * JOKER_SPRITE_OFFSET
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user