dxrubynd 1.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +12 -0
- data/README.md +31 -0
- data/Rakefile +9 -0
- data/dxrubynd.gemspec +41 -0
- data/ext/dxruby/COPYING +13 -0
- data/ext/dxruby/collision.c +1460 -0
- data/ext/dxruby/collision.h +47 -0
- data/ext/dxruby/dxruby-i386-mswin32.def +4 -0
- data/ext/dxruby/dxruby.c +5861 -0
- data/ext/dxruby/dxruby.h +392 -0
- data/ext/dxruby/extconf.rb +29 -0
- data/ext/dxruby/font.c +686 -0
- data/ext/dxruby/font.h +20 -0
- data/ext/dxruby/image.c +3391 -0
- data/ext/dxruby/image.h +22 -0
- data/ext/dxruby/input.c +2522 -0
- data/ext/dxruby/input.h +4 -0
- data/ext/dxruby/matrix.c +1221 -0
- data/ext/dxruby/matrix.h +30 -0
- data/ext/dxruby/messagethread.c +1180 -0
- data/ext/dxruby/messagethread.h +22 -0
- data/ext/dxruby/sound.c +1516 -0
- data/ext/dxruby/sound.h +1 -0
- data/ext/dxruby/sprite.c +1313 -0
- data/ext/dxruby/sprite.h +29 -0
- data/ext/dxruby/version.h +10 -0
- data/lib/dxrubynd/version.rb +5 -0
- data/lib/dxrubynd.rb +4 -0
- data/sig/dxrubynd.rbs +4 -0
- metadata +91 -0
@@ -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
|
+
|