Mercurial > MadButterfly
comparison src/geo.c @ 235:65cabbdd5284
termporary revision
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Thu, 25 Dec 2008 18:40:27 +0800 |
parents | 530bb7728546 |
children | 586e50f82c1f |
comparison
equal
deleted
inserted
replaced
234:889cdc5f23c5 | 235:65cabbdd5284 |
---|---|
17 return 0; | 17 return 0; |
18 } | 18 } |
19 return 1; | 19 return 1; |
20 } | 20 } |
21 | 21 |
22 static int _is_overlay(area_t *r1, area_t *r2) { | 22 static int _areas_are_overlay(area_t *r1, area_t *r2) { |
23 if(is_scale_overlay(r1->x, r1->w, r2->x, r2->w) && | 23 if(is_scale_overlay(r1->x, r1->w, r2->x, r2->w) && |
24 is_scale_overlay(r1->y, r1->h, r2->y, r2->h)) | 24 is_scale_overlay(r1->y, r1->h, r2->y, r2->h)) |
25 return 1; | 25 return 1; |
26 | 26 |
27 return 0; | 27 return 0; |
28 } | 28 } |
29 | 29 |
30 int is_overlay(area_t *r1, area_t *r2) { | 30 int areas_are_overlay(area_t *r1, area_t *r2) { |
31 return _is_overlay(r1, r2); | 31 return _areas_are_overlay(r1, r2); |
32 } | 32 } |
33 | 33 |
34 void area_init(area_t *area, int n_pos, co_aix pos[][2]) { | 34 void area_init(area_t *area, int n_pos, co_aix pos[][2]) { |
35 co_aix min_x, max_x; | 35 co_aix min_x, max_x; |
36 co_aix min_y, max_y; | 36 co_aix min_y, max_y; |
84 int *n_overlays, geo_t **overlays) { | 84 int *n_overlays, geo_t **overlays) { |
85 int i, ov_idx; | 85 int i, ov_idx; |
86 | 86 |
87 ov_idx = 0; | 87 ov_idx = 0; |
88 for(i = 0; i < n_others; i++) { | 88 for(i = 0; i < n_others; i++) { |
89 if(_is_overlay(g->cur_area, others[i]->cur_area)) | 89 if(_areas_are_overlay(g->cur_area, others[i]->cur_area)) |
90 overlays[ov_idx++] = others[i]; | 90 overlays[ov_idx++] = others[i]; |
91 } | 91 } |
92 *n_overlays = ov_idx; | 92 *n_overlays = ov_idx; |
93 } | 93 } |
94 | 94 |