Skip to content

Commit

Permalink
Merge pull request #258 from OnionGalaxy/fix_tweeners_on_loading
Browse files Browse the repository at this point in the history
Tweens now use real time so they can be used on loading time
  • Loading branch information
luismoyano authored Sep 7, 2020
2 parents a52fc4b + 5e7798a commit cdc0d31
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Engine/Animation/Tween/LOTween.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ TweenSequence* LOTween::CreateSequence()

void LOTween::Update(float dt)
{
if (sequences.size() <= 0) return;
if (sequences.size() <= 0 || dt >= MAX_TIME_ALLOWED) return;

for (std::vector<TweenSequence*>::reverse_iterator it = sequences.rbegin(); it != sequences.rend(); ++it)
{
Expand Down
1 change: 1 addition & 0 deletions Engine/Animation/Tween/LOTween.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ class LOTween

private:
std::vector<TweenSequence*> sequences;
const float MAX_TIME_ALLOWED = 1000.f;
};
#endif _LOTWEEN_H_
4 changes: 2 additions & 2 deletions Engine/Module/ModuleAnimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ bool ModuleAnimation::Init()
update_status ModuleAnimation::Update()
{
BROFILER_CATEGORY("Module Animation Update", Profiler::Color::LemonChiffon);
if (App->time->isGameRunning() && !App->resources->loading_thread_communication.loading)
if (App->time->isGameRunning())
{
tweener->Update(App->time->delta_time);
tweener->Update(App->time->real_time_delta_time);
}
else
{
Expand Down

0 comments on commit cdc0d31

Please sign in to comment.