forked from Green-Sky/tomato
make fade respect fps
This commit is contained in:
parent
afb886ea7c
commit
f637c7c942
@ -255,11 +255,10 @@ void ChatGui4::render(float time_delta) {
|
|||||||
// do systems TODO: extract
|
// do systems TODO: extract
|
||||||
{ // fade system
|
{ // fade system
|
||||||
std::vector<Message3> to_remove;
|
std::vector<Message3> to_remove;
|
||||||
msg_reg.view<Components::UnreadFade>().each([&to_remove](const Message3 e, Components::UnreadFade& fade) {
|
msg_reg.view<Components::UnreadFade>().each([&to_remove, time_delta](const Message3 e, Components::UnreadFade& fade) {
|
||||||
// TODO: configurable
|
// TODO: configurable
|
||||||
const float fade_duration = 7.5f;
|
const float fade_duration = 7.5f;
|
||||||
// TODO: dynamic fps
|
fade.fade -= 1.f/fade_duration * time_delta;
|
||||||
fade.fade -= 1.f/fade_duration * (1.f/60.f);
|
|
||||||
if (fade.fade <= 0.f) {
|
if (fade.fade <= 0.f) {
|
||||||
to_remove.push_back(e);
|
to_remove.push_back(e);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user