Sprite.draw/update/cleanに配列の配列を渡してもいいように修正
@@ -880,8 +880,12 @@ | ||
880 | 880 | { |
881 | 881 | VALUE p = RARRAY_PTR( ary )[i]; |
882 | 882 | |
883 | - if( rb_respond_to( p, id_update ) ) | |
883 | + if( TYPE( p ) == T_ARRAY ) | |
884 | 884 | { |
885 | + Sprite_class_update( cSprite, p ); | |
886 | + } | |
887 | + else if( rb_respond_to( p, id_update ) ) | |
888 | + { | |
885 | 889 | rb_funcall2( p, id_update, 0, 0 ); |
886 | 890 | } |
887 | 891 | } |
@@ -902,8 +906,12 @@ | ||
902 | 906 | { |
903 | 907 | VALUE p = RARRAY_PTR( ary )[i]; |
904 | 908 | |
905 | - if( rb_respond_to( p, id_draw ) ) | |
909 | + if( TYPE( p ) == T_ARRAY ) | |
906 | 910 | { |
911 | + Sprite_class_draw( cSprite, p ); | |
912 | + } | |
913 | + else if( rb_respond_to( p, id_draw ) ) | |
914 | + { | |
907 | 915 | rb_funcall2( p, id_draw, 0, 0 ); |
908 | 916 | } |
909 | 917 | } |
@@ -924,8 +932,12 @@ | ||
924 | 932 | { |
925 | 933 | VALUE p = RARRAY_PTR( ary )[i]; |
926 | 934 | |
927 | - if( rb_respond_to( p, id_vanished ) ) | |
935 | + if( TYPE( p ) == T_ARRAY ) | |
928 | 936 | { |
937 | + Sprite_class_clean( cSprite, p ); | |
938 | + } | |
939 | + else if( rb_respond_to( p, id_vanished ) ) | |
940 | + { | |
929 | 941 | if( RTEST( rb_funcall2( p, id_vanished, 0, 0 ) ) ) |
930 | 942 | { |
931 | 943 | RARRAY_PTR( ary )[i] = Qnil; |