# HG changeset patch # User Thinker K.F. Li # Date 1229013697 -28800 # Node ID 41eab0a10651727b267fc29b661a2678f5fab639 # Parent 3fadd2f2742e6dc3f07fb7b0da499b6d1d461e64 Define convenience macros for sprite. diff -r 3fadd2f2742e -r 41eab0a10651 include/mb_types.h --- a/include/mb_types.h Fri Dec 12 00:33:54 2008 +0800 +++ b/include/mb_types.h Fri Dec 12 00:41:37 2008 +0800 @@ -224,6 +224,10 @@ mb_obj_t *(*get_obj_with_name)(mb_sprite_t *sprite, const char *id); }; +#define MB_SPRITE_FREE(sprite) ((mb_sprite_t *)(sprite))->free(sprite) +#define MB_SPRITE_GET_OBJ(sprite, name) \ + ((mb_sprite_t *)(sprite))->get_obj_with_name((sprite), (name)) + /*! \defgroup mb_sprite_lsym Sprite with linear symbol table. * @{