void GameLayerLight::removeLightTopId(int plantIndex) { int id = getMinLengthLightId(plantIndex); if (id <0)return ; removeLight(plantIndex, id); checkUpdateToPosition(plantIndex); }
void GameLayerLight::removeLightRandId(int plantIndex) { int id = randLightByPlant(plantIndex); if (id <0)return ; removeLight(plantIndex, id); checkUpdateToPosition(plantIndex); }
/// Removes \p light from the view and deletes it. /// /// Equivalent to: /// \code /// view.removeLight(light); /// delete light; /// \endcode bool GraphicsView::deleteLight(GraphicsLight *light) { bool found = removeLight(light); if(found){ delete light; } return found; }
void Light::setRenderScene(RenderScenePtr scene) noexcept { auto renderScene = _renderScene.lock(); if (renderScene) { if (this->getShadow()) _shadowCamera->setRenderScene(nullptr); renderScene->removeLight(std::dynamic_pointer_cast<Light>(this->shared_from_this())); } _renderScene = scene; if (scene) { if (this->getShadow()) _shadowCamera->setRenderScene(scene); scene->addLight(std::dynamic_pointer_cast<Light>(this->shared_from_this())); } }
void NativeRenderLogic::removed(GameObject *object) { object::Light *light = dynamic_cast<object::Light*>(object); if(light) removeLight(light); }