From 652ce49bba44c885da4891bcae5fb650ef132a73 Mon Sep 17 00:00:00 2001 From: oroborus Date: Thu, 12 Jun 2008 19:27:11 +0000 Subject: - moduly pouzivaju space_t - drobne upravy git-svn-id: http://opensvn.csie.org/tuxanci_ng@64 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/space.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/space.c') diff --git a/src/space.c b/src/space.c index ce662f0..32f7daf 100644 --- a/src/space.c +++ b/src/space.c @@ -219,6 +219,42 @@ int isConflictWithObjectFromSpace(space_t *p, int x, int y, int w, int h) return 0; } +int isConflictWithObjectFromSpaceBut(space_t *p, int x, int y, int w, int h, void *but) +{ + int segX, segY, segW, segH; + int id, this_x, this_y, this_w, this_h; + int i, j, k; + + getSegment(p, x, y, w, h, &segX, &segY, &segW, &segH); + + for( i = segY ; i < segY + segH ; i++ ) + { + for( j = segX ; j < segX + segW ; j++ ) + { + void *this; + + for( k = 0 ; k < p->area[j][i]->count ; k++ ) + { + this = p->area[j][i]->list[k]; + + if( this == but ) + { + continue; + } + + p->getStatus(this, &id, &this_x, &this_y, &this_w, &this_h); + + if( my_conflictSpace(x, y, w, h, this_x, this_y, this_w, this_h) ) + { + return 1; + } + } + } + } + + return 0; +} + void delObjectFromSpace(space_t *p, void *item) { int segX, segY, segW, segH; -- cgit v1.2.3