|
|
@@ -8,6 +8,7 @@
|
|
|
|
|
|
#include "game/graphics/manager.hpp"
|
|
|
|
|
|
+#include "game/graphics/exception.h"
|
|
|
#include "game/graphics/material.hpp"
|
|
|
#include "game/graphics/object.hpp"
|
|
|
#include "game/graphics/shader.hpp"
|
|
|
@@ -63,7 +64,7 @@ materials::uniform uniform_id(std::string const & uniform) {
|
|
|
} else if (uniform == "u_diffuseMap") {
|
|
|
return materials::uniform::DIFFUSE;
|
|
|
}
|
|
|
- throw;
|
|
|
+ throw unmapped_enum<materials::uniform>(uniform);
|
|
|
}
|
|
|
|
|
|
identity<material> manager::get(identity<shader_program> program,
|
|
|
@@ -154,7 +155,5 @@ manager::texture_or_uniform(std::string const & path,
|
|
|
prepare_uniforms();
|
|
|
// The uniform is primed into the cache already.
|
|
|
auto & cache = pcache_->textures;
|
|
|
- auto found = cache.values.find(uniform);
|
|
|
- if (found != cache.values.end()) { return found->second; }
|
|
|
- throw;
|
|
|
+ return cache.values.find(uniform)->second;
|
|
|
}
|