From 01b98a40b9c6d8ace96538342ccdd6ac46fbbbe7 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 22 Oct 2011 10:42:01 +0000 Subject: Initial support for the Material::Origin surface flag --- src/model/material.h | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src/model/material.h') 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 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 */ -- cgit v1.2.3