first buildable implementation of a render item object optimal matching algorithm.

git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/personal/carm/represet@1207 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
w1z7ard
2009-02-18 09:31:41 +00:00
parent 92f282a9bb
commit cf83c16e3e
14 changed files with 269 additions and 23 deletions

View File

@ -1,8 +1,8 @@
#include "PresetMerge.hpp"
#include "RenderItemMatcher.hpp"
void PipelineMerger::MergePipelines(const Pipeline & a, const Pipeline & b, Pipeline & out, float ratio)
void PipelineMerger::MergePipelines(const Pipeline & a, const Pipeline & b, Pipeline & out, RenderItemMatcher & matcher, float ratio)
{
double invratio = 1.0 - ratio;
@ -12,6 +12,11 @@ void PipelineMerger::MergePipelines(const Pipeline & a, const Pipeline & b, Pipe
out.screenDecay =lerp( b.screenDecay, a.screenDecay, ratio);
out.drawables.clear();
double error = matcher(a.drawables, b.drawables);
for (int i = 0; i < a.drawables.size();i++)
for (int j = 0; j < b.drawables.size();j++)
std::cerr << "[" << i << "][" << j << "]" << matcher.weight(i,j);
for (std::vector<RenderItem*>::const_iterator pos = a.drawables.begin();
pos != a.drawables.end(); ++pos)
{