ruby-miyako 2.1.4 → 2.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README +42 -5
- data/lib/Miyako/API/choices.rb +0 -2
- data/lib/Miyako/API/collision.rb +0 -4
- data/lib/Miyako/API/fixedmap.rb +0 -3
- data/lib/Miyako/API/i_yuki.rb +28 -46
- data/lib/Miyako/API/layout.rb +0 -1
- data/lib/Miyako/API/map.rb +0 -2
- data/lib/Miyako/API/map_event.rb +0 -3
- data/lib/Miyako/API/map_struct.rb +0 -2
- data/lib/Miyako/API/parts.rb +0 -11
- data/lib/Miyako/API/screen.rb +3 -4
- data/lib/Miyako/API/shape.rb +27 -27
- data/lib/Miyako/API/sprite.rb +0 -2
- data/lib/Miyako/API/story.rb +0 -2
- data/lib/Miyako/API/textbox.rb +9 -11
- data/lib/Miyako/API/utility.rb +2 -2
- data/lib/Miyako/API/yuki.rb +19 -8
- data/lib/Miyako/miyako.rb +3 -0
- data/miyako_basicdata.c +52 -5
- data/miyako_bitmap.c +351 -342
- data/miyako_collision.c +77 -67
- data/miyako_diagram.c +22 -21
- data/miyako_drawing.c +9 -6
- data/miyako_font.c +63 -53
- data/miyako_hsv.c +428 -436
- data/miyako_input_audio.c +17 -14
- data/miyako_layout.c +23 -18
- data/miyako_no_katana.c +284 -248
- data/miyako_sprite2.c +30 -18
- data/miyako_transform.c +95 -93
- data/miyako_utility.c +9 -18
- data/miyako_yuki.c +10 -6
- data/sample/Diagram_sample/diagram_sample_yuki2.rb +2 -2
- data/sample/Room3/room3.rb +8 -10
- data/sample/ball_action_sample.rb +8 -8
- data/sample/map_test/main_scene.rb +1 -1
- data/sample/map_test/map_test.rb +8 -8
- data/sample/takahashi.rb +14 -14
- data/win/miyako_no_katana.so +0 -0
- metadata +6 -4
data/miyako_input_audio.c
CHANGED
@@ -20,8 +20,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
20
20
|
*/
|
21
21
|
|
22
22
|
/*
|
23
|
-
|
24
|
-
Authors::
|
23
|
+
=miyako_no_katana
|
24
|
+
Authors:: Cyross Makoto
|
25
25
|
Version:: 2.1
|
26
26
|
Copyright:: 2007-2008 Cyross Makoto
|
27
27
|
License:: LGPL2.1
|
@@ -69,8 +69,9 @@ static volatile VALUE sy_ent = Qnil;
|
|
69
69
|
*/
|
70
70
|
static VALUE input_update(VALUE self)
|
71
71
|
{
|
72
|
-
int i;
|
72
|
+
int i, len;
|
73
73
|
VALUE *ptr;
|
74
|
+
VALUE keys, e_list, e;
|
74
75
|
|
75
76
|
VALUE btn = rb_iv_get(self, "@@btn");
|
76
77
|
VALUE mouse = rb_iv_get(self, "@@mouse");
|
@@ -85,7 +86,7 @@ static VALUE input_update(VALUE self)
|
|
85
86
|
|
86
87
|
rb_funcall(cJoystick, id_update_all, 0);
|
87
88
|
|
88
|
-
|
89
|
+
keys = rb_funcall(pushed, rb_intern("keys"), 0);
|
89
90
|
ptr = RARRAY_PTR(keys);
|
90
91
|
for(i=0; i<RARRAY_LEN(keys); i++)
|
91
92
|
{
|
@@ -101,8 +102,8 @@ static VALUE input_update(VALUE self)
|
|
101
102
|
rb_hash_aset(drop, sy_middle, Qfalse);
|
102
103
|
rb_hash_aset(drop, sy_right, Qfalse);
|
103
104
|
|
104
|
-
|
105
|
-
|
105
|
+
e_list = rb_ary_new();
|
106
|
+
e = rb_funcall(cEvent, id_poll, 0);
|
106
107
|
while(e != Qnil)
|
107
108
|
{
|
108
109
|
rb_ary_push(e_list, e);
|
@@ -110,7 +111,7 @@ static VALUE input_update(VALUE self)
|
|
110
111
|
}
|
111
112
|
|
112
113
|
ptr = RARRAY_PTR(e_list);
|
113
|
-
|
114
|
+
len = RARRAY_LEN(e_list);
|
114
115
|
for(i=0; i<len; i++)
|
115
116
|
{
|
116
117
|
VALUE e2 = *(ptr + len - i - 1);
|
@@ -139,10 +140,11 @@ void _miyako_input_update()
|
|
139
140
|
*/
|
140
141
|
static VALUE bgm_update(VALUE self)
|
141
142
|
{
|
142
|
-
VALUE nua
|
143
|
+
VALUE nua, pb;
|
144
|
+
nua = rb_gv_get("$not_use_audio");
|
143
145
|
if(nua == Qfalse) return Qnil;
|
144
146
|
|
145
|
-
|
147
|
+
pb = rb_iv_get(self, "@@playin_bgm");
|
146
148
|
if(pb == Qnil) return Qnil;
|
147
149
|
|
148
150
|
if(rb_funcall(pb, id_is_playing_wo_loop, 0) == Qfalse &&
|
@@ -170,17 +172,18 @@ static VALUE bgm_update(VALUE self)
|
|
170
172
|
*/
|
171
173
|
static VALUE se_update(VALUE self)
|
172
174
|
{
|
173
|
-
|
175
|
+
int i;
|
176
|
+
VALUE nua, playings, *ptr;
|
177
|
+
nua = rb_gv_get("$not_use_audio");
|
174
178
|
if(nua == Qfalse) return Qnil;
|
175
179
|
|
176
|
-
|
177
|
-
|
178
|
-
int i;
|
180
|
+
playings = rb_iv_get(self, "@@playings");
|
181
|
+
ptr = RARRAY_PTR(playings);
|
179
182
|
for(i=0; i<RARRAY_LEN(playings); i++)
|
180
183
|
{
|
181
184
|
VALUE pl = *(ptr+i);
|
182
185
|
|
183
|
-
|
186
|
+
if(rb_funcall(pl, id_is_playing_wo_loop, 0) == Qfalse &&
|
184
187
|
rb_funcall(pl, id_in_the_loop, 0) == Qtrue)
|
185
188
|
{
|
186
189
|
rb_funcall(pl, id_countup, 0);
|
data/miyako_layout.c
CHANGED
@@ -20,8 +20,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
20
20
|
*/
|
21
21
|
|
22
22
|
/*
|
23
|
-
|
24
|
-
Authors::
|
23
|
+
=miyako_no_katana
|
24
|
+
Authors:: Cyross Makoto
|
25
25
|
Version:: 2.0
|
26
26
|
Copyright:: 2007-2008 Cyross Makoto
|
27
27
|
License:: LGPL2.1
|
@@ -92,10 +92,11 @@ VALUE _miyako_layout_y(VALUE self)
|
|
92
92
|
|
93
93
|
static VALUE layout_update_layout(VALUE self, VALUE dx, VALUE dy)
|
94
94
|
{
|
95
|
-
rb_funcall(self, rb_intern("update_layout_position"), 0);
|
96
|
-
VALUE layout = get_layout(self);
|
97
|
-
VALUE children = *(RSTRUCT_PTR(*(RSTRUCT_PTR(layout)+3))+1);
|
98
95
|
int i;
|
96
|
+
VALUE layout, children;
|
97
|
+
rb_funcall(self, rb_intern("update_layout_position"), 0);
|
98
|
+
layout = get_layout(self);
|
99
|
+
children = *(RSTRUCT_PTR(*(RSTRUCT_PTR(layout)+3))+1);
|
99
100
|
for(i=0; i<RARRAY_LEN(children); i++)
|
100
101
|
{
|
101
102
|
layout_move(*(RARRAY_PTR(children) + i), dx, dy);
|
@@ -105,6 +106,8 @@ static VALUE layout_update_layout(VALUE self, VALUE dx, VALUE dy)
|
|
105
106
|
|
106
107
|
static VALUE layout_move(VALUE self, VALUE dx, VALUE dy)
|
107
108
|
{
|
109
|
+
int i;
|
110
|
+
VALUE on_move;
|
108
111
|
VALUE *pos = RSTRUCT_PTR(*(RSTRUCT_PTR(get_layout(self))));
|
109
112
|
VALUE *pox = pos+0;
|
110
113
|
VALUE *poy = pos+1;
|
@@ -113,8 +116,7 @@ static VALUE layout_move(VALUE self, VALUE dx, VALUE dy)
|
|
113
116
|
*pox = INT2NUM(NUM2INT(tx)+NUM2INT(dx));
|
114
117
|
*poy = INT2NUM(NUM2INT(ty)+NUM2INT(dy));
|
115
118
|
layout_update_layout(self, dx, dy);
|
116
|
-
|
117
|
-
int i;
|
119
|
+
on_move = *(RSTRUCT_PTR(get_layout(self)) + 4);
|
118
120
|
for(i=0; i<RARRAY_LEN(on_move); i++)
|
119
121
|
{
|
120
122
|
rb_funcall(*(RARRAY_PTR(on_move) + i), rb_intern("call"), 5, self, *pox, *poy, dx, dy);
|
@@ -138,6 +140,8 @@ VALUE _miyako_layout_move(VALUE self, VALUE dx, VALUE dy)
|
|
138
140
|
|
139
141
|
static VALUE layout_move_to(VALUE self, VALUE x, VALUE y)
|
140
142
|
{
|
143
|
+
int i;
|
144
|
+
VALUE on_move, dx, dy;
|
141
145
|
VALUE *pos = RSTRUCT_PTR(*(RSTRUCT_PTR(get_layout(self))));
|
142
146
|
VALUE *pox = pos+0;
|
143
147
|
VALUE *poy = pos+1;
|
@@ -145,11 +149,10 @@ static VALUE layout_move_to(VALUE self, VALUE x, VALUE y)
|
|
145
149
|
VALUE ty = *poy;
|
146
150
|
*pox = x;
|
147
151
|
*poy = y;
|
148
|
-
|
149
|
-
|
152
|
+
dx = INT2NUM((NUM2INT(x))-(NUM2INT(tx)));
|
153
|
+
dy = INT2NUM((NUM2INT(y))-(NUM2INT(ty)));
|
150
154
|
layout_update_layout(self, dx, dy);
|
151
|
-
|
152
|
-
int i;
|
155
|
+
on_move = *(RSTRUCT_PTR(get_layout(self)) + 4);
|
153
156
|
for(i=0; i<RARRAY_LEN(on_move); i++)
|
154
157
|
{
|
155
158
|
rb_funcall(*(RARRAY_PTR(on_move) + i), rb_intern("call"), 5, self, *pox, *poy, dx, dy);
|
@@ -173,6 +176,8 @@ VALUE _miyako_layout_move_to(VALUE self, VALUE x, VALUE y)
|
|
173
176
|
|
174
177
|
static VALUE layout_relative_move_to(VALUE self, VALUE x, VALUE y)
|
175
178
|
{
|
179
|
+
int i;
|
180
|
+
VALUE on_move, dx, dy;
|
176
181
|
// bpos = @layout.base.pos
|
177
182
|
// Size.new(bpos.x+x,bpos.y+y)
|
178
183
|
VALUE *pos = RSTRUCT_PTR(*(RSTRUCT_PTR(get_layout(self))));
|
@@ -187,11 +192,10 @@ static VALUE layout_relative_move_to(VALUE self, VALUE x, VALUE y)
|
|
187
192
|
*pox = INT2NUM(NUM2INT(x)+NUM2INT(*(bpos+0)));
|
188
193
|
*poy = INT2NUM(NUM2INT(y)+NUM2INT(*(bpos+1)));
|
189
194
|
|
190
|
-
|
191
|
-
|
195
|
+
dx = INT2NUM(NUM2INT(*pox)-NUM2INT(tx));
|
196
|
+
dy = INT2NUM(NUM2INT(*poy)-NUM2INT(ty));
|
192
197
|
layout_update_layout(self, dx, dy);
|
193
|
-
|
194
|
-
int i;
|
198
|
+
on_move = *(RSTRUCT_PTR(get_layout(self)) + 4);
|
195
199
|
for(i=0; i<RARRAY_LEN(on_move); i++)
|
196
200
|
{
|
197
201
|
rb_funcall(*(RARRAY_PTR(on_move) + i), rb_intern("call"), 5, self, *pox, *poy, dx, dy);
|
@@ -236,11 +240,12 @@ static VALUE layout_delete_snap_child(VALUE self, VALUE spr)
|
|
236
240
|
|
237
241
|
static VALUE layout_snap(int argc, VALUE *argv, VALUE self)
|
238
242
|
{
|
243
|
+
VALUE layout, *sprite, *base;
|
239
244
|
VALUE spr = Qnil;
|
240
245
|
rb_scan_args(argc, argv, "01", &spr);
|
241
|
-
|
242
|
-
|
243
|
-
|
246
|
+
layout = get_layout(self);
|
247
|
+
sprite = RSTRUCT_PTR(*(RSTRUCT_PTR(layout)+3));
|
248
|
+
base = RSTRUCT_PTR(layout)+2;
|
244
249
|
if(spr != Qnil)
|
245
250
|
{
|
246
251
|
if(*sprite != Qnil){ layout_delete_snap_child(*sprite, self); }
|