aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJacek Antonelli2008-12-07 22:51:21 -0600
committerJacek Antonelli2008-12-08 00:42:34 -0600
commitfe551e94a8778935bfffa8e730a76e3ff09ce276 (patch)
tree96f1f3ca6426d805d2c29c71848a46c5c409d5eb
parentMerge RC2 into quickfilter (diff)
downloadmeta-impy-fe551e94a8778935bfffa8e730a76e3ff09ce276.zip
meta-impy-fe551e94a8778935bfffa8e730a76e3ff09ce276.tar.gz
meta-impy-fe551e94a8778935bfffa8e730a76e3ff09ce276.tar.bz2
meta-impy-fe551e94a8778935bfffa8e730a76e3ff09ce276.tar.xz
New enumerator for inventory types.
-rw-r--r--ChangeLog.txt6
-rw-r--r--linden/indra/llinventory/llinventorytype.h86
2 files changed, 92 insertions, 0 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 74ffa27..f718125 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,9 @@
12008-12-07 Jacek Antonelli <jacek.antonelli@gmail.com>
2
3 * linden/indra/llinventory/llinventorytype.h:
4 New bitfield enumerator for inventory types.
5
6
12008-12-06 Jacek Antonelli <jacek.antonelli@gmail.com> 72008-12-06 Jacek Antonelli <jacek.antonelli@gmail.com>
2 8
3 * ChangeLog: 9 * ChangeLog:
diff --git a/linden/indra/llinventory/llinventorytype.h b/linden/indra/llinventory/llinventorytype.h
index 00a4d28..f228cd0 100644
--- a/linden/indra/llinventory/llinventorytype.h
+++ b/linden/indra/llinventory/llinventorytype.h
@@ -71,6 +71,92 @@ public:
71 IT_NONE = -1 71 IT_NONE = -1
72 }; 72 };
73 73
74
75 /**
76 * @brief New enumerator for inventory types
77 *
78 * This is intended as a replacement to the above EType.
79 * EType will be phased out in favor of this enum.
80 *
81 * This enum acts as a bitfield, which This has several
82 * useful properties for filtering:
83 *
84 * 1. The inventory item's type can be compared by either
85 * equality or bitwise AND. Bitwise AND allows a quick
86 * check to see whether the type is one of multiple
87 * possible types.
88 *
89 * 2. It allows for a fast hierarchical organization, by
90 * defining a broad type (e.g. NIT_BODYPART) whose
91 * value is the bitwise OR-ing of several more specific
92 * sub-types (e.g. NIT_SKIN|NIT_HAIR|...).
93 *
94 */
95 enum NType
96 {
97 /* No Type */
98 NIT_NONE = 0x0000000,
99
100 /* Body Parts */
101 NIT_SHAPE = 1 << 0,
102 NIT_SKIN = 1 << 1,
103 NIT_HAIR = 1 << 2,
104 NIT_EYES = 1 << 3,
105 NIT_BODYPART = 0x000000f,
106
107 /* Clothing */
108 NIT_SHIRT = 1 << 4,
109 NIT_PANTS = 1 << 5,
110 NIT_SHOES = 1 << 6,
111 NIT_SOCKS = 1 << 7,
112 NIT_JACKET = 1 << 8,
113 NIT_GLOVES = 1 << 9,
114 NIT_UNDERSHIRT = 1 << 10,
115 NIT_UNDERPANTS = 1 << 11,
116 NIT_SKIRT = 1 << 12,
117 NIT_CLOTHING = 0x0001ff0,
118
119 /* Body Parts | Clothing */
120 NIT_WEARABLE = 0x0001fff,
121
122 /* Images */
123 NIT_TEXTURE = 1 << 13,
124 NIT_SNAPSHOT = 1 << 14,
125 NIT_IMAGE = 0x0006000,
126
127 /* Calling Cards */
128 NIT_CALLCARD_OFF = 1 << 15,
129 NIT_CALLCARD_ON = 1 << 16,
130 NIT_CALLCARD = 0x0018000,
131
132 /* Landmarks */
133 NIT_LANDMARK_UNUSED = 1 << 17,
134 NIT_LANDMARK_USED = 1 << 18,
135 NIT_LANDMARK = 0x0060000,
136
137 /* Sounds */
138 NIT_SOUND = 1 << 19,
139
140 /* Animations */
141 NIT_ANIMATION = 1 << 20,
142
143 /* Gestures */
144 NIT_GESTURE = 1 << 21,
145
146 /* Notecards */
147 NIT_NOTECARD = 1 << 22,
148
149 /* Scripts */
150 NIT_SCRIPT_LSL2 = 1 << 23,
151
152 /* Objects */
153 NIT_OBJECT = 1 << 24,
154
155 /* Bitwise OR-ing of all the above */
156 NIT_ALL = 0x1ffffff,
157 };
158
159
74 // machine transation between type and strings 160 // machine transation between type and strings
75 static EType lookup(const std::string& name); 161 static EType lookup(const std::string& name);
76 static const char* lookup(EType type); 162 static const char* lookup(EType type);