GUI2/Outro: removed next_draw rate limiting

This commit is contained in:
Charles Dang 2020-10-06 13:32:23 +11:00
parent ef315635be
commit 8d04afc90b
2 changed files with 0 additions and 20 deletions

View file

@ -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*/)

View file

@ -49,8 +49,6 @@ private:
/** Inherited from modal_dialog. */
virtual void post_show(window& window) override;
void set_next_draw();
void draw_callback(window& window);
std::vector<std::string> text_;
@ -62,7 +60,6 @@ private:
bool fading_in_;
std::size_t timer_id_;
std::size_t next_draw_;
};
} // namespace dialogs