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

Method SetDestination

trinity/Shader/Parameter/Tr2Vector2Parameter.cpp:131–158  ·  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

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