diff options
author | Stijn Buys <ingar@osirion.org> | 2011-10-22 10:42:01 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2011-10-22 10:42:01 +0000 |
commit | 01b98a40b9c6d8ace96538342ccdd6ac46fbbbe7 (patch) | |
tree | 56cec894282f9c06a916753f258a330cbb3d1d6b /src/model/material.h | |
parent | 04ea97c5057f65c6e276c6c8b71f7c2ba32bab53 (diff) |
Initial support for the Material::Origin surface flag
Diffstat (limited to 'src/model/material.h')
-rw-r--r-- | src/model/material.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/model/material.h b/src/model/material.h index 9b54dcc..885831c 100644 --- a/src/model/material.h +++ b/src/model/material.h @@ -24,7 +24,7 @@ public: typedef void(* LoaderFuncPtr)(Material *); /// surface flags - enum SurfaceFlags { None = 0, Primary = 1, Secondary = 2, Tertiary = 3, Bright = 4, Engine = 8, Environment = 16, Texture = 32, Ignore = 64, Clip = 128}; + enum SurfaceFlags { None = 0, Primary = 1, Secondary = 2, Tertiary = 3, Bright = 4, Engine = 8, Environment = 16, Texture = 32, Ignore = 64, Clip = 128, Origin = 256}; /// type definition for the material registry typedef std::map<std::string, Material *> Registry; @@ -64,10 +64,32 @@ public: return material_size; } + /** + * @brief returns true if the material has the requested flag set + * */ + inline bool flag_is_set(const SurfaceFlags surfaceflag) const { + return ((material_flags & surfaceflag) == surfaceflag); + } + + /** + * @brief returns true if the material has the Ignore flag set + * @see flags() + * */ + inline bool ignore_is_set() const { + return (flag_is_set(Ignore)); + } + + /** + * @brief returns true if the material has the Origin flag set + * @see flags() + * */ + inline bool origin_is_set() const { + return (flag_is_set(Origin)); + } + /* ---- mutators ------------------------------------------- */ void set_color(const math::Color &color); - /** * @brief set the material texture name */ |