Check active preset after the preset switch event, as this might have failed.

Another option would be skipping the rendering if there's no active preset instead of displaying the idle preset.
This commit is contained in:
Kai Blaschke
2023-07-24 11:13:14 +02:00
committed by Kai Blaschke
parent e9438ee0f6
commit b07163dd51

View File

@ -138,18 +138,6 @@ void ProjectM::RenderFrame()
return;
}
// If no preset is active, load the idle preset.
if (!m_activePreset)
{
LoadIdlePreset();
if (!m_activePreset)
{
return;
}
m_activePreset->Initialize(GetRenderContext());
}
m_timeKeeper->UpdateTimers();
m_beatDetect->CalculateBeatStatistics();
@ -176,6 +164,18 @@ void ProjectM::RenderFrame()
}
}
// If no preset is active, load the idle preset.
if (!m_activePreset)
{
LoadIdlePreset();
if (!m_activePreset)
{
return;
}
m_activePreset->Initialize(GetRenderContext());
}
// ToDo: Encapsulate preset loading check and transition in Renderer?
if (m_timeKeeper->IsSmoothing() && m_transitioningPreset != nullptr)
{