2 #include <msp/strings/format.h>
3 #include "directionallight.h"
5 #include "pointlight.h"
12 void Light::set_color(const Color &c)
18 void Light::update_shader_data(ProgramData &shdata, unsigned i) const
20 update_shader_data(shdata, format("light_sources[%d]", i));
23 Light::GenericLoader::TypeRegistry &Light::get_light_registry()
25 static GenericLoader::TypeRegistry registry;
26 static bool initialized = false;
30 registry.register_type<DirectionalLight>("directional");
31 registry.register_type<PointLight>("point");
37 Light::Loader::Loader(Light &l):
38 DataFile::ObjectLoader<Light>(l)
41 void Light::Loader::init_actions()
43 add("color", &Loader::color);
46 void Light::Loader::color(float r, float g, float b)
48 obj.set_color(Color(r, g, b));