diff include/mb_types.h @ 241:104d83378582

Add scene support in svg2code.py. - Add mb_sprite_t::goto_scene() - svg2code.py recoganize "scenes" tag in metadata of SVG file. - tranform scenes into SCENE() macro. - define SCENE macro in mb_c_*.m4
author Thinker K.F. Li <thinker@branda.to>
date Wed, 31 Dec 2008 02:08:40 +0800
parents 65cabbdd5284
children bd8ea44b421e
line wrap: on
line diff
--- a/include/mb_types.h	Tue Dec 30 09:21:23 2008 +0800
+++ b/include/mb_types.h	Wed Dec 31 02:08:40 2008 +0800
@@ -280,11 +280,16 @@
 struct _mb_sprite {
     void (*free)(mb_sprite_t *);
     mb_obj_t *(*get_obj_with_name)(mb_sprite_t *sprite, const char *id);
+    /*! Return non-zero for error. */
+    int (*goto_scene)(mb_sprite_t *sprite, int scene_no);
 };
 
 #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))
+#define MB_SPRITE_GET_OBJ(sprite, name)					\
+    ((mb_sprite_t *)(sprite))->get_obj_with_name((mb_sprite_t *)(sprite), \
+						 (name))
+#define MB_SPRITE_GOTO_SCENE(sprite, scene_no)				\
+    ((mb_sprite_t *)(sprite))->goto_scene((mb_sprite_t *)(sprite), scene_no)
 
 
 /*! \defgroup mb_sprite_lsym Sprite with linear symbol table.