| 105 | } |
| 106 | |
| 107 | static dmGameObject::CreateResult CompLightDestroy(const dmGameObject::ComponentDestroyParams& params) |
| 108 | { |
| 109 | LightWorld* world = (LightWorld*) params.m_World; |
| 110 | LightContext* context = (LightContext*)params.m_Context; |
| 111 | LightComponent* light = (LightComponent*) *params.m_UserData; |
| 112 | |
| 113 | for (uint32_t i = 0; i < world->m_Components.Size(); ++i) |
| 114 | { |
| 115 | if (world->m_Components[i] == light) |
| 116 | { |
| 117 | world->m_Components.EraseSwap(i); |
| 118 | |
| 119 | dmRender::DeleteLightInstance(context->m_RenderContext, light->m_LightInstance); |
| 120 | |
| 121 | delete light; |
| 122 | return dmGameObject::CREATE_RESULT_OK; |
| 123 | } |
| 124 | } |
| 125 | return dmGameObject::CREATE_RESULT_OK; |
| 126 | } |
| 127 | |
| 128 | static dmGameObject::CreateResult CompLightAddToUpdate(const dmGameObject::ComponentAddToUpdateParams& params) |
| 129 | { |
nothing calls this directly
no test coverage detected