Implement new sprite_object_position function (#559)
Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user