| 58 | } |
| 59 | |
| 60 | void VertexDeclaration::EnableComponent(VertexComponent component, ComponentType type, std::size_t offset) |
| 61 | { |
| 62 | #ifdef NAZARA_DEBUG |
| 63 | if (component > VertexComponent_Max) |
| 64 | { |
| 65 | NazaraError("Vertex component out of enum"); |
| 66 | return; |
| 67 | } |
| 68 | #endif |
| 69 | |
| 70 | #if NAZARA_UTILITY_SAFE |
| 71 | if (!IsTypeSupported(type)) |
| 72 | { |
| 73 | NazaraError("Component type 0x" + String::Number(type, 16) + " is not supported by vertex declarations"); |
| 74 | return; |
| 75 | } |
| 76 | #endif |
| 77 | |
| 78 | if (component != VertexComponent_Unused) |
| 79 | { |
| 80 | Component& vertexComponent = m_components[component]; |
| 81 | if (vertexComponent.enabled) |
| 82 | m_stride -= Utility::ComponentStride[vertexComponent.type]; |
| 83 | else |
| 84 | vertexComponent.enabled = true; |
| 85 | |
| 86 | vertexComponent.offset = offset; |
| 87 | vertexComponent.type = type; |
| 88 | } |
| 89 | |
| 90 | m_stride += Utility::ComponentStride[type]; |
| 91 | } |
| 92 | |
| 93 | void VertexDeclaration::GetComponent(VertexComponent component, bool* enabled, ComponentType* type, std::size_t* offset) const |
| 94 | { |
no outgoing calls
no test coverage detected