From babbce9e6d9ef320861f8d19c1d9afe5333f0655 Mon Sep 17 00:00:00 2001 From: Pham Hong Duc Date: Sat, 21 May 2022 15:57:18 +0700 Subject: [PATCH] #123 Update save/load IndirectLighting --- .../Skylicht/Engine/Source/Components/CComponentSystem.h | 1 + .../Engine/Source/IndirectLighting/CIndirectLighting.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Projects/Skylicht/Engine/Source/Components/CComponentSystem.h b/Projects/Skylicht/Engine/Source/Components/CComponentSystem.h index 33cc0d460..6e99a30f4 100644 --- a/Projects/Skylicht/Engine/Source/Components/CComponentSystem.h +++ b/Projects/Skylicht/Engine/Source/Components/CComponentSystem.h @@ -26,6 +26,7 @@ This file is part of the "Skylicht Engine". #include "Utils/CActivator.h" #include "Serializable/CObjectSerializable.h" +#include "Serializable/CArraySerializable.h" #include "CComponentCategory.h" namespace Skylicht diff --git a/Projects/Skylicht/Engine/Source/IndirectLighting/CIndirectLighting.cpp b/Projects/Skylicht/Engine/Source/IndirectLighting/CIndirectLighting.cpp index c75a301ff..26aedd700 100644 --- a/Projects/Skylicht/Engine/Source/IndirectLighting/CIndirectLighting.cpp +++ b/Projects/Skylicht/Engine/Source/IndirectLighting/CIndirectLighting.cpp @@ -123,7 +123,7 @@ namespace Skylicht enumType->addEnumString("SH9", EIndirectType::SH9); object->addAutoRelease(enumType); - CObjectSerializable* textureArray = new CObjectSerializable("LMTextures", object); + CArraySerializable* textureArray = new CArraySerializable("LMTextures", object); object->addAutoRelease(textureArray); std::vector textureExts = { "tga","png" }; @@ -150,12 +150,12 @@ namespace Skylicht EIndirectType type = object->get("type", EIndirectType::SH9); - CObjectSerializable* textureArray = (CObjectSerializable*)object->getProperty("LMTextures"); + CArraySerializable* textureArray = (CArraySerializable*)object->getProperty("LMTextures"); if (textureArray != NULL) { m_lightmapPaths.clear(); - int count = (int)textureArray->getNumProperty(); + int count = textureArray->getElementCount(); for (int i = 0; i < count; i++) { char name[43];