Fixed freezing with NPCs
This commit is contained in:
@@ -59,6 +59,7 @@ CharacterModule::CharacterModule(flecs::world &ecs)
|
||||
body_parts[age][sex].end())
|
||||
body_parts[age][sex][slot] = nlohmann::json::array();
|
||||
body_parts[age][sex][slot].push_back(mesh);
|
||||
mesh_names.insert(mesh);
|
||||
Ogre::MeshManager::getSingleton().load(mesh, "Characters");
|
||||
}
|
||||
std::cout << body_parts.dump(4) << std::endl;
|
||||
@@ -768,4 +769,13 @@ void CharacterModule::getSlotMeshes(const Ogre::String &age,
|
||||
for (auto &slots : body_parts[age][sex][slotName])
|
||||
meshes.push_back(slots.get<Ogre::String>());
|
||||
}
|
||||
|
||||
void CharacterModule::preloadMeshes()
|
||||
{
|
||||
for (const auto &mesh : mesh_names) {
|
||||
Ogre::Entity *ent =
|
||||
ECS::get<EngineData>().mScnMgr->createEntity(mesh);
|
||||
ECS::get<EngineData>().mScnMgr->destroyEntity(ent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user