make about page animation framerate independent

fixes #189
This commit is contained in:
Francisco Demartino 2022-02-19 18:15:57 -03:00
parent 859ac5e373
commit 87c9cc7574
1 changed files with 7 additions and 3 deletions

View File

@ -1557,7 +1557,6 @@ void FurnaceGUI::drawAbout() {
float b=0;
float peakMix=settings.partyTime?((peak[0]+peak[1])*0.5):0.3;
ImGui::ColorConvertHSVtoRGB(aboutHue,1.0,0.25+MIN(0.75f,peakMix*0.75f),r,g,b);
aboutHue+=0.001+peakMix*0.004;
dl->AddRectFilled(ImVec2(0,0),ImVec2(scrW*dpiScale,scrH*dpiScale),0xff000000);
bool skip=false;
bool skip2=false;
@ -1616,8 +1615,13 @@ void FurnaceGUI::drawAbout() {
0xffffffff,aboutLine[i]);
}
ImGui::PopFont();
aboutScroll+=2+(peakMix>0.78)*3;
aboutSin+=1+(peakMix>0.75)*2;
float timeScale = 60.0f * ImGui::GetIO().DeltaTime;
aboutHue+=(0.001+peakMix*0.004)*timeScale;
aboutScroll+=(2+(peakMix>0.78)*3)*timeScale;
aboutSin+=(1+(peakMix>0.75)*2)*timeScale;
if (aboutSin>=2400) aboutSin-=2400;
if (aboutScroll>(42*57+scrH)) aboutScroll=-20;
}