Updated joker palette swapping system to reuse palettes when jokers are removed

This commit is contained in:
MeirGavish
2025-08-04 10:18:33 +03:00
parent 9f9b557143
commit de672572b1
5 changed files with 67 additions and 23 deletions
+7 -1
View File
@@ -6,10 +6,16 @@
#include "sprite.h"
#include "card.h"
#include "game.h"
#include "graphic_utils.h"
#define JOKER_TID (MAX_HAND_SIZE + MAX_SELECTION_SIZE) * JOKER_SPRITE_OFFSET // Tile ID for the starting index in the tile memory
#define JOKER_SPRITE_OFFSET 16 // Offset for the joker sprites
#define JOKER_BASE_PB 4 // Palette bank for the default jokers
#define JOKER_BASE_PB 4 // The starting palette index for the jokers
#define JOKER_LAST_PB (NUM_PALETTES - 1)
// Currently allocating the rest of the palettes for the jokers.
// This number needs to be decreased once we need to allocated palettes for other sprites
// such as planet cards etc.
#define JOKER_STARTING_LAYER 27
#define BASE_EDITION 0
+1 -1
View File
@@ -8,7 +8,6 @@ typedef struct
{
OBJ_ATTR *obj;
OBJ_AFFINE *aff;
u32 tid, pb;
POINT pos;
} Sprite;
@@ -44,6 +43,7 @@ INLINE void sprite_position(Sprite *sprite, int x, int y)
// Sprite functions
void sprite_init();
void sprite_draw();
int sprite_get_pb(const Sprite* sprite);
// SpriteObject methods
SpriteObject *sprite_object_new();