dxrubynd 1.4.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,47 @@
1
+ struct DXRubyCollision
2
+ {
3
+ /* �Փ˔���p */
4
+ int x1, y1, x2, y2; /* AABB�{�����[�� */
5
+ VALUE vsprite;
6
+ float bx1, by1, bx2, by2; /* ��]�O�E���΍��W�ł̋�`����͈́i�ȗ����������ɐݒ肷��j */
7
+ float angle, base_x, base_y, scale_x, scale_y, center_x, center_y;
8
+ int rotation_flg, scaling_flg;
9
+ VALUE vcollision;
10
+ };
11
+
12
+ struct DXRubyCollisionGroup
13
+ {
14
+ int index;
15
+ VALUE vsprite;
16
+ int count;
17
+ int x1, y1, x2, y2; /* AABB�{�����[�� */
18
+ };
19
+
20
+ int check( struct DXRubyCollisionGroup *o, struct DXRubyCollisionGroup *d );
21
+ int check_sub( struct DXRubyCollision *o, struct DXRubyCollision *d );
22
+ int make_volume_ary( VALUE vary, struct DXRubyCollisionGroup *collision );
23
+ int make_volume( VALUE vsprite, struct DXRubyCollisionGroup *collision );
24
+ void make_volume_sub( VALUE vsprite, VALUE vcol, struct DXRubyCollision *collision );
25
+ void collision_init(void);
26
+ int get_volume_count( VALUE vary );
27
+
28
+
29
+ #define check_box_box(b1, b2) ( (b1)->x1 < (b2)->x2 && \
30
+ (b1)->y1 < (b2)->y2 && \
31
+ (b2)->x1 < (b1)->x2 && \
32
+ (b2)->y1 < (b1)->y2 )
33
+
34
+ #define check_point_box(x, y, x1, y1, x2, y2) ( (x) >= (x1) && \
35
+ (y) >= (y1) && \
36
+ (x) < (x2) && \
37
+ (y) < (y2))
38
+
39
+ #define check_circle_circle(ox, oy, or, dx, dy, dr) ((or+dr) * (or+dr) >= (ox-dx) * (ox-dx) + (oy-dy) * (oy-dy))
40
+
41
+ #define check_circle_point(cx, cy, cr, px, py) ((cr*cr) >= (cx-px) * (cx-px) + (cy-py) * (cy-py))
42
+
43
+ #define check_line_line(x1, y1, x2, y2, x3, y3, x4, y4) (!((((x1 - x2) * (y3 - y1) + (y1 - y2) * (x1 - x3)) * \
44
+ ((x1 - x2) * (y4 - y1) + (y1 - y2) * (x1 - x4)) > 0.0) || \
45
+ (((x3 - x4) * (y1 - y3) + (y3 - y4) * (x3 - x1)) * \
46
+ ((x3 - x4) * (y2 - y3) + (y3 - y4) * (x3 - x2)) > 0.0 )))
47
+
@@ -0,0 +1,4 @@
1
+ EXPORTS
2
+ Init_dxruby
3
+ DXRuby_lock
4
+ DXRuby_unlock