changeset 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 5f144bab5de1
files include/mb_types.h
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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.
  * @{