]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix loading of inline materials and lights
authorMikko Rasa <tdb@tdb.fi>
Wed, 6 Oct 2021 21:04:37 +0000 (00:04 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 6 Oct 2021 21:13:22 +0000 (00:13 +0300)
source/materials/lighting.cpp
source/materials/rendermethod.cpp

index 3057d20d77baaccd1e00804ad37521868ff5c342..f6bb39ffce98ecd701b901c223bf1244e415a9ae 100644 (file)
@@ -144,9 +144,8 @@ void Lighting::Loader::light_inline()
 {
        Light::GenericLoader ldr(get_collection());
        load_sub_with(ldr);
-       RefPtr<Light> lgt = ldr.get_object();
-       get_collection().add(format("%s/%d.light", FS::basename(get_source()), obj.lights.size()), lgt.get());
-       obj.attach(*lgt.release());
+       Light *lgt = ldr.store_object(get_collection(), format("%s/%d.light", FS::basename(get_source()), obj.lights.size()));
+       obj.attach(*lgt);
 }
 
 } // namespace GL
index 35c24c1f080cb3e23fc9908d0d11fcc98852900e..053197589ab1fe6e9d3c83c78261ffc3e27ebc0e 100644 (file)
@@ -160,9 +160,7 @@ void RenderMethod::Loader::material_inline()
 {
        Material::GenericLoader ldr(get_collection());
        load_sub_with(ldr);
-       RefPtr<Material> mat = ldr.get_object();
-       get_collection().add(inline_base_name+".mat", mat.get());
-       obj.material = mat.release();
+       obj.material = ldr.store_object(get_collection(), inline_base_name+".mat");
        obj.set_material_textures();
 }