goat3d

diff src/material.h @ 9:04bb114fcf05

implementing Scene::save, lots to do still
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 23 Aug 2013 06:36:47 +0300
parents cd71f0b92f44
children f1b4c27382ce
line diff
     1.1 --- a/src/material.h	Wed Aug 21 05:52:28 2013 +0300
     1.2 +++ b/src/material.h	Fri Aug 23 06:36:47 2013 +0300
     1.3 @@ -28,19 +28,14 @@
     1.4  public:
     1.5  	std::string name;
     1.6  
     1.7 -	MaterialAttrib &operator [](const std::string &name)
     1.8 -	{
     1.9 -		return attrib[name];
    1.10 -	}
    1.11 +	int get_attrib_count() const;
    1.12 +	const char *get_attrib_name(int idx) const;
    1.13  
    1.14 -	const MaterialAttrib &operator [](const std::string &name) const
    1.15 -	{
    1.16 -		std::map<std::string, MaterialAttrib>::const_iterator it;
    1.17 -		if((it = attrib.find(name)) != attrib.end()) {
    1.18 -			return it->second;
    1.19 -		}
    1.20 -		return def_attr;
    1.21 -	}
    1.22 +	MaterialAttrib &operator [](int idx);
    1.23 +	const MaterialAttrib &operator [](int idx) const;
    1.24 +
    1.25 +	MaterialAttrib &operator [](const std::string &name);
    1.26 +	const MaterialAttrib &operator [](const std::string &name) const;
    1.27  };
    1.28  
    1.29  #endif	// MATERIAL_H_