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
+1 -1
View File
@@ -13,7 +13,7 @@ private:
public:
~Model();
const std::vector<RawModel::MaterialGroup>& TextureGroups() const { return m_RawModel->TextureGroups; }
const std::vector<RawModel::MaterialGroup>& MaterialGroups() const { return m_RawModel->MaterialGroups; }
const glm::mat4& Matrix() const { return m_RawModel->m_Matrix; }
const std::vector<RawModel::Vertex>& Vertices() const { return m_RawModel->m_Vertices; }
+7 -7
View File
@@ -15,16 +15,16 @@
struct ModelJob : RenderJob
{
ModelJob(Model* model, Camera* camera, glm::mat4 matrix, ::Model::MaterialGroup texGroup, ComponentWrapper modelComponent, World* world)
ModelJob(Model* model, Camera* camera, glm::mat4 matrix, ::RawModel::MaterialGroup matGroup, ComponentWrapper modelComponent, World* world)
: RenderJob()
{
Model = model;
TextureID = (texGroup.Texture) ? texGroup.Texture->ResourceID : 0;
DiffuseTexture = texGroup.Texture.get();
NormalTexture = texGroup.NormalMap.get();
SpecularTexture = texGroup.SpecularMap.get();
StartIndex = texGroup.StartIndex;
EndIndex = texGroup.EndIndex;
TextureID = (matGroup.Texture) ? matGroup.Texture->ResourceID : 0;
DiffuseTexture = matGroup.Texture.get();
NormalTexture = matGroup.NormalMap.get();
SpecularTexture = matGroup.SpecularMap.get();
StartIndex = matGroup.StartIndex;
EndIndex = matGroup.EndIndex;
Matrix = matrix;
Color = modelComponent["Color"];
Entity = modelComponent.EntityID;
+1 -1
View File
@@ -57,7 +57,7 @@ public:
unsigned int EndIndex;
};
std::vector<MaterialGroup> TextureGroups;
std::vector<MaterialGroup> MaterialGroups;
std::vector<Vertex> m_Vertices;
std::vector<unsigned int> m_Indices;