mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-02-04 19:55:39 +00:00
PJS: minor tweaks to smooth preset switching
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/personal/carm/dev-1.0@322 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
@ -7,40 +7,40 @@ void PresetMerger::MergePresets(PresetOutputs & A, PresetOutputs & B, double rat
|
||||
|
||||
for (PresetOutputs::cshape_container::iterator pos = A.customShapes.begin();
|
||||
pos != A.customShapes.end(); ++pos)
|
||||
{
|
||||
pos->second->a *= ratio;
|
||||
pos->second->a2 *= ratio;
|
||||
pos->second->border_a *= ratio;
|
||||
}
|
||||
|
||||
for (PresetOutputs::cshape_container::iterator pos = B.customShapes.begin();
|
||||
pos != B.customShapes.end(); ++pos)
|
||||
{
|
||||
pos->second->a *= invratio;
|
||||
pos->second->a2 *= invratio;
|
||||
pos->second->border_a *= invratio;
|
||||
A.customShapes[pos->first>>8]=pos->second;
|
||||
}
|
||||
|
||||
for (PresetOutputs::cshape_container::iterator pos = B.customShapes.begin();
|
||||
pos != B.customShapes.end(); ++pos)
|
||||
{
|
||||
pos->second->a *= ratio;
|
||||
pos->second->a2 *= ratio;
|
||||
pos->second->border_a *= ratio;
|
||||
A.customShapes[pos->first>>8]=pos->second;
|
||||
|
||||
}
|
||||
for (PresetOutputs::cwave_container::iterator pos = A.customWaves.begin();
|
||||
pos != A.customWaves.end(); ++pos)
|
||||
{
|
||||
pos->second->a *= ratio;
|
||||
pos->second->a *= invratio;
|
||||
for (int x; x < pos->second->samples; x++)
|
||||
{
|
||||
pos->second->a_mesh[x]=pos->second->a_mesh[x]*ratio;
|
||||
pos->second->a_mesh[x]=pos->second->a_mesh[x]*invratio;
|
||||
}
|
||||
}
|
||||
|
||||
for (PresetOutputs::cwave_container::iterator pos = B.customWaves.begin();
|
||||
pos != B.customWaves.end(); ++pos)
|
||||
{
|
||||
pos->second->a *= invratio;
|
||||
pos->second->a *= ratio;
|
||||
for (int x; x < pos->second->samples; x++)
|
||||
{
|
||||
pos->second->a_mesh[x]=pos->second->a_mesh[x]*invratio;
|
||||
pos->second->a_mesh[x]=pos->second->a_mesh[x]*ratio;
|
||||
}
|
||||
A.customWaves[pos->first>>8]=pos->second;
|
||||
A.customWaves[pos->first>>8]=pos->second;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -177,6 +177,8 @@ void projectM::default_key_handler( projectMEvent event, projectMKeycode keycode
|
||||
case PROJECTM_K_r:
|
||||
m_activePreset = m_presetChooser->weightedRandom<PresetChooser::UniformRandomFunctor>
|
||||
(this->presetInputs, this->presetOutputs);
|
||||
presetInputs.frame = 0;
|
||||
smoothFrame = 0;
|
||||
break;
|
||||
case PROJECTM_K_p:
|
||||
|
||||
@ -188,7 +190,8 @@ void projectM::default_key_handler( projectMEvent event, projectMKeycode keycode
|
||||
}
|
||||
|
||||
m_activePreset = m_presetPos->allocate(this->presetInputs, this->presetOutputs);
|
||||
|
||||
presetInputs.frame = 0;
|
||||
smoothFrame = 0;
|
||||
break;
|
||||
case PROJECTM_K_l:
|
||||
if (renderer->noSwitch==0)renderer->noSwitch=1; else renderer->noSwitch=0;
|
||||
|
||||
Reference in New Issue
Block a user