/*
 * $Id: bg_attr2.h,v 1.1 2003/02/07 18:15:44 wheeler Exp $
 * $Log: bg_attr2.h,v $
 * Revision 1.1  2003/02/07 18:15:44  wheeler
 * Fox's version of libultra and friends.
 *
 * Revision 1.1  1996/11/21  05:21:12  hayakawa
 * Initial revision
 *
 */

#ifndef __BG_ATTR2_H_
#define __BG_ATTR2_H_

#include "bg_attr_sc.h"
#include "bg_bitmap1x.h"	/* BG_Bitmap1x */
#include "zpos_t.h"		/* zpos_t */
#include "u64types.h"		/* size_t */

/*
 * ＢＧアトリビュート定義構造体2
 * ポリゴン専用型
 */
typedef struct bg_attr2_s {
    unsigned int 	hidden:1; /* 1:非表示 */
    unsigned int 	xSiz:9;	/* 横キャラクタ数 1-255 */
    unsigned int 	ySiz:9;	/* 縦キャラクタ数 1-255 */
    zpos_t 		zPos;	/* 優先度(Z座標) */
    ScData 		*scData; /* ＳＣデータへのポインタ */
    BG_Bitmap1x 	*bitmap; /* ビットマップ */
    Mtx 		*matrix; /* スケール・位置・向きなどの行列 */
    Mtx 		*project; /* 射影行列(NULLの時は全体の射影行列) */
    Vtx 		*vertex; /* Vtx(lt,rt,lb,rb)(NULLの時は内部で計算する) */
} BG_Attribute2;

#ifdef __cplusplus
extern "C" {
#endif

#define bg2_isenable(p1) 	((p1)->hidden == 0)
#define bg2_enable(p1) 		((p1)->hidden = 0)
#define bg2_disable(p1) 	((p1)->hidden = 1)
#define bg2_setMatrix(p1, m1) 	((p1)->matrix = (m1))
void
bg2_init(
    BG_Attribute2 *const bg1,
    const int hsize,		/* 横のキャラクタ数 */
    const int vsize,		/* 縦のキャラクタ数 */
    BG_Bitmap1x	*const bm1,	/* 対応するビットマップ番号 */
    void *const sc1,		/*  */
    const int z			/*  */
);

void bg2_draw( BG_Attribute2 *const bg2, Gfx **glistpp );

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* __BG_ATTR2_H_ */
