made jokers dynamic and changed memcpy to us 32
This commit is contained in:
+1
-1
@@ -151,7 +151,7 @@ void card_object_update(CardObject *card_object)
|
|||||||
void card_object_set_sprite(CardObject *card_object, int layer)
|
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);
|
||||||
memcpy16(&tile_mem[4][tile_index], &deck_gfxTiles[card_sprite_lut[card_object->card->suit][card_object->card->rank] * TILE_SIZE], TILE_SIZE * CARD_SPRITE_OFFSET * 2);
|
memcpy32(&tile_mem[4][tile_index], &deck_gfxTiles[card_sprite_lut[card_object->card->suit][card_object->card->rank] * TILE_SIZE], TILE_SIZE * CARD_SPRITE_OFFSET);
|
||||||
sprite_destroy(&card_object->sprite); // Destroy the old sprite if it exists
|
sprite_destroy(&card_object->sprite); // Destroy the old sprite if it exists
|
||||||
card_object->sprite = sprite_new(ATTR0_SQUARE | ATTR0_4BPP | ATTR0_AFF, ATTR1_SIZE_32, tile_index, 0, layer + CARD_STARTING_LAYER);
|
card_object->sprite = sprite_new(ATTR0_SQUARE | ATTR0_4BPP | ATTR0_AFF, ATTR1_SIZE_32, tile_index, 0, layer + CARD_STARTING_LAYER);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -27,7 +27,7 @@ static uint timer = 0; // This might already exist in libtonc but idk so i'm jus
|
|||||||
static int game_speed = 1;
|
static int game_speed = 1;
|
||||||
static int background = 0;
|
static int background = 0;
|
||||||
|
|
||||||
static enum GameState game_state = GAME_BLIND_SELECT; // The current game state, this is used to determine what the game is doing at any given time
|
static enum GameState game_state = GAME_SHOP; // The current game state, this is used to determine what the game is doing at any given time
|
||||||
static enum HandState hand_state = HAND_DRAW;
|
static enum HandState hand_state = HAND_DRAW;
|
||||||
static enum PlayState play_state = PLAY_PLAYING;
|
static enum PlayState play_state = PLAY_PLAYING;
|
||||||
static int state = 0; // General state variable, used for switch statements in each game state related function
|
static int state = 0; // General state variable, used for switch statements in each game state related function
|
||||||
@@ -51,7 +51,7 @@ static int discards = 0;
|
|||||||
|
|
||||||
static int round = 0;
|
static int round = 0;
|
||||||
static int ante = 1;
|
static int ante = 1;
|
||||||
static int money = 4;
|
static int money = 100;
|
||||||
static int score = 0;
|
static int score = 0;
|
||||||
static int temp_score = 0; // This is the score that shows in the same spot as the hand type.
|
static int temp_score = 0; // This is the score that shows in the same spot as the hand type.
|
||||||
static FIXED lerped_score = 0;
|
static FIXED lerped_score = 0;
|
||||||
|
|||||||
+6
-2
@@ -36,7 +36,7 @@ static bool used_layers[MAX_JOKER_OBJECTS] = {false}; // Track used layers for j
|
|||||||
|
|
||||||
void joker_init()
|
void joker_init()
|
||||||
{
|
{
|
||||||
GRIT_CPY(&tile_mem[4][JOKER_TID], joker_gfxTiles);
|
//GRIT_CPY(&tile_mem[4][JOKER_TID], joker_gfxTiles);
|
||||||
memcpy16(&pal_obj_mem[PAL_ROW_LEN * JOKER_PB], joker_gfxPal, sizeof(joker_gfxPal) / 2);
|
memcpy16(&pal_obj_mem[PAL_ROW_LEN * JOKER_PB], joker_gfxPal, sizeof(joker_gfxPal) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,14 +100,18 @@ JokerObject *joker_object_new(Joker *joker)
|
|||||||
}
|
}
|
||||||
|
|
||||||
joker_object->joker = joker;
|
joker_object->joker = joker;
|
||||||
|
|
||||||
|
int tile_index = JOKER_TID + (layer * JOKER_SPRITE_OFFSET);
|
||||||
|
memcpy32(&tile_mem[4][tile_index], &joker_gfxTiles[joker->id * TILE_SIZE * JOKER_SPRITE_OFFSET], TILE_SIZE * JOKER_SPRITE_OFFSET);
|
||||||
joker_object->sprite = sprite_new
|
joker_object->sprite = sprite_new
|
||||||
(
|
(
|
||||||
ATTR0_SQUARE | ATTR0_4BPP | ATTR0_AFF,
|
ATTR0_SQUARE | ATTR0_4BPP | ATTR0_AFF,
|
||||||
ATTR1_SIZE_32,
|
ATTR1_SIZE_32,
|
||||||
JOKER_TID + (JOKER_SPRITE_OFFSET * joker->id),
|
tile_index,
|
||||||
JOKER_PB,
|
JOKER_PB,
|
||||||
JOKER_STARTING_LAYER + layer
|
JOKER_STARTING_LAYER + layer
|
||||||
);
|
);
|
||||||
|
|
||||||
joker_object->tx = 0; // Target position
|
joker_object->tx = 0; // Target position
|
||||||
joker_object->ty = 0;
|
joker_object->ty = 0;
|
||||||
joker_object->x = 0;
|
joker_object->x = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user