Semi-working entity loading from XML files!

This commit is contained in:
sippeangelo
2015-12-09 11:59:58 +01:00
parent c9d1ba6cae
commit c9b140bd6b
6 changed files with 121 additions and 63 deletions
+4 -1
View File
@@ -36,12 +36,15 @@ glm::vec3 GetAbsolutePosition(World* world, ComponentWrapper transformComponent)
void RenderQueueFactory::FillModels(World* world, RenderQueue* renderQueue)
{
for(auto& modelC : world->GetComponents("Model")) {
ModelJob job;
std::string resource = modelC["Resource"];
if (resource.empty()) {
continue;
}
glm::vec4 color = modelC["Color"];
Model* model = ResourceManager::Load<Model>(resource);
for (auto texGroup : model->TextureGroups) {
ModelJob job;
job.TextureID = (texGroup.Texture) ? texGroup.Texture->ResourceID : 0;
job.DiffuseTexture = texGroup.Texture.get();
job.NormalTexture = texGroup.NormalMap.get();