Fix name of static variable s_LastLoadRender

This commit is contained in:
Robert Müller 2023-05-18 12:19:10 +02:00
parent af67130dbd
commit f60dd0d3c2

View file

@ -872,17 +872,17 @@ void CMenus::RenderLoading(const char *pCaption, const char *pContent, int Incre
{ {
// TODO: not supported right now due to separate render thread // TODO: not supported right now due to separate render thread
static std::chrono::nanoseconds LastLoadRender{0}; static std::chrono::nanoseconds s_LastLoadRender{0};
auto CurLoadRenderCount = m_LoadCurrent; auto CurLoadRenderCount = m_LoadCurrent;
m_LoadCurrent += IncreaseCounter; m_LoadCurrent += IncreaseCounter;
float Percent = CurLoadRenderCount / (float)m_LoadTotal; float Percent = CurLoadRenderCount / (float)m_LoadTotal;
// make sure that we don't render for each little thing we load // make sure that we don't render for each little thing we load
// because that will slow down loading if we have vsync // because that will slow down loading if we have vsync
if(time_get_nanoseconds() - LastLoadRender < std::chrono::nanoseconds(1s) / 60l) if(time_get_nanoseconds() - s_LastLoadRender < std::chrono::nanoseconds(1s) / 60l)
return; return;
LastLoadRender = time_get_nanoseconds(); s_LastLoadRender = time_get_nanoseconds();
// need up date this here to get correct // need up date this here to get correct
ms_GuiColor = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_UiColor, true)); ms_GuiColor = color_cast<ColorRGBA>(ColorHSLA(g_Config.m_UiColor, true));