• R/O
  • SSH
  • HTTPS

apollo: Commit


Commit MetaInfo

Revision536 (tree)
Time2007-05-10 11:07:02
Authormoriq

Log Message

* u/uAnimate.pas: cast argv to Pvalue.

Change Summary

Incremental Difference

--- apollo/trunk/src/test/animate_test.rb (nonexistent)
+++ apollo/trunk/src/test/animate_test.rb (revision 536)
@@ -0,0 +1,25 @@
1+require "test/unit"
2+require "phi"
3+class TCAnimate < Test::Unit::TestCase
4+ def setup
5+ @form = Phi::Form.new
6+ @anim = Phi::Animate.new @form
7+ end
8+
9+ def test_file_name
10+ @anim.file_name = File.dirname(__FILE__) + '/../../sample/ap.avi'
11+ end
12+
13+ def test_play_from_eq_to
14+ @anim.common_avi = Phi::AVI_FIND_FOLDER
15+ @anim.play(1,1,1)
16+ end
17+ def test_play_from_gt_to
18+ @anim.common_avi = Phi::AVI_FIND_FOLDER
19+ @anim.play(2,1,1)
20+ end
21+ def test_play_omit_from_to
22+ @anim.common_avi = Phi::AVI_FIND_FOLDER
23+ @anim.play
24+ end
25+end
--- apollo/trunk/src/u/uAnimate.pas (revision 535)
+++ apollo/trunk/src/u/uAnimate.pas (revision 536)
@@ -65,13 +65,12 @@
6565
6666 function Animate_play(argc: integer; argv: Pointer; This: Tvalue): Tvalue; cdecl;
6767 var
68- args: array of Tvalue;
6968 real: TAnimate;
69+ p: Rubies.Pvalue;
7070 fromFrame, toFrame: Integer;
7171 begin
72- SetLength(args, argc);
73- args := argv;
7472 real := ap_data_get_struct(This);
73+ p := argv;
7574
7675 if argc = 0 then
7776 real.Play(1, real.FrameCount, 0)
@@ -78,13 +77,13 @@
7877 else
7978 if argc = 3 then
8079 begin
81- fromFrame := NUM2INT(args[0]);
82- toFrame := NUM2INT(args[1]);
80+ fromFrame := NUM2INT(p^); inc(p);
81+ toFrame := NUM2INT(p^); inc(p);
8382 if (fromFrame < 1) or (fromFrame > real.FrameCount) then
8483 ap_raise(ap_eArgError, sOut_of_range);
8584 if (toFrame < 1) or (toFrame > real.FrameCount) then
8685 ap_raise(ap_eArgError, sOut_of_range);
87- real.Play(fromFrame, toFrame, NUM2INT(args[2]));
86+ real.Play(fromFrame, toFrame, NUM2INT(p^));
8887 end
8988 else
9089 ap_raise(ap_eArgError, sWrong_num_of_args);
Show on old repository browser