comparison include/mb_so.h @ 209:6f63aa67ed83

Define types for sprite shared object.
author Thinker K.F. Li <thinker@branda.to>
date Wed, 10 Dec 2008 17:15:26 +0800
parents
children 586e50f82c1f
comparison
equal deleted inserted replaced
208:e01acb80f0e7 209:6f63aa67ed83
1 /*! \file
2 * \brief Define types for sprite shared objects.
3 *
4 * A sprite shared object includes definitions of multiple sprite factories.
5 * Sprite factories are used to create sprites for MadButterfly.
6 *
7 * \see http://en.wikipedia.org/wiki/Sprite_(computer_graphics)
8 */
9 #ifndef __MB_SO_H_
10 #define __MB_SO_H_
11
12 /*! \brief Name of the variable that define contents in a shared object. */
13 #define MB_SPRITE_SO_SYM "mb_sprite_so_def"
14
15 typedef struct _mb_sprite_so mb_sprite_so_t;
16 typedef struct _sprite_factory sprite_factory_t;
17
18
19 /*! \brief Define content of a sprite shared object.
20 *
21 * The type of symbol with name, defined by \ref MB_SPRITE_SO_SYM, in
22 * a sprite shared object. It define content of a sprite object, a.k.a.
23 * an array of sprite factories (\ref sprite_factory_t).
24 */
25 struct _mb_sprite_so {
26 const char *soname;
27 int num_factories;
28 sprite_factory_t *factories;
29 };
30
31 /*! \brief Define a factory to create sprites.
32 */
33 struct _sprite_factory {
34 const char *name;
35 sprite_t *(*new)(coord_t*);
36 };
37
38 #endif /* __MB_SO_H_ */