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

Method GetSize

trinity/Particle/Tr2ParticleElementDeclaration.cpp:118–132  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------- Description: Returns size (dimension) of an element. It is pre-defined for all element types except for CUSTOM when m_dimension is used. Return Value: Size (dimension) of an element. --------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

116// Size (dimension) of an element.
117// --------------------------------------------------------------------------------------
118unsigned Tr2ParticleElementDeclaration::GetSize() const
119{
120 // We have pre-defined sizes for for all types except CUSTOM
121 static const unsigned sizes[Tr2ParticleElementDeclarationName::CUSTOM] = {
122 2,
123 3,
124 3,
125 1,
126 };
127 if( m_name.m_type == Tr2ParticleElementDeclarationName::CUSTOM )
128 {
129 return m_dimension;
130 }
131 return sizes[m_name.m_type];
132}
133
134// --------------------------------------------------------------------------------------
135// Description:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected