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.h | 85 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Runtime/mecanim/graph/plugbinder.h (limited to 'Runtime/mecanim/graph/plugbinder.h') diff --git a/Runtime/mecanim/graph/plugbinder.h b/Runtime/mecanim/graph/plugbinder.h new file mode 100644 index 0000000..f224440 --- /dev/null +++ b/Runtime/mecanim/graph/plugbinder.h @@ -0,0 +1,85 @@ +/* + Copyright (c) 7244339 Canada Inc. (Mecanim) + All Rights Reserved. +*/ +#pragma once + +#include "Runtime/mecanim/bind.h" +#include "Runtime/mecanim/graph/graph.h" +#include "Runtime/mecanim/generic/valuearray.h" + +namespace mecanim +{ + typedef binder2::ptr, + graph::GraphPlug const*, + uint32_t> + SetPlugBinder2; + + typedef binder2::ptr, + graph::GraphPlug const*, + uint32_t > + GetPlugBinder2; + + typedef binder3::ptr, + graph::GraphPlug const*, + uint32_t, + uint32_t> + SetPlugBinder3; + + + typedef binder3::ptr, + graph::GraphPlug const*, + uint32_t, + uint32_t> + GetPlugBinder3; + + STATIC_INLINE void SetPlugValue(mecanim::graph::GraphPlug const* plug, mecanim::uint32_t valueIndex, mecanim::ValueArray const* valueArray, mecanim::graph::EvaluationGraphWorkspace* graphWS) + { + char ATTRIBUTE_ALIGN(ALIGN4F) value[48]; + valueArray->m_ValueArray[valueIndex]->ReadData(value); + plug->WriteData( value, graphWS->m_EvaluationInfo); + } + STATIC_INLINE void GetPlugValue(mecanim::graph::GraphPlug const* plug, mecanim::uint32_t valueIndex, mecanim::ValueArray* valueArray, mecanim::graph::EvaluationGraphWorkspace* graphWS) + { + char ATTRIBUTE_ALIGN(ALIGN4F) value[48]; + plug->ReadData( value, graphWS->m_EvaluationInfo); + valueArray->m_ValueArray[valueIndex]->WriteData(value); + } + + STATIC_INLINE void SetPlugValueList(mecanim::graph::GraphPlug const* plug, mecanim::uint32_t listIndex, mecanim::uint32_t valueIndex, ValuesList const& valuesList, mecanim::graph::EvaluationGraphWorkspace* graphWS) + { + char ATTRIBUTE_ALIGN(ALIGN4F) value[48]; + valuesList.m_InValues[listIndex]->m_ValueArray[valueIndex]->ReadData(value); + plug->WriteData( value, graphWS->m_EvaluationInfo); + } + STATIC_INLINE void GetPlugValueList(mecanim::graph::GraphPlug const* plug, mecanim::uint32_t listIndex, mecanim::uint32_t valueIndex, ValuesList const& valuesList, mecanim::graph::EvaluationGraphWorkspace* graphWS) + { + char ATTRIBUTE_ALIGN(ALIGN4F) value[48]; + plug->ReadData( value, graphWS->m_EvaluationInfo); + valuesList.m_OutValues[listIndex]->m_ValueArray[valueIndex]->WriteData(value); + } + + void InitializeSetPlugBinder3(uint32_t& arCount, + SetPlugBinder3 *& arSetPlugBinder3, + ValuesList const& arValuesList, + graph::EvaluationGraph const* apGraph, + memory::Allocator& arAlloc); + + void InitializeGetPlugBinder3(uint32_t& arCount, + GetPlugBinder3 *& arGetPlugBinder3, + ValuesList const& arValuesList, + graph::EvaluationGraph const* apGraph, + memory::Allocator& arAlloc); + + void InitializeSetPlugBinder2(uint32_t& arCount, + SetPlugBinder2 *& arSetPlugBinder2, + ValuesList const& arValuesList, + graph::EvaluationGraph const* apGraph, + memory::Allocator& arAlloc); + + void InitializeGetPlugBinder2(uint32_t& arCount, + GetPlugBinder2 *& arGetPlugBinder2, + ValuesList const& arValuesList, + graph::EvaluationGraph const* apGraph, + memory::Allocator& arAlloc); +} \ No newline at end of file -- cgit v1.1-26-g67d0