Made resource loading fail gracefully when a resource can't be loaded. Resources should now throw exceptions in their constuctor if the resource can't be loaded. This will result in ResourceManager::Load returning null.

This commit is contained in:
2015-12-13 20:04:50 +01:00
parent 91ace0d2a0
commit 524af211e0
3 changed files with 15 additions and 6 deletions
@@ -77,6 +77,9 @@ void RenderQueueFactory::FillModels(World* world, RenderQueue* renderQueue)
}
glm::vec4 color = modelC["Color"];
Model* model = ResourceManager::Load<Model>(resource);
if (model == nullptr) {
model = ResourceManager::Load<Model>("Models/Core/Error.obj");
}
for (auto texGroup : model->TextureGroups) {
ModelJob job;