Entity parenting on parse
This commit is contained in:
@@ -9,7 +9,7 @@ class EntityFileParser
|
|||||||
public:
|
public:
|
||||||
EntityFileParser(const EntityFile* entityFile);
|
EntityFileParser(const EntityFile* entityFile);
|
||||||
|
|
||||||
void MergeEntities(World* world);
|
void MergeEntities(World* world, EntityID parent = EntityID_Invalid);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const EntityFile* m_EntityFile;
|
const EntityFile* m_EntityFile;
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ private:
|
|||||||
bool m_Visible;
|
bool m_Visible;
|
||||||
boost::filesystem::path m_DefaultEntityDir;
|
boost::filesystem::path m_DefaultEntityDir;
|
||||||
boost::filesystem::path m_CurrentFile;
|
boost::filesystem::path m_CurrentFile;
|
||||||
|
std::map<boost::filesystem::path, EntityID> m_CurrentFiles;
|
||||||
std::vector<glm::vec2> m_PickingQueue;
|
std::vector<glm::vec2> m_PickingQueue;
|
||||||
|
|
||||||
enum class WidgetMode
|
enum class WidgetMode
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ EntityFileParser::EntityFileParser(const EntityFile* entityFile)
|
|||||||
m_Handler.SetStartFieldDataCallback(std::bind(&EntityFileParser::onFieldData, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4));
|
m_Handler.SetStartFieldDataCallback(std::bind(&EntityFileParser::onFieldData, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityFileParser::MergeEntities(World* world)
|
void EntityFileParser::MergeEntities(World* world, EntityID parent /*= EntityID_Invalid*/)
|
||||||
{
|
{
|
||||||
m_World = world;
|
m_World = world;
|
||||||
m_EntityIDMapper[EntityID_Invalid] = EntityID_Invalid;
|
m_EntityIDMapper[EntityID_Invalid] = parent;
|
||||||
m_EntityFile->Parse(&m_Handler);
|
m_EntityFile->Parse(&m_Handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user