Added TODO note and a warning comment

This commit is contained in:
MeirGavish
2025-07-23 00:02:24 +03:00
parent 9086aa0f59
commit c24dcab726
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -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;
+1
View File
@@ -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);
}