summaryrefslogtreecommitdiff
path: root/src/space.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-12 19:27:11 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-12 19:27:11 +0000
commit652ce49bba44c885da4891bcae5fb650ef132a73 (patch)
tree227a6f37a77f4b907e457b9163a0e36a0d9af1ed /src/space.c
parent9751218f594526982877332d6ca0fa90b67bbb7b (diff)
- moduly pouzivaju space_t
- drobne upravy git-svn-id: http://opensvn.csie.org/tuxanci_ng@64 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/space.c')
-rw-r--r--src/space.c36
1 files changed, 36 insertions, 0 deletions
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;