////////////////////////////////////////////////////////////////////////////
//  The岟晇 for PS-BB				:	XML棉袄庢摼
//
//	create	2003/02/04	嶳怷		:	
//
////////////////////////////////////////////////////////////////////////////

new	Token[32], TokenPtr;							//	陌篙張棟梡

new	gtcName[13][] = {								//	Xml偐傜偺棉袄揥奐柤
	"eneTexTbl",
	"eneEntryPos",
	"bossTex",
	"pTex",
	"bossInfo",
	"BossParam",
	"PlayerRect",
	"BossRect",
	"BossAtkRect",
	"",
	"",
	"",
	""
};

/****************************/
/*	陌篙偺愗傝弌偟(弶婜壔)	*/
/****************************/
InitToken()
{
	TokenPtr = 0;
	strcpy(Token, "");
}

/****************************/
/*	陌篙偺愗傝弌偟			*/
/****************************/
stock GetToken(buf[])
{
	new	cnt = 0;

	while(buf{TokenPtr} && buf{TokenPtr} != 0x2C){
		Token{cnt++} = buf{TokenPtr++};
	}
	Token{cnt} = 0;
	TokenPtr++;

	return cnt;
}

/********************************/
/*	Xml傛傝兽擅薨纻饟W奐	*/
/********************************/
GetTableCommon(id)
{
	new	xmltag:parent, xmltag:child;
	new	buf[192], pbuf[64];
	new	i, entry;

	parent = domFindTag(domRoot(), "PARTS", gtcName[id]);
	child = domFirstChild(parent);
	entry = 0;
	for(; child ; child = domNext(child)){
		domGetData(child, _, buf);
		for(i=0; i<256; i++) pbuf{i} = 0;
		strpack(pbuf, buf);
		InitToken();
		while(GetToken(pbuf)){
			switch(id){
				case 0:	eneTexTbl[entry] = atoi(Token);
				case 1:	eneEntryPos[entry] = atoi(Token);
				case 2:	bossTex[entry] = atoi(Token);
				case 3:	pTex[entry] = atoi(Token);
				case 4:	bossInfo[entry] = atoi(Token);
				case 5:	BossParam[entry] = atoi(Token);
				case 6:	PlayerRect[entry] = float(atoi(Token));
				case 7:	BossRect[entry] = float(atoi(Token));
				case 8:	BossAtkRect[entry] = float(atoi(Token));
			}
			entry++;
		}
	}
}

