DrawRotaGraphF(ch.x+FIELD_X,ch.y+FIELD_Y,1.0f,0.0f,graphics[motion->index[ch.img]],TRUE);
コード:
static int motion1[] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 };//ニュートラル
static int motion2_1[] =
{ 26, 27 }; // 前進 振り向き
static int motion2_2[] =
{ 28, 29, 30, 31, 32, 33, 34, 35, 37, 38 }; // 前進 歩き
static int motion3[] =
{ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 };//後退
static int motion4_1[] =
{ 78, 79, 80, 81, 82 };//しゃがむ 前傾
static int motion4_2[] =
{ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 };//じゃがむ 座る
static int motion4_3[] =
{ 96, 97, 98, 99, 100, 101 };//じゃがむ 立ち上がり
static int motion5_1[] =
{ 104, 105, 106, 107, 108, 109 };//ジャンプ 飛び
static int motion5_2[] =
{ 110, 111, 112, 113 };//ジャンプ 上昇
static int motion5_3[] =
{ 114, 115, 116, 117, 118, 119, 120 };//ジャンプ 回転
static int motion5_4[] =
{ 121, 122, 123 };//ジャンプ 下降
static int motion5_5[] =
{ 124, 125, 126, 127 };//ジャンプ 着地
static int motion5_6[] =
{ 128, 129 };//ジャンプ 立ち上がり
static int motion6_1[] =
{ 130, 131, 132, 133 };//2段ジャンプ 上昇
static int motion6_2[] =
{ 134, 135, 136, 137, 138, 139, 140 };//2段ジャンプ 回転
static int motion6_3[] =
{ 141, 142, 143 };//2段ジャンプ 下降
static int motion6_4[] =
{ 144, 145, 146, 147 };//2段ジャンプ 着地
static int motion6_5[] =
{ 148, 149 };//2段ジャンプ 立ち上がり
struct MotionSerialTable
{
int *index;
int num;
int pitch;
bool loop;
};
struct MotionSerialTable motion_serial1[];
struct MotionSerialTable motion_serial2[];
struct MotionSerialTable motion_serial3[];
struct MotionSerialTable motion_serial4[];
struct MotionSerialTable motion_serial5[];
struct MotionSerialTable motion_serial6[];
struct MotionTable
{
MotionSerialTable *motion;
}motion_table[];
#define ARRAYNUM(ary) (sizeof(ary)/sizeof(ary[0]))
static MotionSerialTable motion_serial1[] =
{
{ motion1, ARRAYNUM(motion1), 4, true },
};
static MotionSerialTable motion_serial2[] =
{
{ motion2_1, ARRAYNUM(motion2_1), 7, false },
{ motion2_2, ARRAYNUM(motion2_2), 7, true },
};
static MotionSerialTable motion_serial3[] =
{
{ motion3, ARRAYNUM(motion3), 8, true },
};
static MotionSerialTable motion_serial4[] =
{
{ motion4_1, ARRAYNUM(motion4_1), 4, false },
{ motion4_2, ARRAYNUM(motion4_2), 4, true },
{ motion4_3, ARRAYNUM(motion4_3), 4, true },
};
static MotionSerialTable motion_serial5[] =
{
{ motion5_1, ARRAYNUM(motion5_1), 2, false },
{ motion5_2, ARRAYNUM(motion5_2), 2, true },
{ motion5_3, ARRAYNUM(motion5_3), 2, true },
{ motion5_4, ARRAYNUM(motion5_4), 2, true },
{ motion5_5, ARRAYNUM(motion5_5), 2, true },
{ motion5_6, ARRAYNUM(motion5_6), 2, true },
};
static MotionSerialTable motion_serial6[] =
{
{ motion6_1, ARRAYNUM(motion6_1), 2, false },
{ motion6_2, ARRAYNUM(motion6_2), 2, true },
{ motion6_3, ARRAYNUM(motion6_3), 2, true },
{ motion6_4, ARRAYNUM(motion6_4), 2, true }
};
static MotionTable motion_table[] =
{
motion_serial1,
motion_serial2,
motion_serial3,
motion_serial4,
motion_serial5,
motion_serial6,
};
static MotionTable *motion_serial = &motion_table[0];