Mercurial > MadButterfly
comparison 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 |
comparison
equal
deleted
inserted
replaced
240:d347a577a232 | 241:104d83378582 |
---|---|
278 * sprite. | 278 * sprite. |
279 */ | 279 */ |
280 struct _mb_sprite { | 280 struct _mb_sprite { |
281 void (*free)(mb_sprite_t *); | 281 void (*free)(mb_sprite_t *); |
282 mb_obj_t *(*get_obj_with_name)(mb_sprite_t *sprite, const char *id); | 282 mb_obj_t *(*get_obj_with_name)(mb_sprite_t *sprite, const char *id); |
283 /*! Return non-zero for error. */ | |
284 int (*goto_scene)(mb_sprite_t *sprite, int scene_no); | |
283 }; | 285 }; |
284 | 286 |
285 #define MB_SPRITE_FREE(sprite) ((mb_sprite_t *)(sprite))->free(sprite) | 287 #define MB_SPRITE_FREE(sprite) ((mb_sprite_t *)(sprite))->free(sprite) |
286 #define MB_SPRITE_GET_OBJ(sprite, name) \ | 288 #define MB_SPRITE_GET_OBJ(sprite, name) \ |
287 ((mb_sprite_t *)(sprite))->get_obj_with_name((sprite), (name)) | 289 ((mb_sprite_t *)(sprite))->get_obj_with_name((mb_sprite_t *)(sprite), \ |
290 (name)) | |
291 #define MB_SPRITE_GOTO_SCENE(sprite, scene_no) \ | |
292 ((mb_sprite_t *)(sprite))->goto_scene((mb_sprite_t *)(sprite), scene_no) | |
288 | 293 |
289 | 294 |
290 /*! \defgroup mb_sprite_lsym Sprite with linear symbol table. | 295 /*! \defgroup mb_sprite_lsym Sprite with linear symbol table. |
291 * @{ | 296 * @{ |
292 */ | 297 */ |