From 8d04afc90bdf8c59b2b679641162036ea7d438fd Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Tue, 6 Oct 2020 13:32:23 +1100 Subject: [PATCH] GUI2/Outro: removed next_draw rate limiting --- src/gui/dialogs/outro.cpp | 17 ----------------- src/gui/dialogs/outro.hpp | 3 --- 2 files changed, 20 deletions(-) diff --git a/src/gui/dialogs/outro.cpp b/src/gui/dialogs/outro.cpp index 7e89f92b5b63..5b207fe2087e 100644 --- a/src/gui/dialogs/outro.cpp +++ b/src/gui/dialogs/outro.cpp @@ -38,7 +38,6 @@ outro::outro(const game_classification& info) , fade_step_(0) , fading_in_(true) , timer_id_(0) - , next_draw_(0) { if(!info.end_text.empty()) { text_.push_back(info.end_text); @@ -95,24 +94,10 @@ void outro::pre_show(window& window) window.get_canvas(0).set_variable("outro_text", wfl::variant(*current_text_)); connect_signal_on_draw(window, std::bind(&outro::draw_callback, this, std::ref(window))); - - set_next_draw(); -} - -void outro::set_next_draw() -{ - /* The UI is rendered at approximately 50 FPS - 1 frame every 20 ms - meaning fading progresses every 3 frames. - * TODO: not sure if 60 is a better value in that case? - */ - next_draw_ = SDL_GetTicks() + 60; } void outro::draw_callback(window& window) { - if(SDL_GetTicks() < next_draw_) { - return; - } - /* If we've faded fully in... * * NOTE: we want fading to take around half a second. Given this function runs about every 3 frames, we @@ -160,8 +145,6 @@ void outro::draw_callback(window& window) } else { fade_step_--; } - - set_next_draw(); } void outro::post_show(window& /*window*/) diff --git a/src/gui/dialogs/outro.hpp b/src/gui/dialogs/outro.hpp index d7de423130da..c2e4062c6f78 100644 --- a/src/gui/dialogs/outro.hpp +++ b/src/gui/dialogs/outro.hpp @@ -49,8 +49,6 @@ class outro : public modal_dialog /** Inherited from modal_dialog. */ virtual void post_show(window& window) override; - void set_next_draw(); - void draw_callback(window& window); std::vector text_; @@ -62,7 +60,6 @@ class outro : public modal_dialog bool fading_in_; std::size_t timer_id_; - std::size_t next_draw_; }; } // namespace dialogs