The main thread is not mutex blocked while child threads load anymore.

This commit is contained in:
William Moberg
2016-01-15 11:29:46 +01:00
parent 4cf6dcfc14
commit 76f90ab031
10 changed files with 68 additions and 34 deletions
+3 -3
View File
@@ -84,15 +84,15 @@ void RenderSystem::fillModels(std::list<std::shared_ptr<RenderJob>>& jobs, World
continue;
}
Model* model = ResourceManager::Load<::Model>(resource);
Model* model = ResourceManager::Load<::Model, true>(resource);
if (model == nullptr) {
model = ResourceManager::Load<::Model>("Models/Core/Error.obj");
}
glm::mat4 modelMatrix = Transform::ModelMatrix(modelComponent.EntityID, world);
for (auto texGroup : model->TextureGroups) {
std::shared_ptr<ModelJob> modelJob = std::shared_ptr<ModelJob>(new ModelJob(model, m_Camera, modelMatrix, texGroup, modelComponent, world));
for (auto matGroup : model->MaterialGroups()) {
std::shared_ptr<ModelJob> modelJob = std::shared_ptr<ModelJob>(new ModelJob(model, m_Camera, modelMatrix, matGroup, modelComponent, world));
jobs.push_back(modelJob);
}
}