/* obj.txt */

#ifndef _OBJ_TXT_
#define _OBJ_TXT_

int obj;
RECT  r;
POINT pt;

/* ------------------------------------------------------------------------- */
/* bZ[W */
#define IOLM_Message        100
#define IOLM_LoadImage      (IOLM_Message+ 1) /* C[W̃[h     */
#define IOLM_PlayFade       (IOLM_Message+ 2) /* tF[hĐ         */
#define IOLM_InitMotion     (IOLM_Message+ 3) /* ړ           */
#define IOLM_PlayMotion     (IOLM_Message+ 4) /* ړĐ             */
#define IOLM_InitAnime      (IOLM_Message+ 5) /* Aj[V */
#define IOLM_PlayAnime      (IOLM_Message+ 6) /* Aj[VĐ   */
#define IOLM_SetBlend       (IOLM_Message+ 7) /* uh̐ݒ       */
#define IOLM_SetImageRect   (IOLM_Message+ 8) /* C[W`̐ݒ   */
#define IOLM_Clear          (IOLM_Message+ 9) /* NA               */
#define IOLM_LoadMask       (IOLM_Message+10) /* }XÑ[h       */
#define IOLM_SetRect        (IOLM_Message+11) /* `̐ݒ           */
#define IOLM_InitMotionRect (IOLM_Message+12) /* `ړ       */
#define IOLM_SetFadeRange   (IOLM_Message+13) /* tF[hݒ       */
#define IOLM_SetPos         (IOLM_Message+14) /* ʒuݒ             */
#define IOLM_SetVisible     (IOLM_Message+15) /* \ݒ             */
#define IOLM_SetText        (IOLM_Message+16) /* eLXgݒ         */

/* FADE_ */
#define FADE_FI      0 /* tF[hC         */
#define FADE_FO      1 /* tF[hAEg       */
#define FADE_FIFO    2 /* tF[hC^AEg */

/* ------------------------------------------------------------------------- */
/* ړtO */
#define MOTION_F_RECT 0x2000
#define MOTION_F_SRC  0x1000
#define MOTION_T_MASK 0x00FF
#define MOTION_T_LINE 0x0001
#define MOTION_T_SIN  0x0002
#define MOTION_T_COS  0x0003

/*  */
/* ʒuw */
#define MOTION_LINE         MOTION_T_LINE /* ` */
#define MOTION_SIN          MOTION_T_SIN  /* SIN      */
#define MOTION_COS          MOTION_T_COS
/* `w */
#define MOTION_RECT_LINE    MOTION_T_LINE|MOTION_F_RECT /* ` */
#define MOTION_RECT_SIN     MOTION_T_SIN |MOTION_F_RECT /* SIN      */
#define MOTION_RECT_COS     MOTION_T_COS |MOTION_F_RECT

/*  */
/* ʒuw */
#define MOTION_SRC_LINE     MOTION_T_LINE|MOTION_F_SRC /* ` */
#define MOTION_SRC_SIN      MOTION_T_SIN |MOTION_F_SRC /* SIN      */
#define MOTION_SRC_COS      MOTION_T_COS |MOTION_F_SRC
/* `w */
#define MOTION_SRCRECT_LINE MOTION_T_LINE|MOTION_F_SRC|MOTION_F_RECT /* ` */
#define MOTION_SRCRECT_SIN  MOTION_T_SIN |MOTION_F_SRC|MOTION_F_RECT /* SIN      */
#define MOTION_SRCRECT_COS  MOTION_T_COS |MOTION_F_SRC|MOTION_F_RECT

/* BLEND_ */
#define BLEND_NORMAL 1 /* ʏ */
#define BLEND_ADD    2 /* Z */
#define BLEND_SUB    3 /* Z */
#define BLEND_MUL    4 /* Z */
#define BLEND_MASK   0x10 /* }XN */

/* ------------------------------------------------------------------------- */
/* }N */

#define FPS_CTRL(fps) \
	FrameLayer_SendMessage(malie, MSM_SetFrameRate, fps, 0)

