#include "PresetMerge.hpp" void PresetMerger::MergePresets(PresetOutputs & A, PresetOutputs & B, double ratio, int gx, int gy) { double invratio = ratio; ratio = 1.0 - invratio; //Merge Simple Waveforms // // All the mess is because of Waveform 7, which is two lines. // A.wave_rot = A.wave_rot* invratio + B.wave_rot*ratio; A.wave_scale = A.wave_scale* invratio + B.wave_scale*ratio; if (A.two_waves && B.two_waves) { for (int x = 0; xa *= invratio; (*pos)->a2 *= invratio; (*pos)->border_a *= invratio; } for (PresetOutputs::cshape_container::iterator pos = B.customShapes.begin(); pos != B.customShapes.end(); ++pos) { (*pos)->a *= ratio; (*pos)->a2 *= ratio; (*pos)->border_a *= ratio; A.customShapes.push_back(*pos); } for (PresetOutputs::cwave_container::iterator pos = A.customWaves.begin(); pos != A.customWaves.end(); ++pos) { (*pos)->a *= invratio; for (int x=0; x < (*pos)->samples; x++) { (*pos)->a_mesh[x]= (*pos)->a_mesh[x]*invratio; } } for (PresetOutputs::cwave_container::iterator pos = B.customWaves.begin(); pos != B.customWaves.end(); ++pos) { (*pos)->a *= ratio; for (int x=0; x < (*pos)->samples; x++) { (*pos)->a_mesh[x]= (*pos)->a_mesh[x]*ratio; } A.customWaves.push_back(*pos); } //Interpolate Per-Pixel mesh for (int x=0;x 0.5) { A.nVideoEchoOrientation = B.nVideoEchoOrientation; A.nWaveMode = B.nWaveMode; A.bAdditiveWaves = B.bAdditiveWaves; A.bWaveDots = B.bWaveDots; A.bWaveThick = B.bWaveThick; A.bModWaveAlphaByVolume = B.bModWaveAlphaByVolume; A.bMaximizeWaveColor = B.bMaximizeWaveColor; A.bTexWrap = B.bTexWrap; A.bDarkenCenter = B.bDarkenCenter; A.bRedBlueStereo = B.bRedBlueStereo; A.bBrighten = B.bBrighten; A.bDarken = B.bDarken; A.bSolarize = B.bSolarize; A.bInvert = B.bInvert; A.bMotionVectorsOn = B.bMotionVectorsOn; } return; }