From f65bb3d92340c1508fe37eeac849f60d6ab1399c Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 21 Feb 2021 23:29:37 +0200 Subject: [PATCH] Support addint datafile statements for uniform material properties --- source/materials/material.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 -- 2.45.2