From 05d4cc06c1c8379eddcf024d590264da8b64b21a Mon Sep 17 00:00:00 2001 From: w1z7ard Date: Wed, 5 Sep 2007 04:36:03 +0000 Subject: [PATCH] wrote q variable copy function git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@404 6778bc44-b910-0410-a7a0-be141de4315d --- src/projectM-engine/Preset.cpp | 4 ++++ src/projectM-engine/Preset.hpp | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/projectM-engine/Preset.cpp b/src/projectM-engine/Preset.cpp index 460417308..570141aba 100755 --- a/src/projectM-engine/Preset.cpp +++ b/src/projectM-engine/Preset.cpp @@ -375,6 +375,10 @@ void Preset::evaluateFrame() evalPerFrameInitEquations(); evalPerFrameEquations(); + + transfer_q_variables(customWaves); + transfer_q_variables(customShapes); + evalPerPixelEqns(); evalCustomWaveInitConditions(); diff --git a/src/projectM-engine/Preset.hpp b/src/projectM-engine/Preset.hpp index 206481e5e..27999a3d6 100644 --- a/src/projectM-engine/Preset.hpp +++ b/src/projectM-engine/Preset.hpp @@ -162,8 +162,32 @@ private: PresetOutputs & m_presetOutputs; const PresetInputs & m_presetInputs; // added for gx, gy reference. +template +CustomObject * transfer_q_variables(std::vector & customObjects); }; + +template +CustomObject * Preset::transfer_q_variables(std::vector & customObjects) +{ + CustomObject * custom_object; + + for (typename std::vector::iterator pos = customObjects.begin(); pos != customObjects.end();++pos) { + + custom_object = *pos; + custom_object->q1 = m_presetOutputs.q1; + custom_object->q2 = m_presetOutputs.q2; + custom_object->q3 = m_presetOutputs.q3; + custom_object->q4 = m_presetOutputs.q4; + custom_object->q5 = m_presetOutputs.q5; + custom_object->q6 = m_presetOutputs.q6; + custom_object->q7 = m_presetOutputs.q7; + custom_object->q8 = m_presetOutputs.q8; + } + + +} + template CustomObject * Preset::find_custom_object(int id, std::vector & customObjects) {