Extracted focus to SpriteObject for joker selling - WIP
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
#define MAX_SPRITES 128
|
||||
#define MAX_AFFINES 32
|
||||
#define SPRITE_FOCUS_RAISE_PX 10
|
||||
|
||||
OBJ_ATTR obj_buffer[MAX_SPRITES];
|
||||
OBJ_AFFINE *obj_aff_buffer = (OBJ_AFFINE*)obj_buffer;
|
||||
@@ -239,3 +240,18 @@ Sprite* sprite_object_get_sprite(SpriteObject* sprite_object)
|
||||
return NULL;
|
||||
return sprite_object->sprite;
|
||||
}
|
||||
|
||||
void sprite_object_set_focus(SpriteObject* sprite_object, bool focus)
|
||||
{
|
||||
if (sprite_object->focused == focus)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sprite_object->ty = sprite_object->ty + (focus ? -1 : 1) * SPRITE_FOCUS_RAISE_PX;
|
||||
}
|
||||
|
||||
bool sprite_object_is_focused(SpriteObject* sprite_object)
|
||||
{
|
||||
return sprite_object->focused;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user