Mercurial > MadButterfly
comparison src/geo.c @ 15:c2ce186a5c37
X_main uses rdman_redraw_all()
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Fri, 01 Aug 2008 01:40:07 +0800 |
parents | ed55009d96d3 |
children | 41f0907b27ac |
comparison
equal
deleted
inserted
replaced
14:d34232f15863 | 15:c2ce186a5c37 |
---|---|
29 | 29 |
30 int is_overlay(area_t *r1, area_t *r2) { | 30 int is_overlay(area_t *r1, area_t *r2) { |
31 return _is_overlay(r1, r2); | 31 return _is_overlay(r1, r2); |
32 } | 32 } |
33 | 33 |
34 void geo_init(geo_t *g, 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; |
37 co_aix x, y; | 37 co_aix x, y; |
38 int i; | 38 int i; |
39 | 39 |
40 min_x = max_x = pos[0][0]; | 40 min_x = max_x = pos[0][0]; |
41 min_y = max_y = pos[0][1]; | 41 min_y = max_y = pos[0][1]; |
42 for(i = 1; i < n_pos; i++) { | 42 for(i = 1; i < n_pos; i++) { |
43 x = pos[i][0]; | 43 x = pos[i][0]; |
44 if(x < min_x) | 44 if(x < min_x) |
50 min_y = y; | 50 min_y = y; |
51 else if(y > max_y) | 51 else if(y > max_y) |
52 max_y = y; | 52 max_y = y; |
53 } | 53 } |
54 | 54 |
55 area->x = min_x; | |
56 area->w = max_x - min_x; | |
57 area->y = min_y; | |
58 area->h = max_y - min_y; | |
59 } | |
60 | |
61 void geo_init(geo_t *g, int n_pos, co_aix pos[][2]) { | |
55 g->cur_area = g->areas; | 62 g->cur_area = g->areas; |
56 g->last_area = g->areas + 1; | 63 g->last_area = g->areas + 1; |
57 | 64 area_init(g->cur_area, n_pos, pos); |
58 g->cur_area->x = min_x; | |
59 g->cur_area->w = max_x - min_x; | |
60 g->cur_area->y = min_y; | |
61 g->cur_area->h = max_y - min_y; | |
62 } | 65 } |
63 | 66 |
64 void geo_mark_overlay(geo_t *g, int n_others, geo_t **others, | 67 void geo_mark_overlay(geo_t *g, int n_others, geo_t **others, |
65 int *n_overlays, geo_t **overlays) { | 68 int *n_overlays, geo_t **overlays) { |
66 int i, ov_idx; | 69 int i, ov_idx; |