@@ -108,6 +108,9 @@ enum Rotation {
108
108
#define LEVELED_MASK 0x3F
109
109
#define LEVELED_MAX LEVELED_MASK
110
110
111
+
112
+ struct ContentFeatures ;
113
+
111
114
/*
112
115
This is the stuff what the whole world consists of.
113
116
*/
@@ -188,6 +191,24 @@ struct MapNode
188
191
189
192
void setLight (enum LightBank bank, u8 a_light, INodeDefManager *nodemgr);
190
193
u8 getLight (enum LightBank bank, INodeDefManager *nodemgr) const ;
194
+
195
+ /* *
196
+ * This function differs from getLight(enum LightBank bank, INodeDefManager *nodemgr)
197
+ * in that the ContentFeatures of the node in question are not retrieved by
198
+ * the function itself. Thus, if you have already called nodemgr->get() to
199
+ * get the ContentFeatures you pass it to this function instead of the
200
+ * function getting ContentFeatures itself. Since INodeDefManager::get()
201
+ * is relatively expensive this can lead to significant performance
202
+ * improvements in some situations. Call this function if (and only if)
203
+ * you have already retrieved the ContentFeatures by calling
204
+ * INodeDefManager::get() for the node you're working with and the
205
+ * pre-conditions listed are true.
206
+ *
207
+ * @pre f != NULL
208
+ * @pre f->param_type == CPT_LIGHT
209
+ */
210
+ u8 getLightNoChecks (LightBank bank, const ContentFeatures *f);
211
+
191
212
bool getLightBanks (u8 &lightday, u8 &lightnight, INodeDefManager *nodemgr) const ;
192
213
193
214
// 0 <= daylight_factor <= 1000
0 commit comments