/* 擾 */
#define _obj(i) \
	obj = FrameLayer_SendMessage(malie, MSM_GetObject, i, 0);

/* C[Wǂݍ */
#define _obj_IMAGE(image, mask) \
	FrameLayer_SendMessage(obj, IOLM_LoadImage, image, mask)

/* C[W`̐ݒ */
#define _obj_IMAGE_RECT(_l, _t, _r, _b) \
	RECT_Set(r, _l, _t, _r, _b); \
	FrameLayer_SendMessage(obj, IOLM_SetImageRect, 0, &r)

/* }XNǂݍ   */
#define _obj_MASK(color, mask) \
	FrameLayer_SendMessage(obj, IOLM_LoadMask , color, mask)

/*  */
#define _obj_CLEAR() \
	FrameLayer_SendMessage(obj, IOLM_Clear, 0, 0)

/* `ݒ */
#define _obj_RECT(_l, _t, _r, _b) \
	RECT_Set(r, _l, _t, _r, _b); \
	FrameLayer_SendMessage(obj, IOLM_SetRect, 0, &r)

/* tF[hݒ */
#define _obj_FADE_RANGE(min, max) \
	FrameLayer_SendMessage(obj, IOLM_SetFadeRange, min, max)

/* FadeIn */
#define _obj_FI(time) \
	FrameLayer_SendMessage(obj, IOLM_PlayFade, FADE_FI, time)

/* FadeOut */
#define _obj_FO(time) \
	FrameLayer_SendMessage(obj, IOLM_PlayFade, FADE_FO, time)

/* FadeIn */
#define _obj_FIFO(time) \
	FrameLayer_SendMessage(obj, IOLM_PlayFade, FADE_FIFO, time)

/* ʒuݒ */
#define _obj_POS(x, y) \
	FrameLayer_SendMessage(obj, IOLM_SetPos, x, y)

/* \ݒ */
#define _obj_SHOW(show) \
	FrameLayer_SendMessage(obj, IOLM_SetVisible, 0, show)

/* uh */
#define _obj_BLEND(blend) \
	FrameLayer_SendMessage(obj, IOLM_SetBlend, blend, 0)

/*  */
#define _obj_MOTION(_x, _y, type, time) \
	pt.x = _x; pt.y = _y; \
	FrameLayer_SendMessage(obj, IOLM_InitMotion, type, &pt); \
	FrameLayer_SendMessage(obj, IOLM_PlayMotion, type, time)

#define _obj_MOTION_RECT(_l, _t, _r, _b, type, time) \
	RECT_Set(r, _l, _t, _r, _b); \
	FrameLayer_SendMessage(obj, IOLM_InitMotion, type, &r); \
	FrameLayer_SendMessage(obj, IOLM_PlayMotion, type, time)

#define _obj_TEXT(color, text) \
	FrameLayer_SendMessage(obj, IOLM_SetText, color, text)

#define texteffect(text) \
	_obj(0) \
	{ \
		_obj_RECT(0, 400, 640, 440); \
		_obj_TEXT(0, text); \
		_obj_SHOW(TRUE); \
		_obj_FI(500); \
		WAIT(500); \
		WAIT(2500); \
		_obj_FO(500); \
		WAIT(500); \
		_obj_SHOW(FALSE); \
	}

#define texteffect_ex(text_a, text_b) \
	_obj(0) \
	{ \
		_obj_RECT(0,400,640,440); \
		_obj_TEXT(0,text_a); \
		_obj_SHOW(TRUE); \
		_obj_FI(500); \
	} \
	\
	_obj(1) \
	{ \
		_obj_RECT(0,420,640,460); \
		_obj_TEXT(0,text_b); \
		_obj_SHOW(TRUE); \
		_obj_FI(500); \
	} \
	\
	WAIT(3000); \
	\
	_obj(0)		_obj_FO(500); \
	_obj(1)		_obj_FO(500); \
	\
	WAIT(500); \
	\
	_obj(0)		_obj_SHOW(FALSE);
	_obj(1)		_obj_SHOW(FALSE);

#endif /* _OBJ_TXT_ */

/* eof */