• R/O
  • SSH
  • HTTPS

dxruby: Commit


Commit MetaInfo

Revision317 (tree)
Time2012-07-05 21:56:33
Authormirichi

Log Message

Sprite.draw/update/cleanに配列の配列を渡してもいいように修正

Change Summary

Incremental Difference

--- trunk/sprite.c (revision 316)
+++ trunk/sprite.c (revision 317)
@@ -880,8 +880,12 @@
880880 {
881881 VALUE p = RARRAY_PTR( ary )[i];
882882
883- if( rb_respond_to( p, id_update ) )
883+ if( TYPE( p ) == T_ARRAY )
884884 {
885+ Sprite_class_update( cSprite, p );
886+ }
887+ else if( rb_respond_to( p, id_update ) )
888+ {
885889 rb_funcall2( p, id_update, 0, 0 );
886890 }
887891 }
@@ -902,8 +906,12 @@
902906 {
903907 VALUE p = RARRAY_PTR( ary )[i];
904908
905- if( rb_respond_to( p, id_draw ) )
909+ if( TYPE( p ) == T_ARRAY )
906910 {
911+ Sprite_class_draw( cSprite, p );
912+ }
913+ else if( rb_respond_to( p, id_draw ) )
914+ {
907915 rb_funcall2( p, id_draw, 0, 0 );
908916 }
909917 }
@@ -924,8 +932,12 @@
924932 {
925933 VALUE p = RARRAY_PTR( ary )[i];
926934
927- if( rb_respond_to( p, id_vanished ) )
935+ if( TYPE( p ) == T_ARRAY )
928936 {
937+ Sprite_class_clean( cSprite, p );
938+ }
939+ else if( rb_respond_to( p, id_vanished ) )
940+ {
929941 if( RTEST( rb_funcall2( p, id_vanished, 0, 0 ) ) )
930942 {
931943 RARRAY_PTR( ary )[i] = Qnil;
Show on old repository browser