This reverts commit d3c0357856.
This commit is contained in:
+11
-28
@@ -1,6 +1,8 @@
|
||||
#include "card.h"
|
||||
|
||||
#include "deck_gfx.h"
|
||||
#include "graphic_utils.h"
|
||||
#include "high_contrast_deck_pal_gfx.h"
|
||||
|
||||
#include <maxmod.h>
|
||||
#include <stdlib.h>
|
||||
@@ -9,11 +11,6 @@
|
||||
#include "pool.h"
|
||||
#include "soundbank.h"
|
||||
|
||||
// Card Sprites and Palettes
|
||||
#include "deck_big_gfx.h"
|
||||
#include "deck_gfx.h"
|
||||
#include "high_contrast_deck_pal_gfx.h"
|
||||
|
||||
// Card sprites lookup table. First index is the suit, second index is the rank. The value is the
|
||||
// tile index.
|
||||
const static u16 _card_sprite_lut[NUM_SUITS][NUM_RANKS] = {
|
||||
@@ -23,13 +20,14 @@ const static u16 _card_sprite_lut[NUM_SUITS][NUM_RANKS] = {
|
||||
{624, 640, 656, 672, 688, 704, 720, 736, 752, 768, 784, 800, 816}
|
||||
};
|
||||
|
||||
bool high_contrast = DEFAULT_HIGH_CONTRAST;
|
||||
bool more_readable = DEFAULT_MORE_READABLE;
|
||||
|
||||
void set_cards_high_contrast(bool enable)
|
||||
void card_init()
|
||||
{
|
||||
high_contrast = enable;
|
||||
if (high_contrast)
|
||||
toggle_high_contrast_cards(false);
|
||||
}
|
||||
|
||||
void toggle_high_contrast_cards(bool enable)
|
||||
{
|
||||
if (enable)
|
||||
{
|
||||
GRIT_CPY(&pal_obj_mem[CARD_PB], high_contrast_deck_pal_gfxPal);
|
||||
}
|
||||
@@ -39,21 +37,6 @@ void set_cards_high_contrast(bool enable)
|
||||
}
|
||||
}
|
||||
|
||||
void set_cards_more_readable(bool enable)
|
||||
{
|
||||
more_readable = enable;
|
||||
}
|
||||
|
||||
bool get_cards_high_contrast(void)
|
||||
{
|
||||
return high_contrast;
|
||||
}
|
||||
|
||||
bool get_cards_more_readable(void)
|
||||
{
|
||||
return more_readable;
|
||||
}
|
||||
|
||||
// Card methods
|
||||
Card* card_new(u8 suit, u8 rank)
|
||||
{
|
||||
@@ -120,10 +103,10 @@ void card_object_update(CardObject* card_object)
|
||||
void card_object_set_sprite(CardObject* card_object, int layer)
|
||||
{
|
||||
int tile_index = CARD_TID + (layer * CARD_SPRITE_OFFSET);
|
||||
const unsigned int* card_tiles = more_readable ? deck_big_gfxTiles : deck_gfxTiles;
|
||||
memcpy32(
|
||||
&tile_mem[TILE_MEM_OBJ_CHARBLOCK0_IDX][tile_index],
|
||||
&card_tiles[_card_sprite_lut[card_object->card->suit][card_object->card->rank] * TILE_SIZE],
|
||||
&deck_gfxTiles
|
||||
[_card_sprite_lut[card_object->card->suit][card_object->card->rank] * TILE_SIZE],
|
||||
TILE_SIZE * CARD_SPRITE_OFFSET
|
||||
);
|
||||
Sprite* sprite = sprite_new(
|
||||
|
||||
Reference in New Issue
Block a user