Slight simplification in LogoScreen

Not that I think those crashes actually are from this...
This commit is contained in:
Henrik Rydgård 2021-02-11 22:11:50 +01:00
parent f4fb4f8f2c
commit 894cb9f28f
2 changed files with 3 additions and 4 deletions

View file

@ -484,6 +484,7 @@ void LogoScreen::update() {
Next();
}
frames_++;
sinceStart_ = (double)frames_ / rate;
}
void LogoScreen::sendMessage(const char *message, const char *value) {
@ -521,10 +522,7 @@ void LogoScreen::render() {
dc.Begin();
double rate = std::max(30.0, (double)System_GetPropertyFloat(SYSPROP_DISPLAY_REFRESH_RATE));
double sinceStart = (double)frames_ / rate;
float t = (float)sinceStart / (logoScreenSeconds / 3.0f);
float t = (float)sinceStart_ / (logoScreenSeconds / 3.0f);
float alpha = t;
if (t > 1.0f)

View file

@ -137,6 +137,7 @@ public:
private:
void Next();
int frames_ = 0;
double sinceStart_ = 0.0;
bool switched_ = false;
bool gotoGameSettings_ = false;
};