#include "BasicInterpolator.h" #include "Block.h" Framework::Either BasicInterpolator::interpolateBlocks( Framework::Either a, Framework::Either b, double aWeight, double bWeight, Noise* zNoise ) { if( aWeight < bWeight ) return interpolateBlocks( b, a, bWeight, aWeight, zNoise ); double score = bWeight / aWeight; if( score < 0.8 ) { if( b.isA() ) ((Block*)b)->release(); return a; } score = (score - 0.8) * 5; if( score < zNoise->getNoise( (score + 60) * 5, 100, 50 ) ) { if( b.isA() ) ((Block*)b)->release(); return a; } if( a.isA() ) ((Block*)a)->release(); return b; }