/* _maliemacro.txt */

#ifndef _MALIEMACOR_H_
#define _MALIEMACOR_H_

/* DOLL マクロ */
#include "_dollmacro.txt"

#define MAX_PATH 128

static int path[MAX_PATH];
static int path2[MAX_PATH];

/* ----------------------------------------------------------------------- */
/* フォルダ構成 */
#define _data_folder  ".\\data\\"
#define _bg_folder    _data_folder "picture\\bg\\"
#define _cg_folder    _data_folder "picture\\event\\"
#define _se_folder    ".\\data\\Se\\"
#define _bgm_folder   ".\\data\\Bgm\\"
#define _voice_folder _data_folder "Voice\\"

#define _bgm(n)   Sound_Stop(0); Sound_Sync(0); &sound(0, _bgm_folder n ".wav"); &play(0)
#define _voice(n) Sound_Stop(2); Sound_Sync(2); &sound(2, _voice_folder n ".mp3"); &play(2)

/* ----------------------------------------------------------------------- */
/* レイヤー識別子 */
#define IDL_Adv_BG           1 /* 背景              */
#define IDL_Adv_Message      3 /* メッセージ        */
#define IDL_Adv_Novel        5 /* ノベル            */
#define IDL_Adv_Chara       10 /* 立ちキャラ(Malie) */
#define IDL_Adv_Select     104 /* 選択              */

#define LAM_Adv_LoadBG        303

/* ----------------------------------------------------------------------- */
/* DollSelectLayer : 選択レイヤー処理 */
#define SLC_ClearButton 5001 /* ボタンのクリア */
#define SLC_AddButton   5002 /* ボタンの追加   */

/* layer 変数に 選択レイヤーを設定 */
#define _layer_Select() /*layer = System_GetScreen(IDS_Adv);*/ layer = FrameLayer_GetItem(adv, IDL_Adv_Select)

#define _clearbutton()         _layer_Select(); FrameLayer_SendMessage(layer, SLC_ClearButton, NULL, NULL)
#define _addbutton(id, string) _layer_Select(); FrameLayer_SendMessage(layer, SLC_AddButton, id, string)
#define _beginselect()         _layer_Select(); FrameLayer_SetVisible(layer, TRUE)

/* ----------------------------------------------------------------------- */
/* 背景 メッセージ */

/* layer 変数に 背景レイヤーを設定 */
#define ASM_LoadBG 1000

#define _layer_BG() /*app = System_GetScreen(IDS_Lagnalock);*/ FrameLayer_SendMessage(app, LAM_Adv_LoadBG    , name, NULL )

/* layer 変数に 立ちキャラレイヤーを設定 */
#define _layer_Chara() /*layer = System_GetScreen(IDS_Adv);*/ layer = FrameLayer_GetItem(adv, IDL_Adv_Chara)

/* ----------------------------------------------------------------------- */
/* 背景/イベント読み込み */
#define _loadbg_mgf(n) FrameLayer_SendMessage(app, LAM_Adv_LoadBG, 0, _bg_folder n ".png")
#define _loadcg_mgf(n) FrameLayer_SendMessage(app, LAM_Adv_LoadBG, 0, _cg_folder n ".png")

#define _bg_load_mgf(n) System_TakeScreen(0); _chara_hide(NULL); _loadbg_mgf(n); System_TakeScreen(1); _ol; System_TakeScreen(2)
//#define _cg_load_mgf(n) System_TakeScreen(0); _chara_hide(NULL); _loadcg_mgf(n); System_TakeScreen(1); _ol; System_TakeScreen(2)

#endif /* _MALIEMACOR_H_ */

/* eof */