MCPcopy Create free account
hub / github.com/carbonengine/trinity / SetDestination

Method SetDestination

trinity/Shader/Parameter/Tr2Vector3Parameter.cpp:133–161  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------- Description: Sets the destination buffer and buffer size Arguments: dest - The destination buffer size - The size of the destination buffer in bytes --------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

131// size - The size of the destination buffer in bytes
132// --------------------------------------------------------------------------------------
133void Tr2Vector3Parameter::SetDestination( void* dest, size_t size )
134{
135 if( size >= sizeof( float ) * 3 && !m_isSrgb )
136 {
137 m_reroutedValue = (float*)dest;
138 m_reroutedValue[0] = m_value.x;
139 m_reroutedValue[1] = m_value.y;
140 m_reroutedValue[2] = m_value.z;
141
142 for( BindingVector_t::iterator it = m_bindings.begin(); it != m_bindings.end(); ++it )
143 {
144 ( *it )->RerouteDestination( m_reroutedValue );
145 }
146 }
147 else
148 {
149 m_reroutedValue = NULL;
150
151 if( m_isSrgb )
152 {
153 m_linearValue = TriGammaToLinear( m_value );
154 }
155
156 for( BindingVector_t::iterator it = m_bindings.begin(); it != m_bindings.end(); ++it )
157 {
158 ( *it )->RerouteDestination( &m_value );
159 }
160 }
161}
162
163// --------------------------------------------------------------------------------------
164// Description:

Callers

nothing calls this directly

Calls 4

TriGammaToLinearFunction · 0.85
RerouteDestinationMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected