From: Mikko Rasa Date: Sun, 21 Feb 2021 21:29:37 +0000 (+0200) Subject: Support addint datafile statements for uniform material properties X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=f65bb3d92340c1508fe37eeac849f60d6ab1399c;p=libs%2Fgl.git Support addint datafile statements for uniform material properties --- diff --git a/source/materials/material.h b/source/materials/material.h index 571f4cb0..350372dd 100644 --- a/source/materials/material.h +++ b/source/materials/material.h @@ -127,7 +127,8 @@ template void Material::PropertyLoader::add_property(const std::string &kw, void (C::*set_value)(float), void (C::*set_texture)(const Texture *)) { add(kw, &PropertyLoader::property_value_scalar, set_value); - add(kw+"_map", &PropertyLoader::property_texture, set_texture); + if(set_texture) + add(kw+"_map", &PropertyLoader::property_texture, set_texture); } template @@ -140,7 +141,8 @@ void Material::PropertyLoader::add_property(const std::string &kw, void (C::* add(kw, &PropertyLoader::property_value_rgba, set_value); add(kw+"_srgb", &PropertyLoader::property_value_srgb_alpha, set_value); } - add(kw+"_map", &PropertyLoader::property_texture, set_texture); + if(set_texture) + add(kw+"_map", &PropertyLoader::property_texture, set_texture); } template