• R/O
  • SSH
  • HTTPS

dxruby: Commit


Commit MetaInfo

Revision538 (tree)
Time2016-08-21 15:02:35
Authormirichi

Log Message

Sprite#offset_sync=trueの場合のエラーチェックがおかしかったので修正

Change Summary

Incremental Difference

--- branches/1.5dev/collision.c (revision 537)
+++ branches/1.5dev/collision.c (revision 538)
@@ -1222,10 +1222,18 @@
12221222 if( RTEST(sprite->voffset_sync) )
12231223 {
12241224 struct DXRubyImage *image;
1225- DXRUBY_CHECK_IMAGE( sprite->vimage );
1226- image = DXRUBY_GET_STRUCT( Image, sprite->vimage );
1227- collision->base_x -= (sprite->vcenter_x == Qnil ? image->width / 2 : NUM2FLOAT(sprite->vcenter_x));
1228- collision->base_y -= (sprite->vcenter_y == Qnil ? image->height / 2 : NUM2FLOAT(sprite->vcenter_y));
1225+ if( sprite->vcenter_x == Qnil || sprite->vcenter_y == Qnil )
1226+ {
1227+ DXRUBY_CHECK_IMAGE( sprite->vimage );
1228+ image = DXRUBY_GET_STRUCT( Image, sprite->vimage );
1229+ collision->base_x -= sprite->vcenter_x == Qnil ? image->width / 2 : NUM2FLOAT(sprite->vcenter_x);
1230+ collision->base_y -= sprite->vcenter_y == Qnil ? image->height / 2 : NUM2FLOAT(sprite->vcenter_y);
1231+ }
1232+ else
1233+ {
1234+ collision->base_x -= NUM2FLOAT(sprite->vcenter_x);
1235+ collision->base_y -= NUM2FLOAT(sprite->vcenter_y);
1236+ }
12291237 }
12301238 collision->angle = NUM2FLOAT(sprite->vangle);
12311239 collision->scale_x = NUM2FLOAT(sprite->vscale_x);
Show on old repository browser