Mercurial > MadButterfly
comparison include/mb_types.h @ 257:50d253d0fcba
Simple image loader and image shape.
- img_ldr.c is a simple image loader that rooted on a directory
specified when a loader instance been created.
- sh_image_t is corresponding shape of image tag in SVG.
- This changeset is still buggy. It need more testing.
- svg2code.py is not ready for image tag.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Thu, 15 Jan 2009 16:46:47 +0800 |
parents | bd8ea44b421e |
children | 29acbd8a0dd0 |
comparison
equal
deleted
inserted
replaced
256:cac9ad3df633 | 257:50d253d0fcba |
---|---|
38 enum { MBO_DUMMY, | 38 enum { MBO_DUMMY, |
39 MBO_COORD, | 39 MBO_COORD, |
40 MBO_SHAPES=0x1000, /*! \note Don't touch this. */ | 40 MBO_SHAPES=0x1000, /*! \note Don't touch this. */ |
41 MBO_PATH, | 41 MBO_PATH, |
42 MBO_TEXT, | 42 MBO_TEXT, |
43 MBO_RECT | 43 MBO_RECT, |
44 MBO_IMAGE | |
44 }; | 45 }; |
45 #define MBO_CLASS_MASK 0xf000 | 46 #define MBO_CLASS_MASK 0xf000 |
46 #define MBO_CLASS(x) (((mb_obj_t *)(x))->obj_type & MBO_CLASS_MASK) | 47 #define MBO_CLASS(x) (((mb_obj_t *)(x))->obj_type & MBO_CLASS_MASK) |
47 /*! \brief Return type of a MadBufferly object. */ | 48 /*! \brief Return type of a MadBufferly object. */ |
48 #define MBO_TYPE(x) (((mb_obj_t *)(x))->obj_type) | 49 #define MBO_TYPE(x) (((mb_obj_t *)(x))->obj_type) |
195 do { \ | 196 do { \ |
196 (co)->flags |= COF_HIDDEN; \ | 197 (co)->flags |= COF_HIDDEN; \ |
197 } while(0) | 198 } while(0) |
198 #define coord_show(co) do { co->flags &= ~COF_HIDDEN; } while(0) | 199 #define coord_show(co) do { co->flags &= ~COF_HIDDEN; } while(0) |
199 #define coord_get_mouse_event(coord) ((coord)->mouse_event) | 200 #define coord_get_mouse_event(coord) ((coord)->mouse_event) |
201 #define coord_get_aggr_matrix(coord) ((coord)->aggr_matrix) | |
200 #define FOR_COORDS_POSTORDER(coord, cur) \ | 202 #define FOR_COORDS_POSTORDER(coord, cur) \ |
201 for((cur) = postorder_coord_subtree((coord), NULL); \ | 203 for((cur) = postorder_coord_subtree((coord), NULL); \ |
202 (cur) != NULL; \ | 204 (cur) != NULL; \ |
203 (cur) = postorder_coord_subtree((coord), (cur))) | 205 (cur) = postorder_coord_subtree((coord), (cur))) |
204 #define FOR_COORDS_PREORDER(coord, cur) \ | 206 #define FOR_COORDS_PREORDER(coord, cur) \ |
268 #define sh_get_flags(sh, mask) geo_get_flags(sh_get_geo(sh), mask) | 270 #define sh_get_flags(sh, mask) geo_get_flags(sh_get_geo(sh), mask) |
269 #define sh_set_flags(sh, mask) geo_set_flags(sh_get_geo(sh), mask) | 271 #define sh_set_flags(sh, mask) geo_set_flags(sh_get_geo(sh), mask) |
270 #define sh_clear_flags(sh, mask) geo_clear_flags(sh_get_geo(sh), mask) | 272 #define sh_clear_flags(sh, mask) geo_clear_flags(sh_get_geo(sh), mask) |
271 #define sh_pos_is_in(sh, x, y) geo_pos_is_in(sh_get_geo(sh), x, y) | 273 #define sh_pos_is_in(sh, x, y) geo_pos_is_in(sh_get_geo(sh), x, y) |
272 #define sh_get_area(sh) geo_get_area(sh_get_geo(sh)) | 274 #define sh_get_area(sh) geo_get_area(sh_get_geo(sh)) |
275 #define sh_get_coord(sh) ((sh)->coord) | |
273 | 276 |
274 | 277 |
275 /*! \brief A sprite is a set of graphics that being an object in animation. | 278 /*! \brief A sprite is a set of graphics that being an object in animation. |
276 * | 279 * |
277 * A sprite include graphics comprise an object. For example, a tank, in | 280 * A sprite include graphics comprise an object. For example, a tank, in |