• R/O
  • SSH
  • HTTPS

dxruby: Commit


Commit MetaInfo

Revision404 (tree)
Time2013-11-13 21:24:38
Authormirichi

Log Message

SpriteのクラスメソッドでSprite以外のオブジェクトの動作がバグっていたので修正

Change Summary

Incremental Difference

--- branches/1.5dev/sprite.c (revision 403)
+++ branches/1.5dev/sprite.c (revision 404)
@@ -1041,20 +1041,13 @@
10411041 {
10421042 Sprite_class_update( cSprite, p );
10431043 }
1044- else if( rb_respond_to( p, id_vanished ) )
1044+ else if( !rb_respond_to( p, id_vanished ) || !RTEST( rb_funcall2( p, id_vanished, 0, 0 ) ) )
10451045 {
1046- if( !RTEST( rb_funcall2( p, id_vanished, 0, 0 ) ) )
1046+ if( rb_respond_to( p, id_update ) )
10471047 {
1048- if( rb_respond_to( p, id_update ) )
1049- {
1050- rb_funcall2( p, id_update, 0, 0 );
1051- }
1048+ rb_funcall2( p, id_update, 0, 0 );
10521049 }
10531050 }
1054- else if( rb_respond_to( p, id_update ) )
1055- {
1056- rb_funcall2( p, id_update, 0, 0 );
1057- }
10581051 }
10591052 return Qnil;
10601053 }
@@ -1077,23 +1070,10 @@
10771070 {
10781071 Sprite_class_draw( cSprite, p );
10791072 }
1080- else if( rb_respond_to( p, id_vanished ) )
1073+ else if( !rb_respond_to( p, id_vanished ) || !RTEST( rb_funcall2( p, id_vanished, 0, 0 ) ) )
10811074 {
1082- if( !RTEST( rb_funcall2( p, id_vanished, 0, 0 ) ) )
1075+ if( !rb_respond_to( p, id_visible ) || RTEST( rb_funcall2( p, id_visible, 0, 0 ) ) )
10831076 {
1084- if( rb_respond_to( p, id_visible ) && RTEST( rb_funcall2( p, id_visible, 0, 0 ) ) )
1085- {
1086- if( rb_respond_to( p, id_draw ) )
1087- {
1088- rb_funcall2( p, id_draw, 0, 0 );
1089- }
1090- }
1091- }
1092- }
1093- else if( rb_respond_to( p, id_visible ) )
1094- {
1095- if( RTEST( rb_funcall2( p, id_visible, 0, 0 ) ) )
1096- {
10971077 if( rb_respond_to( p, id_draw ) )
10981078 {
10991079 rb_funcall2( p, id_draw, 0, 0 );
@@ -1100,10 +1080,6 @@
11001080 }
11011081 }
11021082 }
1103- else if( rb_respond_to( p, id_draw ) )
1104- {
1105- rb_funcall2( p, id_draw, 0, 0 );
1106- }
11071083 }
11081084 return Qnil;
11091085 }
@@ -1126,12 +1102,9 @@
11261102 {
11271103 Sprite_class_clean( cSprite, p );
11281104 }
1129- else if( rb_respond_to( p, id_vanished ) )
1105+ else if( rb_respond_to( p, id_vanished ) && RTEST( rb_funcall2( p, id_vanished, 0, 0 ) ) )
11301106 {
1131- if( RTEST( rb_funcall2( p, id_vanished, 0, 0 ) ) )
1132- {
1133- RARRAY_ASET( ary, i, Qnil);
1134- }
1107+ RARRAY_ASET( ary, i, Qnil);
11351108 }
11361109 }
11371110
Show on old repository browser