From c24dcab7267c6162e3671059f379710cfc009742 Mon Sep 17 00:00:00 2001 From: MeirGavish Date: Wed, 23 Jul 2025 00:02:24 +0300 Subject: [PATCH 1/2] Added TODO note and a warning comment --- include/joker.h | 4 ++++ source/joker.c | 1 + 2 files changed, 5 insertions(+) diff --git a/include/joker.h b/include/joker.h index e791792..2f20322 100644 --- a/include/joker.h +++ b/include/joker.h @@ -41,6 +41,10 @@ typedef struct typedef struct // copy of CardObject in card.h { + /* Note that since JokerObject is cast to CardObject in joker_object_update(), + * they have to have the exact same structure to have + * the exact same field offsets in memory + */ Joker *joker; Sprite *sprite; FIXED tx, ty; diff --git a/source/joker.c b/source/joker.c index a056ea8..2755930 100644 --- a/source/joker.c +++ b/source/joker.c @@ -135,6 +135,7 @@ void joker_object_update(JokerObject *joker_object) { // Re-use the card object update logic by casting the JokerObject to a CardObject temporarily // This works because card_object_update doesn't use any card data, which is why CardObject should've been generic. my bad + // TODO: Refactor and separate the relevant fields to a generic struct, maybe to Sprite or make a SpriteObject CardObject *card_object = (CardObject *)joker_object; card_object_update(card_object); } From 8ed7ddb1275f0a3f73482a60da6d795ed0816c48 Mon Sep 17 00:00:00 2001 From: MeirGavish Date: Wed, 23 Jul 2025 02:14:30 +0300 Subject: [PATCH 2/2] Moved the round end blind sprite and score a bit so they look better on 4 digits --- source/game.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/game.c b/source/game.c index 835e2cf..5389108 100644 --- a/source/game.c +++ b/source/game.c @@ -175,7 +175,7 @@ static const Rect DISCARDS_TEXT_RECT = {48, 104, UNDEFINED, UNDEF static const Rect DECK_SIZE_RECT = {200, 152, UNDEFINED, UNDEFINED }; static const Rect ROUND_TEXT_RECT = {48, 144, UNDEFINED, UNDEFINED }; static const Rect ANTE_TEXT_RECT = {8, 144, UNDEFINED, UNDEFINED }; -static const Rect ROUND_END_BLIND_REQ_RECT = {112, 96, 136, UNDEFINED }; +static const Rect ROUND_END_BLIND_REQ_RECT = {104, 96, 136, UNDEFINED }; static const Rect ROUND_END_BLIND_REWARD_RECT = { 168, 96, UNDEFINED, UNDEFINED }; static const Rect ROUND_END_NUM_HANDS_RECT = {88, 116, UNDEFINED, UNDEFINED }; static const Rect HAND_REWARD_RECT = {168, UNDEFINED, UNDEFINED, UNDEFINED }; @@ -890,7 +890,7 @@ void game_round_init() //{ // obj_hide(playing_blind_token->obj); // Hide the blind token sprite for now //} - round_end_blind_token = blind_token_new(current_blind, 82, 86, 34); // Create the blind token sprite for round end + round_end_blind_token = blind_token_new(current_blind, 81, 86, 34); // Create the blind token sprite for round end if (round_end_blind_token != NULL) {