X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmaterials%2Flighting.cpp;h=3057d20d77baaccd1e00804ad37521868ff5c342;hp=c1b2e2aaf0a02619fb17f9a1e06f456bc27fdd1a;hb=adc26a2e141a2853b6c5025130c46a46cece4b84;hpb=e6e6f0fe81a2f92985e65ae0de708974194d81a3 diff --git a/source/materials/lighting.cpp b/source/materials/lighting.cpp index c1b2e2aa..3057d20d 100644 --- a/source/materials/lighting.cpp +++ b/source/materials/lighting.cpp @@ -23,7 +23,7 @@ Lighting::Lighting() string base = format("light_sources[%d]", i); shdata.uniform(base+".position", Vector4(0, 0, 1, 0)); shdata.uniform(base+".color", 0.0f, 0.0f, 0.0f); - shdata.uniform(base+".enabled", 0); + shdata.uniform(base+".type", 0); } } @@ -142,8 +142,9 @@ void Lighting::Loader::light(const string &name) void Lighting::Loader::light_inline() { - RefPtr lgt = new Light; - load_sub(*lgt); + Light::GenericLoader ldr(get_collection()); + load_sub_with(ldr); + RefPtr lgt = ldr.get_object(); get_collection().add(format("%s/%d.light", FS::basename(get_source()), obj.lights.size()), lgt.get()); obj.attach(*lgt.release()); }