… | |
… | |
172 | #define ARG_CLIENT(o) DT_CLIENT, (void *)(static_cast<client *> (o)) |
172 | #define ARG_CLIENT(o) DT_CLIENT, (void *)(static_cast<client *> (o)) |
173 | #define ARG_PARTY(o) DT_PARTY , (void *)(static_cast<party *> (o)) |
173 | #define ARG_PARTY(o) DT_PARTY , (void *)(static_cast<party *> (o)) |
174 | #define ARG_REGION(o) DT_REGION, (void *)(static_cast<region *> (o)) |
174 | #define ARG_REGION(o) DT_REGION, (void *)(static_cast<region *> (o)) |
175 | |
175 | |
176 | // the ", ## __VA_ARGS" is, unfortunately, a gnu-cpp extension |
176 | // the ", ## __VA_ARGS" is, unfortunately, a gnu-cpp extension |
177 | #define INVOKE(obj,event, ...) (expect_false ((obj)->should_invoke (event)) ? (obj)->invoke (event, ## __VA_ARGS__, DT_END) : 0) |
177 | #define INVOKE(obj,event, ...) (ecb_expect_false ((obj)->should_invoke (event)) ? (obj)->invoke (event, ## __VA_ARGS__, DT_END) : 0) |
178 | #define INVOKE_GLOBAL(event, ...) INVOKE (&gbl_ev, EVENT_ ## GLOBAL ## _ ## event, ## __VA_ARGS__) |
178 | #define INVOKE_GLOBAL(event, ...) INVOKE (&gbl_ev, EVENT_ ## GLOBAL ## _ ## event, ## __VA_ARGS__) |
179 | #define INVOKE_ATTACHABLE(event, obj, ...) INVOKE (obj , EVENT_ ## ATTACHABLE ## _ ## event, ## __VA_ARGS__) |
179 | #define INVOKE_ATTACHABLE(event, obj, ...) INVOKE (obj , EVENT_ ## ATTACHABLE ## _ ## event, ## __VA_ARGS__) |
180 | #define INVOKE_OBJECT(event, obj, ...) INVOKE (obj , EVENT_ ## OBJECT ## _ ## event, ## __VA_ARGS__) |
180 | #define INVOKE_OBJECT(event, obj, ...) INVOKE (obj , EVENT_ ## OBJECT ## _ ## event, ## __VA_ARGS__) |
181 | #define INVOKE_CLIENT(event, obj, ...) INVOKE (obj , EVENT_ ## CLIENT ## _ ## event, ## __VA_ARGS__) |
181 | #define INVOKE_CLIENT(event, obj, ...) INVOKE (obj , EVENT_ ## CLIENT ## _ ## event, ## __VA_ARGS__) |
182 | #define INVOKE_PLAYER(event, obj, ...) INVOKE (obj , EVENT_ ## PLAYER ## _ ## event, ## __VA_ARGS__) |
182 | #define INVOKE_PLAYER(event, obj, ...) INVOKE (obj , EVENT_ ## PLAYER ## _ ## event, ## __VA_ARGS__) |
… | |
… | |
207 | MTH static void check_mortals (); |
207 | MTH static void check_mortals (); |
208 | |
208 | |
209 | // object is delete'd after the refcount reaches 0 |
209 | // object is delete'd after the refcount reaches 0 |
210 | MTH int refcnt_cnt () const; |
210 | MTH int refcnt_cnt () const; |
211 | // check wether the object has died and destroy |
211 | // check wether the object has died and destroy |
212 | MTH void refcnt_chk () { if (expect_false (refcnt <= 0)) do_check (); } |
212 | MTH void refcnt_chk () { if (ecb_expect_false (refcnt <= 0)) do_check (); } |
213 | |
213 | |
214 | // destroy the object unless it was already destroyed |
214 | // destroy the object unless it was already destroyed |
215 | // this politely asks everybody interested the reduce |
215 | // this politely asks everybody interested the reduce |
216 | // the refcount to 0 as soon as possible. |
216 | // the refcount to 0 as soon as possible. |
217 | MTH void destroy (); |
217 | MTH void destroy (); |
… | |
… | |
309 | static void do_cede_to_tick (); |
309 | static void do_cede_to_tick (); |
310 | |
310 | |
311 | // actually cede's far more often |
311 | // actually cede's far more often |
312 | static bool cede_to_tick () |
312 | static bool cede_to_tick () |
313 | { |
313 | { |
314 | if (expect_true (!cede_pending)) |
314 | if (ecb_expect_true (!cede_pending)) |
315 | return false; |
315 | return false; |
316 | |
316 | |
317 | do_cede_to_tick (); |
317 | do_cede_to_tick (); |
318 | return true; |
318 | return true; |
319 | } |
319 | } |