DXRuby1.4.5
@@ -1222,10 +1222,18 @@ | ||
1222 | 1222 | if( RTEST(sprite->voffset_sync) ) |
1223 | 1223 | { |
1224 | 1224 | 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 | + } | |
1229 | 1237 | } |
1230 | 1238 | collision->angle = NUM2FLOAT(sprite->vangle); |
1231 | 1239 | collision->scale_x = NUM2FLOAT(sprite->vscale_x); |
@@ -2972,8 +2972,6 @@ | ||
2972 | 2972 | } |
2973 | 2973 | else |
2974 | 2974 | { |
2975 | - picture = (struct DXRubyPicture_drawLine *)RenderTarget_AllocPictureList( rt, sizeof( struct DXRubyPicture_drawLine ) * 4 ); | |
2976 | - | |
2977 | 2975 | if( x1 > x2 ) |
2978 | 2976 | { |
2979 | 2977 | int temp = x1; |
@@ -2988,75 +2986,79 @@ | ||
2988 | 2986 | } |
2989 | 2987 | |
2990 | 2988 | /* DXRubyPictureオブジェクト設定 */ |
2991 | - picture[0].func = RenderTarget_drawLine_func; | |
2992 | - picture[0].x1 = x1 - rt->ox + 1; | |
2993 | - picture[0].y1 = y1 - rt->oy; | |
2994 | - picture[0].x2 = x2 - rt->ox; | |
2995 | - picture[0].y2 = y1 - rt->oy; | |
2996 | - picture[0].value = Qnil; | |
2997 | - picture[0].alpha = 0xff; | |
2998 | - picture[0].blendflag = 0; | |
2999 | - picture[0].col = col; | |
2989 | + picture = (struct DXRubyPicture_drawLine *)RenderTarget_AllocPictureList( rt, sizeof( struct DXRubyPicture_drawLine ) ); | |
2990 | + picture->func = RenderTarget_drawLine_func; | |
2991 | + picture->x1 = x1 - rt->ox + 1; | |
2992 | + picture->y1 = y1 - rt->oy; | |
2993 | + picture->x2 = x2 - rt->ox; | |
2994 | + picture->y2 = y1 - rt->oy; | |
2995 | + picture->value = Qnil; | |
2996 | + picture->alpha = 0xff; | |
2997 | + picture->blendflag = 0; | |
2998 | + picture->col = col; | |
3000 | 2999 | |
3001 | 3000 | /* リストデータに追加 */ |
3002 | - rt->PictureList[rt->PictureCount].picture = (struct DXRubyPicture *)&picture[0]; | |
3001 | + rt->PictureList[rt->PictureCount].picture = (struct DXRubyPicture *)picture; | |
3003 | 3002 | z = argc < 6 || argv[5] == Qnil ? 0.0f : NUM2FLOAT( argv[5] ); |
3004 | 3003 | rt->PictureList[rt->PictureCount].z = z; |
3005 | - picture[0].z = z; | |
3004 | + picture->z = z; | |
3006 | 3005 | rt->PictureCount++; |
3007 | 3006 | |
3008 | 3007 | /* DXRubyPictureオブジェクト設定 */ |
3009 | - picture[1].func = RenderTarget_drawLine_func; | |
3010 | - picture[1].x1 = x1 - rt->ox; | |
3011 | - picture[1].y1 = y2 - rt->oy; | |
3012 | - picture[1].x2 = x2 - rt->ox - 1; | |
3013 | - picture[1].y2 = y2 - rt->oy; | |
3014 | - picture[1].value = Qnil; | |
3015 | - picture[1].alpha = 0xff; | |
3016 | - picture[1].blendflag = 0; | |
3017 | - picture[1].col = col; | |
3008 | + picture = (struct DXRubyPicture_drawLine *)RenderTarget_AllocPictureList( rt, sizeof( struct DXRubyPicture_drawLine ) ); | |
3009 | + picture->func = RenderTarget_drawLine_func; | |
3010 | + picture->x1 = x1 - rt->ox; | |
3011 | + picture->y1 = y2 - rt->oy; | |
3012 | + picture->x2 = x2 - rt->ox - 1; | |
3013 | + picture->y2 = y2 - rt->oy; | |
3014 | + picture->value = Qnil; | |
3015 | + picture->alpha = 0xff; | |
3016 | + picture->blendflag = 0; | |
3017 | + picture->col = col; | |
3018 | 3018 | |
3019 | 3019 | /* リストデータに追加 */ |
3020 | - rt->PictureList[rt->PictureCount].picture = (struct DXRubyPicture *)&picture[1]; | |
3020 | + rt->PictureList[rt->PictureCount].picture = (struct DXRubyPicture *)picture; | |
3021 | 3021 | z = argc < 6 || argv[5] == Qnil ? 0.0f : NUM2FLOAT( argv[5] ); |
3022 | 3022 | rt->PictureList[rt->PictureCount].z = z; |
3023 | - picture[1].z = z; | |
3023 | + picture->z = z; | |
3024 | 3024 | rt->PictureCount++; |
3025 | 3025 | |
3026 | 3026 | /* DXRubyPictureオブジェクト設定 */ |
3027 | - picture[2].func = RenderTarget_drawLine_func; | |
3028 | - picture[2].x1 = x1 - rt->ox; | |
3029 | - picture[2].y1 = y1 - rt->oy; | |
3030 | - picture[2].x2 = x1 - rt->ox; | |
3031 | - picture[2].y2 = y2 - rt->oy - 1; | |
3032 | - picture[2].value = Qnil; | |
3033 | - picture[2].alpha = 0xff; | |
3034 | - picture[2].blendflag = 0; | |
3035 | - picture[2].col = col; | |
3027 | + picture = (struct DXRubyPicture_drawLine *)RenderTarget_AllocPictureList( rt, sizeof( struct DXRubyPicture_drawLine ) ); | |
3028 | + picture->func = RenderTarget_drawLine_func; | |
3029 | + picture->x1 = x1 - rt->ox; | |
3030 | + picture->y1 = y1 - rt->oy; | |
3031 | + picture->x2 = x1 - rt->ox; | |
3032 | + picture->y2 = y2 - rt->oy - 1; | |
3033 | + picture->value = Qnil; | |
3034 | + picture->alpha = 0xff; | |
3035 | + picture->blendflag = 0; | |
3036 | + picture->col = col; | |
3036 | 3037 | |
3037 | 3038 | /* リストデータに追加 */ |
3038 | - rt->PictureList[rt->PictureCount].picture = (struct DXRubyPicture *)&picture[2]; | |
3039 | + rt->PictureList[rt->PictureCount].picture = (struct DXRubyPicture *)picture; | |
3039 | 3040 | z = argc < 6 || argv[5] == Qnil ? 0.0f : NUM2FLOAT( argv[5] ); |
3040 | 3041 | rt->PictureList[rt->PictureCount].z = z; |
3041 | - picture[2].z = z; | |
3042 | + picture->z = z; | |
3042 | 3043 | rt->PictureCount++; |
3043 | 3044 | |
3044 | 3045 | /* DXRubyPictureオブジェクト設定 */ |
3045 | - picture[3].func = RenderTarget_drawLine_func; | |
3046 | - picture[3].x1 = x2 - rt->ox; | |
3047 | - picture[3].y1 = y1 - rt->oy + 1; | |
3048 | - picture[3].x2 = x2 - rt->ox; | |
3049 | - picture[3].y2 = y2 - rt->oy; | |
3050 | - picture[3].value = Qnil; | |
3051 | - picture[3].alpha = 0xff; | |
3052 | - picture[3].blendflag = 0; | |
3053 | - picture[3].col = col; | |
3046 | + picture = (struct DXRubyPicture_drawLine *)RenderTarget_AllocPictureList( rt, sizeof( struct DXRubyPicture_drawLine ) ); | |
3047 | + picture->func = RenderTarget_drawLine_func; | |
3048 | + picture->x1 = x2 - rt->ox; | |
3049 | + picture->y1 = y1 - rt->oy + 1; | |
3050 | + picture->x2 = x2 - rt->ox; | |
3051 | + picture->y2 = y2 - rt->oy; | |
3052 | + picture->value = Qnil; | |
3053 | + picture->alpha = 0xff; | |
3054 | + picture->blendflag = 0; | |
3055 | + picture->col = col; | |
3054 | 3056 | |
3055 | 3057 | /* リストデータに追加 */ |
3056 | - rt->PictureList[rt->PictureCount].picture = (struct DXRubyPicture *)&picture[3]; | |
3058 | + rt->PictureList[rt->PictureCount].picture = (struct DXRubyPicture *)picture; | |
3057 | 3059 | z = argc < 6 || argv[5] == Qnil ? 0.0f : NUM2FLOAT( argv[5] ); |
3058 | 3060 | rt->PictureList[rt->PictureCount].z = z; |
3059 | - picture[3].z = z; | |
3061 | + picture->z = z; | |
3060 | 3062 | rt->PictureCount++; |
3061 | 3063 | } |
3062 | 3064 |
@@ -590,7 +590,7 @@ | ||
590 | 590 | { |
591 | 591 | struct DXRubyFont *font = DXRUBY_GET_STRUCT( Font, self ); |
592 | 592 | int intBlackBoxX, intBlackBoxY, intCellIncX, intPtGlyphOriginX, intPtGlyphOriginY, intTmAscent, intTmDescent; |
593 | - VALUE ary[6]; | |
593 | + VALUE ary[7]; | |
594 | 594 | |
595 | 595 | Font_getInfo_internal( vstr, font, &intBlackBoxX, &intBlackBoxY, &intCellIncX, &intPtGlyphOriginX, &intPtGlyphOriginY, &intTmAscent, &intTmDescent ); |
596 | 596 |
@@ -1,10 +1,10 @@ | ||
1 | 1 | /* |
2 | 2 | ################################### |
3 | 3 | # |
4 | -# DXRuby 1.4.4 | |
4 | +# DXRuby 1.4.5 | |
5 | 5 | # |
6 | 6 | ################################### |
7 | 7 | */ |
8 | -#define DXRUBY_VERSION "1.4.4" | |
8 | +#define DXRUBY_VERSION "1.4.5" | |
9 | 9 | |
10 | 10 | //#define DXRUBY15 |