diff --git a/include/joker.h b/include/joker.h index 76fbd3e..63e251b 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/game.c b/source/game.c index b1d0807..19e46d2 100644 --- a/source/game.c +++ b/source/game.c @@ -195,7 +195,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 }; @@ -930,7 +930,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, MAX_SELECTION_SIZE + MAX_HAND_SIZE + 2); // Create the blind token sprite for round end + round_end_blind_token = blind_token_new(current_blind, 81, 86, MAX_SELECTION_SIZE + MAX_HAND_SIZE + 2); // Create the blind token sprite for round end if (round_end_blind_token != NULL) { diff --git a/source/joker.c b/source/joker.c index b765690..f76f387 100644 --- a/source/joker.c +++ b/source/joker.c @@ -141,6 +141,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); }