Mercurial > MadButterfly
annotate include/mb_so.h @ 1072:cf82361fe5b9 openvg
Disable _fill_and_check() for collision detection
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Wed, 01 Dec 2010 19:59:58 +0800 |
parents | 586e50f82c1f |
children |
rev | line source |
---|---|
822
586e50f82c1f
Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents:
209
diff
changeset
|
1 // -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 4; -*- |
586e50f82c1f
Unify coding style tag for emacs and vim.
Shih-Yuan Lee (FourDollars) <fourdollars@gmail.com>
parents:
209
diff
changeset
|
2 // vim: sw=4:ts=8:sts=4 |
209
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
3 /*! \file |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
4 * \brief Define types for sprite shared objects. |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
5 * |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
6 * A sprite shared object includes definitions of multiple sprite factories. |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
7 * Sprite factories are used to create sprites for MadButterfly. |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
8 * |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
9 * \see http://en.wikipedia.org/wiki/Sprite_(computer_graphics) |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
10 */ |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
11 #ifndef __MB_SO_H_ |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
12 #define __MB_SO_H_ |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
13 |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
14 /*! \brief Name of the variable that define contents in a shared object. */ |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
15 #define MB_SPRITE_SO_SYM "mb_sprite_so_def" |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
16 |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
17 typedef struct _mb_sprite_so mb_sprite_so_t; |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
18 typedef struct _sprite_factory sprite_factory_t; |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
19 |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
20 |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
21 /*! \brief Define content of a sprite shared object. |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
22 * |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
23 * The type of symbol with name, defined by \ref MB_SPRITE_SO_SYM, in |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
24 * a sprite shared object. It define content of a sprite object, a.k.a. |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
25 * an array of sprite factories (\ref sprite_factory_t). |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
26 */ |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
27 struct _mb_sprite_so { |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
28 const char *soname; |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
29 int num_factories; |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
30 sprite_factory_t *factories; |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
31 }; |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
32 |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
33 /*! \brief Define a factory to create sprites. |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
34 */ |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
35 struct _sprite_factory { |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
36 const char *name; |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
37 sprite_t *(*new)(coord_t*); |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
38 }; |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
39 |
6f63aa67ed83
Define types for sprite shared object.
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
40 #endif /* __MB_SO_H_ */ |