Files
Work/mdiwin/SCHEDULE.CPP
2024-08-07 09:16:27 -04:00

24 lines
585 B
C++
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#include <mdiwin/schedule.hpp>
void Schedule::createSchedule(Block<Schedule> &someSchedule,WORD nFrames)
{
float dstPercent(0.00);
float srcPercent(1.00);
float incremental(1.00);
someSchedule.remove();
if(1==nFrames)
{
someSchedule.insert(&Schedule(srcPercent,dstPercent,Schedule::DefaultCount));
return;
}
incremental=(100.00/((float)nFrames-1.00))/100.00;
for(int i=0;i<nFrames;i++)
{
someSchedule.insert(&Schedule(srcPercent,dstPercent,Schedule::DefaultCount));
dstPercent+=incremental;
srcPercent-=incremental;
if(srcPercent<0.00)srcPercent*=-1.00;
}
}