mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-03-05 17:51:28 +01:00
tween: add HasTweenEnded function
This commit is contained in:
parent
66caf96cc8
commit
d17a927a82
3 changed files with 7 additions and 2 deletions
|
@ -349,9 +349,9 @@ SYMBOL_EXPORT void DestroyCharacter(struct Game* game, struct Character* charact
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!character->shared) {
|
if (!character->shared) {
|
||||||
struct Spritesheet *tmp, *s = character->spritesheets;
|
struct Spritesheet* s = character->spritesheets;
|
||||||
while (s) {
|
while (s) {
|
||||||
tmp = s;
|
struct Spritesheet* tmp = s;
|
||||||
s = s->next;
|
s = s->next;
|
||||||
if (tmp->successor) {
|
if (tmp->successor) {
|
||||||
free(tmp->successor);
|
free(tmp->successor);
|
||||||
|
|
|
@ -262,6 +262,10 @@ SYMBOL_EXPORT struct Tween StaticTween(struct Game* game, double value) {
|
||||||
return Tween(game, value, value, TWEEN_STYLE_LINEAR, 0);
|
return Tween(game, value, value, TWEEN_STYLE_LINEAR, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SYMBOL_EXPORT bool HasTweenEnded(struct Tween* tween) {
|
||||||
|
return tween->done;
|
||||||
|
}
|
||||||
|
|
||||||
SYMBOL_EXPORT double GetTweenPosition(struct Tween* tween) {
|
SYMBOL_EXPORT double GetTweenPosition(struct Tween* tween) {
|
||||||
if (tween->duration == 0.0) {
|
if (tween->duration == 0.0) {
|
||||||
return 1.0;
|
return 1.0;
|
||||||
|
|
|
@ -85,6 +85,7 @@ struct Tween {
|
||||||
|
|
||||||
struct Tween Tween(struct Game* game, double start, double stop, TWEEN_STYLE style, double duration);
|
struct Tween Tween(struct Game* game, double start, double stop, TWEEN_STYLE style, double duration);
|
||||||
struct Tween StaticTween(struct Game* game, double value);
|
struct Tween StaticTween(struct Game* game, double value);
|
||||||
|
bool HasTweenEnded(struct Tween* tween);
|
||||||
double GetTweenPosition(struct Tween* tween);
|
double GetTweenPosition(struct Tween* tween);
|
||||||
double GetTweenInterpolation(struct Tween* tween);
|
double GetTweenInterpolation(struct Tween* tween);
|
||||||
double GetTweenValue(struct Tween* tween);
|
double GetTweenValue(struct Tween* tween);
|
||||||
|
|
Loading…
Add table
Reference in a new issue