From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/mecanim/graph/plugbinder.cpp | 180 +++++++++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 Runtime/mecanim/graph/plugbinder.cpp (limited to 'Runtime/mecanim/graph/plugbinder.cpp') diff --git a/Runtime/mecanim/graph/plugbinder.cpp b/Runtime/mecanim/graph/plugbinder.cpp new file mode 100644 index 0000000..03ffb30 --- /dev/null +++ b/Runtime/mecanim/graph/plugbinder.cpp @@ -0,0 +1,180 @@ +#include "UnityPrefix.h" +#include "Runtime/mecanim/graph/plugbinder.h" + +namespace mecanim +{ + void InitializeSetPlugBinder3(uint32_t& arCount, SetPlugBinder3 *& arSetPlugBinder3, ValuesList const& arValuesList, graph::EvaluationGraph const* apGraph, memory::Allocator& arAlloc) + { + arCount = 0; + arSetPlugBinder3 = 0; + + uint32_t i; + for(i = 0 ; i < apGraph->m_Input->mPlugCount; i++) + { + graph::GraphPlug& plug = *apGraph->m_Input->mPlugArray[i]; + uint32_t j; + for(j=0;j -1) + { + arCount++; + } + } + } + + if(arCount) + { + arSetPlugBinder3 = arAlloc.ConstructArray(arCount); + uint32_t binderCount; + for(i = 0, binderCount = 0; i < apGraph->m_Input->mPlugCount; i++) + { + graph::GraphPlug const* plug = apGraph->m_Input->mPlugArray[i]; + uint32_t j; + for(j=0;jm_ID); + if(index > -1) + { + uint32_t valueIndex = static_cast(index); + arSetPlugBinder3[binderCount++] = bind( SetPlugValueList, plug, j, valueIndex); + } + } + } + } + } + + void InitializeGetPlugBinder3(uint32_t& arCount, + GetPlugBinder3 *& arGetPlugBinder3, + ValuesList const& arValuesList, + graph::EvaluationGraph const* apGraph, + memory::Allocator& arAlloc) + { + arCount = 0; + arGetPlugBinder3 = 0; + + uint32_t i; + for(i = 0 ; i < apGraph->m_Output->mPlugCount; i++) + { + graph::GraphPlug& plug = *apGraph->m_Output->mPlugArray[i]; + uint32_t j; + for(j=0;j -1) + { + arCount++; + } + } + } + + if(arCount) + { + arGetPlugBinder3 = arAlloc.ConstructArray(arCount); + uint32_t binderCount; + for(i = 0, binderCount = 0; i < apGraph->m_Output->mPlugCount; i++) + { + graph::GraphPlug const* plug = apGraph->m_Output->mPlugArray[i]; + uint32_t j; + for(j=0;jm_ID); + if(index > -1) + { + uint32_t valueIndex = static_cast(index); + arGetPlugBinder3[binderCount++] = bind( GetPlugValueList, plug, j, valueIndex); + } + } + } + } + } + + + + void InitializeSetPlugBinder2(uint32_t& arCount, SetPlugBinder2 *& arSetPlugBinder2, ValuesList const& arValuesList, graph::EvaluationGraph const* apGraph, memory::Allocator& arAlloc) + { + arCount = 0; + arSetPlugBinder2 = 0; + + uint32_t i; + for(i = 0 ; i < apGraph->m_Input->mPlugCount; i++) + { + graph::GraphPlug& plug = *apGraph->m_Input->mPlugArray[i]; + uint32_t j; + for(j=0;j -1) + { + arCount++; + } + } + } + + if(arCount) + { + arSetPlugBinder2 = arAlloc.ConstructArray(arCount); + uint32_t binderCount; + for(i = 0, binderCount = 0; i < apGraph->m_Input->mPlugCount; i++) + { + graph::GraphPlug const* plug = apGraph->m_Input->mPlugArray[i]; + uint32_t j; + for(j=0;jm_ID); + if(index > -1) + { + uint32_t valueIndex = static_cast(index); + arSetPlugBinder2[binderCount++] = bind( SetPlugValue, plug, valueIndex); + } + } + } + } + } + + void InitializeGetPlugBinder5(uint32_t& arCount, + GetPlugBinder2 *& arGetPlugBinder2, + ValuesList const& arValuesList, + graph::EvaluationGraph const* apGraph, + memory::Allocator& arAlloc) + { + arCount = 0; + arGetPlugBinder2 = 0; + + uint32_t i; + for(i = 0 ; i < apGraph->m_Output->mPlugCount; i++) + { + graph::GraphPlug& plug = *apGraph->m_Output->mPlugArray[i]; + uint32_t j; + for(j=0;j -1) + { + arCount++; + } + } + } + + if(arCount) + { + arGetPlugBinder2 = arAlloc.ConstructArray(arCount); + uint32_t binderCount; + for(i = 0, binderCount = 0; i < apGraph->m_Output->mPlugCount; i++) + { + graph::GraphPlug const* plug = apGraph->m_Output->mPlugArray[i]; + uint32_t j; + for(j=0;jm_ID); + if(index > -1) + { + uint32_t valueIndex = static_cast(index); + arGetPlugBinder2[binderCount++] = bind( GetPlugValue, plug, valueIndex); + } + } + } + } + } + +} -- cgit v1.1-26-g67d0