forgot--This line, and those below, will be ignored--

M    projectM-engine/projectM.cpp


git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/personal/carm/dev-1.0@346 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
w1z7ard
2007-08-16 03:52:11 +00:00
parent 807da7fe56
commit ac354b8fdd

View File

@ -73,7 +73,8 @@ projectM *projectM::currentEngine = NULL;
RenderTarget * projectM::renderTarget = NULL;
Renderer * projectM::renderer = NULL;
float smoothTime = 5;
double presetDuration = 15;
double smoothDuration = 5;
//int smoothFrame = 0;
int oldFrame = 0;
@ -144,10 +145,10 @@ DLLEXPORT void projectM::renderFrame()
m_activePreset2 = m_presetChooser->weightedRandom<PresetChooser::UniformRandomFunctor>
(presetInputs, &m_activePreset->presetOutputs() == &presetOutputs ? presetOutputs2 : presetOutputs);
assert(m_activePreset2.get());
renderer->setPresetName(m_activePreset2->absoluteFilePath());
renderer->setPresetName(m_activePreset2->absoluteFilePath());
nohard=(int)(presetInputs.fps*3.5);
smoothFrame = (int)(presetInputs.fps * smoothTime);
smoothFrame = (int)(presetInputs.fps * smoothDuration);
printf("SOFT CUT - Smooth started\n");
}
@ -179,12 +180,14 @@ DLLEXPORT void projectM::renderFrame()
presetInputs.frame = frame;
presetInputs.progress= frame /(float) avgtime;
assert(m_activePreset2.get());
m_activePreset2->evaluateFrame();
m_activePreset2->evaluateFrame();
renderer->PerPixelMath(&m_activePreset2->presetOutputs(), &presetInputs);
renderer->WaveformMath(&m_activePreset2->presetOutputs(), &presetInputs, true);
double ratio = smoothFrame / (presetInputs.fps * smoothTime);
//double pos = -((smoothFrame / (presetInputs.fps * smoothDuration))-1);
//double ratio = 1/(1 + exp((pos-0.5)*4*M_PI));
double ratio = smoothFrame / (presetInputs.fps * smoothDuration);
// printf("f(%f)=%f\n",pos, ratio);
PresetMerger::MergePresets(m_activePreset->presetOutputs(),m_activePreset2->presetOutputs(),ratio,presetInputs.gx, presetInputs.gy);
//printf("Smooth:%d\n",smoothFrame);
@ -196,7 +199,7 @@ DLLEXPORT void projectM::renderFrame()
{
if (smoothFrame == 1)
{
m_activePreset = m_activePreset2;
m_activePreset = m_activePreset2;
smoothFrame=0;
printf("Smooth Finished\n");
}
@ -449,7 +452,7 @@ DLLEXPORT void projectM::projectM_init ( int gx, int gy, int fps, int texsize, i
DWRITE ( "post PCM init\n" );
#endif
this->avgtime=this->presetInputs.fps*10;
this->avgtime=(int)(this->presetInputs.fps*presetDuration);
this->hasInit = 1;