| 242 | } |
| 243 | |
| 244 | void GraphicsComponent::UnregisterMaterial(Nz::Material* material) |
| 245 | { |
| 246 | auto it = m_materialEntries.find(material); |
| 247 | NazaraAssert(it != m_materialEntries.end(), "Material not registered"); |
| 248 | |
| 249 | MaterialEntry& matEntry = it->second; |
| 250 | if (--matEntry.renderableCounter == 0) |
| 251 | { |
| 252 | if (material->GetReflectionMode() == Nz::ReflectionMode_RealTime) |
| 253 | { |
| 254 | if (--m_reflectiveMaterialCount == 0) |
| 255 | InvalidateReflectionMap(); |
| 256 | } |
| 257 | |
| 258 | m_materialEntries.erase(it); |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | /*! |
| 263 | * \brief Updates the bounding volume |