Implement new sprite_object_position function (#559)

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
This commit is contained in:
Geralt
2026-06-16 20:33:31 +03:00
committed by GitHub
co-authored by MathisMartin31
parent bf08d4eb78
commit 751a547059
4 changed files with 24 additions and 14 deletions
+17
View File
@@ -365,4 +365,21 @@ INLINE void sprite_position(Sprite* sprite, int x, int y)
obj_set_pos(sprite->obj, x, y);
}
/**
* @brief Set sprite_object position. Inlined for efficiency
*
* @param sprite_object poitner to a SpriteObject to adjust the position of. A **NULL** check is not
* performed, though the value cannot be **NULL**.
*
* @param x horizontal position in pixels
* @param y vertical position in pixels
*/
INLINE void sprite_object_position(SpriteObject* sprite_object, int x, int y)
{
sprite_object->x = int2fx(x);
sprite_object->y = int2fx(y);
sprite_object->tx = int2fx(x);
sprite_object->ty = int2fx(y);
}
#endif // SPRITE_H