Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/material.h')
-rw-r--r--src/model/material.h44
1 files changed, 38 insertions, 6 deletions
diff --git a/src/model/material.h b/src/model/material.h
index 6c332e2..94b4418 100644
--- a/src/model/material.h
+++ b/src/model/material.h
@@ -27,7 +27,7 @@ public:
enum ColorType {ColorMaterial = 0, ColorPrimary = 1, ColorSecondary = 2, ColorTertiary = 3, ColorEngine = 4 };
/// surface flags
- enum SurfaceFlags { FlagNone = 0, FlagBright = 1,FlagEnvironment = 2, FlagTexture = 4, FlagIgnore = 8, FlagClip = 16, FlagOrigin = 32, FlagDecal = 64 };
+ enum SurfaceFlags { FlagNone = 0, FlagBright = 1,FlagEnvironment = 2, FlagTexture = 4, FlagIgnore = 8, FlagClip = 16, FlagOrigin = 32, FlagDecal = 64, FlagBounds = 128 };
/// type definition for the material registry
typedef std::map<std::string, Material *> Registry;
@@ -78,24 +78,48 @@ public:
/**
* @brief returns true if the material has the requested flag set
* */
- inline bool flag_is_set(const SurfaceFlags surfaceflag) const {
+ inline bool has_flag(const SurfaceFlags surfaceflag) const {
return (((int) material_flags & surfaceflag) == surfaceflag);
}
/**
+ * @brief returns true if the material has the Texture flag set
+ * @see flags()
+ * */
+ inline bool has_flag_texture() const {
+ return (has_flag(FlagTexture));
+ }
+
+ /**
+ * @brief returns true if the material has the Clip flag set
+ * @see flags()
+ * */
+ inline bool has_flag_clip() const {
+ return (has_flag(FlagClip));
+ }
+
+ /**
* @brief returns true if the material has the Ignore flag set
* @see flags()
* */
- inline bool ignore_is_set() const {
- return (flag_is_set(FlagIgnore));
+ inline bool has_flag_ignore() const {
+ return (has_flag(FlagIgnore));
+ }
+
+ /**
+ * @brief returns true if the material has the Origin flag set
+ * @see flags()
+ * */
+ inline bool has_flag_origin() const {
+ return (has_flag(FlagOrigin));
}
/**
* @brief returns true if the material has the Origin flag set
* @see flags()
* */
- inline bool origin_is_set() const {
- return (flag_is_set(FlagOrigin));
+ inline bool has_flag_bounds() const {
+ return (has_flag(FlagBounds));
}
/* ---- mutators ------------------------------------------- */
@@ -130,10 +154,18 @@ public:
void set_colortype(ColorType colortype);
+ /**
+ * @brief set a specified surface flag
+ * @see flags()
+ * */
inline void set_flags(SurfaceFlags flags) {
material_flags |= flags;
}
+ /**
+ * @brief clear a specified surface flag
+ * @see flags()
+ * */
inline void unset_flags(SurfaceFlags flags) {
material_flags &= ~flags;
}