Updated all uses of EntityXMLFile to use the new EntityFile to load entities into a world.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "Core/UniformScaleSystem.h"
|
||||
#include "Editor/EditorRenderSystem.h"
|
||||
#include "Editor/EditorWidgetSystem.h"
|
||||
#include "Core/EntityFile.h"
|
||||
|
||||
EditorSystem::EditorSystem(SystemParams params, IRenderer* renderer, RenderFrame* renderFrame)
|
||||
: System(params)
|
||||
@@ -259,12 +260,10 @@ EntityWrapper EditorSystem::importEntity(EntityWrapper parent, boost::filesystem
|
||||
}
|
||||
|
||||
try {
|
||||
auto entityFile = ResourceManager::Load<EntityXMLFile>(filePath.string());
|
||||
EntityXMLFilePreprocessor fpp(entityFile);
|
||||
fpp.RegisterComponents(parent.World);
|
||||
EntityXMLFileParser fp(entityFile);
|
||||
EntityID newEntity = fp.MergeEntities(parent.World, parent.ID);
|
||||
return EntityWrapper(parent.World, newEntity);
|
||||
auto entityFile = ResourceManager::Load<EntityFile>(filePath.string());
|
||||
EntityWrapper newEntity = entityFile->MergeInto(parent.World);
|
||||
parent.World->SetParent(newEntity.ID, parent.ID);
|
||||
return newEntity;
|
||||
} catch (const std::exception& e) {
|
||||
LOG_ERROR("Failed to import entity \"%s\": \"%s\"", filePath.string().c_str(), e.what());
|
||||
return EntityWrapper::Invalid;
|
||||
|
||||
Reference in New Issue
Block a user