| 100 | */ |
| 101 | |
| 102 | void ParticleDeclaration::EnableComponent(ParticleComponent component, ComponentType type, std::size_t offset) |
| 103 | { |
| 104 | #ifdef NAZARA_DEBUG |
| 105 | if (component > ParticleComponent_Max) |
| 106 | { |
| 107 | NazaraError("Vertex component out of enum"); |
| 108 | return; |
| 109 | } |
| 110 | #endif |
| 111 | |
| 112 | #if NAZARA_GRAPHICS_SAFE |
| 113 | if (!IsTypeSupported(type)) |
| 114 | { |
| 115 | NazaraError("Component type 0x" + String::Number(type, 16) + " is not supported by particle declarations"); |
| 116 | return; |
| 117 | } |
| 118 | #endif |
| 119 | |
| 120 | if (component != ParticleComponent_Unused) |
| 121 | { |
| 122 | Component& particleComponent = m_components[component]; |
| 123 | if (particleComponent.enabled) |
| 124 | m_stride -= Utility::ComponentStride[particleComponent.type]; |
| 125 | else |
| 126 | particleComponent.enabled = true; |
| 127 | |
| 128 | particleComponent.offset = offset; |
| 129 | particleComponent.type = type; |
| 130 | } |
| 131 | |
| 132 | m_stride += Utility::ComponentStride[type]; |
| 133 | } |
| 134 | |
| 135 | /*! |
| 136 | * \brief Gets a component |
no outgoing calls
no test coverage detected