comparison include/mb_types.h @ 211:41eab0a10651

Define convenience macros for sprite.
author Thinker K.F. Li <thinker@branda.to>
date Fri, 12 Dec 2008 00:41:37 +0800
parents 3fadd2f2742e
children f7057177abbb
comparison
equal deleted inserted replaced
210:3fadd2f2742e 211:41eab0a10651
222 struct _mb_sprite { 222 struct _mb_sprite {
223 void (*free)(mb_sprite_t *); 223 void (*free)(mb_sprite_t *);
224 mb_obj_t *(*get_obj_with_name)(mb_sprite_t *sprite, const char *id); 224 mb_obj_t *(*get_obj_with_name)(mb_sprite_t *sprite, const char *id);
225 }; 225 };
226 226
227 #define MB_SPRITE_FREE(sprite) ((mb_sprite_t *)(sprite))->free(sprite)
228 #define MB_SPRITE_GET_OBJ(sprite, name) \
229 ((mb_sprite_t *)(sprite))->get_obj_with_name((sprite), (name))
230
227 231
228 /*! \defgroup mb_sprite_lsym Sprite with linear symbol table. 232 /*! \defgroup mb_sprite_lsym Sprite with linear symbol table.
229 * @{ 233 * @{
230 */ 234 */
231 struct _mb_sprite_lsym_entry { 235 struct _mb_sprite_lsym_entry {