X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmaterials%2Flighting.cpp;h=699aabc02c7daa8679d60b2ab6fd8eaf8d99723b;hp=3bbc01a3fa8e4bd4d51fd0fafc924b95651b492d;hb=3ac3a51c623271da815c8ee60c484445871753bf;hpb=885b8ad08cfcefba4b95ec9028fa1e25df2fe171 diff --git a/source/materials/lighting.cpp b/source/materials/lighting.cpp index 3bbc01a3..699aabc0 100644 --- a/source/materials/lighting.cpp +++ b/source/materials/lighting.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "error.h" #include "light.h" #include "lighting.h" @@ -21,12 +22,6 @@ Lighting::Lighting(): set_fog_density(0.0f); } -Lighting::~Lighting() -{ - for(vector::iterator i=owned_data.begin(); i!=owned_data.end(); ++i) - delete *i; -} - void Lighting::set_ambient(const Color &a) { ambient = a; @@ -200,8 +195,8 @@ void Lighting::Loader::light_inline() { RefPtr lgt = new Light; load_sub(*lgt); - obj.attach(*lgt); - obj.owned_data.push_back(lgt.release()); + get_collection().add(format("%s/%d.light", FS::basename(get_source()), obj.lights.size()), lgt.get()); + obj.attach(*lgt.release()); } void Lighting::Loader::light_inline_index(unsigned)