Graphics/LightComponent: Replace AttachLight with AddLight

This commit is contained in:
SirLynix
2022-11-26 18:32:47 +01:00
committed by Jérôme Leclercq
parent d7eab778fb
commit ec3bc45544
6 changed files with 58 additions and 49 deletions

View File

@@ -148,12 +148,10 @@ int main()
entt::entity headingEntity = registry.create();
{
auto spotLight = std::make_shared<Nz::SpotLight>();
spotLight->EnableShadowCasting(true);
spotLight->UpdateShadowMapSize(1024);
auto& entityLight = registry.emplace<Nz::LightComponent>(playerEntity);
entityLight.AttachLight(std::move(spotLight), 1);
auto& spotLight = entityLight.AddLight<Nz::SpotLight>(1);
spotLight.EnableShadowCasting(true);
spotLight.UpdateShadowMapSize(1024);
auto& entityGfx = registry.emplace<Nz::GraphicsComponent>(playerEntity);
entityGfx.AttachRenderable(model, 1);