mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-05 00:38:00 +01:00
character: GetCharacterTransform: Take parent's pivot point into account
This commit is contained in:
parent
ab208854dd
commit
b806f1b596
1 changed files with 2 additions and 1 deletions
|
@ -747,8 +747,9 @@ SYMBOL_EXPORT ALLEGRO_TRANSFORM GetCharacterTransform(struct Game* game, struct
|
|||
|
||||
if (character->parent) {
|
||||
ALLEGRO_TRANSFORM parent = GetCharacterTransform(game, character->parent);
|
||||
struct Spritesheet* parent_spritesheet = character->parent->spritesheet;
|
||||
al_translate_transform(&transform, parent_spritesheet->width * parent_spritesheet->pivotX, parent_spritesheet->height * parent_spritesheet->pivotY);
|
||||
al_compose_transform(&transform, &parent);
|
||||
// FIXME: position should be calculated in relation to parents pivot point
|
||||
}
|
||||
|
||||
return transform;
|
||||
|
|
Loading…
Reference in a new issue