diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-07-16 19:51:46 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-07-16 19:51:46 +0000 |
| commit | d5ae032d2b251a1604042f68a9cd3215c233792e (patch) | |
| tree | 65ede336c208aa594f5afa38f22b5f108886e56d /src/base/space.c | |
| parent | 6b22698fec26e427d0edaf9e4e55a35b28f9ab93 (diff) | |
nove funkcie :
extern void actionSpace(space_t *space, void *f, void *p);
extern void actionSpaceFromLocation(space_t *space, void *f, void *p, int x, int y, int w, int h);
casti kodu ktore tieto funkcie potrebovali boli prepisane tak aby ich pouzivali.
( moduly tak prepisem zajtra )
git-svn-id: http://opensvn.csie.org/tuxanci_ng@150 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/base/space.c')
| -rw-r--r-- | src/base/space.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/src/base/space.c b/src/base/space.c index fb51c40..42fce71 100644 --- a/src/base/space.c +++ b/src/base/space.c @@ -310,8 +310,48 @@ void printSpace(space_t *p) } } -void actionSpace(space_t *space) +void actionSpace(space_t *space, void *f, void *p) { + void (*fce)(space_t *space, void *f, void *p); + int len; + int i; + + fce = f; + len = space->list->count; + + for( i = 0 ; i < len ; i++ ) + { + fce(space, space->list->list[i], p); + + if( space->list->count == len-1 ) + { + len--; + i--; + } + } +} + +void actionSpaceFromLocation(space_t *space, void *f, void *p, int x, int y, int w, int h) +{ + void (*fce)(space_t *space, void *f, void *p); + list_t *list; + int len; + int i; + + fce = f; + + list = newList(); + + getObjectFromSpace(space, x, y, w, h, list); + + len = list->count; + + for( i = 0 ; i < len ; i++ ) + { + fce(space, list->list[i], p); + } + + destroyList(list); } void destroySpace(space_t *p) |