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/lib/Miyako/API/yuki.rb
CHANGED
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
22
22
|
|
23
23
|
#lambdaの別名として、yuki_plotメソッドを追加
|
24
24
|
alias :yuki_plot :lambda
|
25
|
+
alias :scenario_plot :lambda
|
25
26
|
|
26
27
|
#=シナリオ言語Yuki実装モジュール
|
27
28
|
module Miyako
|
@@ -190,15 +191,22 @@ module Miyako
|
|
190
191
|
|
191
192
|
@valign = :middle
|
192
193
|
|
193
|
-
@release_checks_default = [
|
194
|
+
@release_checks_default = [
|
195
|
+
lambda{ Input.pushed_any?(:btn1, :spc) },
|
196
|
+
lambda{ @mouse_enable && Input.click?(:left) }
|
197
|
+
]
|
194
198
|
@release_checks = @release_checks_default.dup
|
195
199
|
|
196
|
-
@ok_checks_default = [
|
197
|
-
lambda{
|
200
|
+
@ok_checks_default = [
|
201
|
+
lambda{ Input.pushed_any?(:btn1, :spc) },
|
202
|
+
lambda{ @mouse_enable && self.commandbox.attach_any_command?(*Input.get_mouse_position) && Input.click?(:left) }
|
203
|
+
]
|
198
204
|
@ok_checks = @ok_checks_default.dup
|
199
205
|
|
200
|
-
@cancel_checks_default = [
|
201
|
-
|
206
|
+
@cancel_checks_default = [
|
207
|
+
lambda{ Input.pushed_any?(:btn2, :esc) },
|
208
|
+
lambda{ @mouse_enable && Input.click?(:right) }
|
209
|
+
]
|
202
210
|
@cancel_checks = @cancel_checks_default.dup
|
203
211
|
|
204
212
|
@key_amount_proc = lambda{ Input.pushed_amount }
|
@@ -226,6 +234,10 @@ module Miyako
|
|
226
234
|
raise MiyakoCopyError.not_copy("Yuki")
|
227
235
|
end
|
228
236
|
|
237
|
+
def over_engine
|
238
|
+
@over_yuki
|
239
|
+
end
|
240
|
+
|
229
241
|
#===マウスでの制御を可能にする
|
230
242
|
#ゲームパッド・キーボードでのコマンド・ポーズ制御を行えるが、
|
231
243
|
#それに加えて、マウスでもゲームパッド・キーボードでの制御が行える
|
@@ -258,7 +270,6 @@ module Miyako
|
|
258
270
|
#なお、visibleの値がfalseの時は描画されない。
|
259
271
|
#返却値:: 自分自身を返す
|
260
272
|
def render
|
261
|
-
@visibles.render if @visible
|
262
273
|
@over_yuki.render if @over_yuki && @over_yuki.executing?
|
263
274
|
return self
|
264
275
|
end
|
@@ -268,7 +279,6 @@ module Miyako
|
|
268
279
|
#なお、visibleの値がfalseの時は描画されない。
|
269
280
|
#返却値:: 自分自身を返す
|
270
281
|
def render_to(dst)
|
271
|
-
@visibles.render_to(dst) if @visible
|
272
282
|
@over_yuki.render_to(dst) if @over_yuki && @over_yuki.executing?
|
273
283
|
return self
|
274
284
|
end
|
@@ -278,7 +288,6 @@ module Miyako
|
|
278
288
|
#返却値:: 描く画像のupdate_spriteメソッドを呼び出した結果を配列で返す
|
279
289
|
def update_animation
|
280
290
|
@over_yuki.update_animation if @over_yuki && @over_yuki.executing?
|
281
|
-
@visibles.update_animation
|
282
291
|
end
|
283
292
|
|
284
293
|
#===変数を参照する
|
@@ -1470,4 +1479,6 @@ module Miyako
|
|
1470
1479
|
@is_outer_height = nil
|
1471
1480
|
end
|
1472
1481
|
end
|
1482
|
+
|
1483
|
+
ScenarioEngine = Yuki
|
1473
1484
|
end
|
data/lib/Miyako/miyako.rb
CHANGED
@@ -42,6 +42,9 @@ require 'forwardable'
|
|
42
42
|
require 'iconv' if RUBY_VERSION < '1.9.0'
|
43
43
|
require 'kconv'
|
44
44
|
require 'rbconfig'
|
45
|
+
require 'singleton'
|
46
|
+
require 'csv'
|
47
|
+
require 'delegate'
|
45
48
|
|
46
49
|
#画面などの初期設定を自動的に行うかどうかの設定。デフォルトはtrue
|
47
50
|
$miyako_auto_open = true if $miyako_auto_open.nil?
|
data/miyako_basicdata.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
|
@@ -183,8 +183,9 @@ static VALUE counter_reset(VALUE self)
|
|
183
183
|
static VALUE counter_resume(VALUE self)
|
184
184
|
{
|
185
185
|
VALUE stop_tick = rb_iv_get(self, "@stop_tick");
|
186
|
+
Uint32 st;
|
186
187
|
if(stop_tick == Qnil) return self;
|
187
|
-
|
188
|
+
st = NUM2INT(rb_iv_get(self, "@st")) + SDL_GetTicks() - NUM2INT(stop_tick);
|
188
189
|
rb_iv_set(self, "@st", INT2NUM(st));
|
189
190
|
rb_iv_set(self, "@stop_tick", Qnil);
|
190
191
|
rb_iv_set(self, "@counting", Qtrue);
|
@@ -251,6 +252,7 @@ static VALUE counter_wait(VALUE self)
|
|
251
252
|
*/
|
252
253
|
static int counter_update_inner(VALUE key, VALUE val)
|
253
254
|
{
|
255
|
+
int count, ncount;
|
254
256
|
if(rb_iv_get(key, "@counting") == Qfalse){ return 0; }
|
255
257
|
if(counter_finish(key) == Qtrue)
|
256
258
|
{
|
@@ -263,8 +265,8 @@ static int counter_update_inner(VALUE key, VALUE val)
|
|
263
265
|
rb_ary_push(call_arg, *(array_ptr+2));
|
264
266
|
rb_proc_call(*array_ptr, call_arg);
|
265
267
|
|
266
|
-
|
267
|
-
|
268
|
+
count = NUM2INT(*(array_ptr+1));
|
269
|
+
ncount = NUM2INT(*(array_ptr+2));
|
268
270
|
|
269
271
|
if(ncount > count)
|
270
272
|
{
|
@@ -322,6 +324,9 @@ void _miyako_counter_post_update()
|
|
322
324
|
counter_post_update(cWaitCounter);
|
323
325
|
}
|
324
326
|
|
327
|
+
/*
|
328
|
+
:nodoc:
|
329
|
+
*/
|
325
330
|
static VALUE su_move(VALUE self, VALUE dx, VALUE dy)
|
326
331
|
{
|
327
332
|
VALUE *st = RSTRUCT_PTR(self);
|
@@ -342,6 +347,9 @@ static VALUE su_move(VALUE self, VALUE dx, VALUE dy)
|
|
342
347
|
return self;
|
343
348
|
}
|
344
349
|
|
350
|
+
/*
|
351
|
+
:nodoc:
|
352
|
+
*/
|
345
353
|
static VALUE su_move_to(VALUE self, VALUE x, VALUE y)
|
346
354
|
{
|
347
355
|
VALUE *st = RSTRUCT_PTR(self);
|
@@ -362,6 +370,9 @@ static VALUE su_move_to(VALUE self, VALUE x, VALUE y)
|
|
362
370
|
return self;
|
363
371
|
}
|
364
372
|
|
373
|
+
/*
|
374
|
+
:nodoc:
|
375
|
+
*/
|
365
376
|
static VALUE point_move(VALUE self, VALUE dx, VALUE dy)
|
366
377
|
{
|
367
378
|
VALUE *st = RSTRUCT_PTR(self);
|
@@ -382,6 +393,9 @@ static VALUE point_move(VALUE self, VALUE dx, VALUE dy)
|
|
382
393
|
return self;
|
383
394
|
}
|
384
395
|
|
396
|
+
/*
|
397
|
+
:nodoc:
|
398
|
+
*/
|
385
399
|
static VALUE point_move_to(VALUE self, VALUE x, VALUE y)
|
386
400
|
{
|
387
401
|
VALUE *st = RSTRUCT_PTR(self);
|
@@ -402,6 +416,9 @@ static VALUE point_move_to(VALUE self, VALUE x, VALUE y)
|
|
402
416
|
return self;
|
403
417
|
}
|
404
418
|
|
419
|
+
/*
|
420
|
+
:nodoc:
|
421
|
+
*/
|
405
422
|
static VALUE size_resize(VALUE self, VALUE dw, VALUE dh)
|
406
423
|
{
|
407
424
|
VALUE *st = RSTRUCT_PTR(self);
|
@@ -422,6 +439,9 @@ static VALUE size_resize(VALUE self, VALUE dw, VALUE dh)
|
|
422
439
|
return self;
|
423
440
|
}
|
424
441
|
|
442
|
+
/*
|
443
|
+
:nodoc:
|
444
|
+
*/
|
425
445
|
static VALUE size_resize_to(VALUE self, VALUE w, VALUE h)
|
426
446
|
{
|
427
447
|
VALUE *st = RSTRUCT_PTR(self);
|
@@ -442,6 +462,9 @@ static VALUE size_resize_to(VALUE self, VALUE w, VALUE h)
|
|
442
462
|
return self;
|
443
463
|
}
|
444
464
|
|
465
|
+
/*
|
466
|
+
:nodoc:
|
467
|
+
*/
|
445
468
|
static VALUE rect_resize(VALUE self, VALUE dw, VALUE dh)
|
446
469
|
{
|
447
470
|
VALUE *st = RSTRUCT_PTR(self);
|
@@ -462,6 +485,9 @@ static VALUE rect_resize(VALUE self, VALUE dw, VALUE dh)
|
|
462
485
|
return self;
|
463
486
|
}
|
464
487
|
|
488
|
+
/*
|
489
|
+
:nodoc:
|
490
|
+
*/
|
465
491
|
static VALUE rect_resize_to(VALUE self, VALUE w, VALUE h)
|
466
492
|
{
|
467
493
|
VALUE *st = RSTRUCT_PTR(self);
|
@@ -482,6 +508,9 @@ static VALUE rect_resize_to(VALUE self, VALUE w, VALUE h)
|
|
482
508
|
return self;
|
483
509
|
}
|
484
510
|
|
511
|
+
/*
|
512
|
+
:nodoc:
|
513
|
+
*/
|
485
514
|
static VALUE rect_in_range(VALUE self, VALUE vx, VALUE vy)
|
486
515
|
{
|
487
516
|
VALUE *st = RSTRUCT_PTR(self);
|
@@ -496,6 +525,9 @@ static VALUE rect_in_range(VALUE self, VALUE vx, VALUE vy)
|
|
496
525
|
return Qfalse;
|
497
526
|
}
|
498
527
|
|
528
|
+
/*
|
529
|
+
:nodoc:
|
530
|
+
*/
|
499
531
|
static VALUE square_move(VALUE self, VALUE dx, VALUE dy)
|
500
532
|
{
|
501
533
|
VALUE *st = RSTRUCT_PTR(self);
|
@@ -524,6 +556,9 @@ static VALUE square_move(VALUE self, VALUE dx, VALUE dy)
|
|
524
556
|
return self;
|
525
557
|
}
|
526
558
|
|
559
|
+
/*
|
560
|
+
:nodoc:
|
561
|
+
*/
|
527
562
|
static VALUE square_move_to(VALUE self, VALUE x, VALUE y)
|
528
563
|
{
|
529
564
|
VALUE *st = RSTRUCT_PTR(self);
|
@@ -554,6 +589,9 @@ static VALUE square_move_to(VALUE self, VALUE x, VALUE y)
|
|
554
589
|
return self;
|
555
590
|
}
|
556
591
|
|
592
|
+
/*
|
593
|
+
:nodoc:
|
594
|
+
*/
|
557
595
|
static VALUE square_resize(VALUE self, VALUE dw, VALUE dh)
|
558
596
|
{
|
559
597
|
VALUE *st = RSTRUCT_PTR(self);
|
@@ -574,6 +612,9 @@ static VALUE square_resize(VALUE self, VALUE dw, VALUE dh)
|
|
574
612
|
return self;
|
575
613
|
}
|
576
614
|
|
615
|
+
/*
|
616
|
+
:nodoc:
|
617
|
+
*/
|
577
618
|
static VALUE square_resize_to(VALUE self, VALUE w, VALUE h)
|
578
619
|
{
|
579
620
|
VALUE *st = RSTRUCT_PTR(self);
|
@@ -596,6 +637,9 @@ static VALUE square_resize_to(VALUE self, VALUE w, VALUE h)
|
|
596
637
|
return self;
|
597
638
|
}
|
598
639
|
|
640
|
+
/*
|
641
|
+
:nodoc:
|
642
|
+
*/
|
599
643
|
static VALUE square_in_range(VALUE self, VALUE vx, VALUE vy)
|
600
644
|
{
|
601
645
|
VALUE *st = RSTRUCT_PTR(self);
|
@@ -610,6 +654,9 @@ static VALUE square_in_range(VALUE self, VALUE vx, VALUE vy)
|
|
610
654
|
return Qfalse;
|
611
655
|
}
|
612
656
|
|
657
|
+
/*
|
658
|
+
:nodoc:
|
659
|
+
*/
|
613
660
|
void Init_miyako_basicdata()
|
614
661
|
{
|
615
662
|
mSDL = rb_define_module("SDL");
|