예제 #1
0
INT LscFile::ILhLst::Alloc(char* sFile, char* sMode)
{
	LscH*		pLsH = NULL;
	PLC_FILE	pObj = NULL;

	INT			nKey	=-1;
	INT			hr		=-1;

	pLsH = this->Find(&nKey, sFile);
	if(pLsH && 0 <= nKey)											// if same file exists.
		return nKey+1;												// lua index starts from 1

	nKey	= FindEmpty();
	if(0 > nKey)													// all key is used. allowble key does not exist.
		return -1;

	hr = LcFile_Open(NULL,&pObj, sFile, sMode);
	if(LC_FAILED(hr))
	{
		LOGE("LscFile::ILhLst::Alloc::Err: %s\n", sFile);
		return -1;
	}

	pLsH	= new LscH;
	pLsH->pIns	= pObj;
	strcpy(pLsH->sName, sFile);

	vLst[nKey] = pLsH;

	return (nKey+1);
}
예제 #2
0
INT LscSmd::ILhLst::Alloc(LC_HANDLE* pOut, char* sFile, UINT dFlag)
{
	LscH*		pLsH = NULL;
	PLCX_SOUND	pObj = NULL	;

	INT		nKey =-1;
	INT		hr	 =-1;

	nKey = FindEmpty();	// 빈공간을 찾는다.

	if(-1 == nKey)		// 꽉차있음
		return -1;

	hr = LcxSmd_CreateSoundFromFile(NULL, &pObj, sFile);
	if(LC_FAILED(hr))
	{
		LOGI("LscSmd::ILhLst::Alloc Failed::%s ----\n", sFile);
		return -1;
	}

	pLsH	= new LscH;
	pLsH->pIns	= pObj;

	vLst[nKey] = pLsH;
	return (nKey+1);
}
예제 #3
0
void CreateTZones(){
	memset(TZones,255,sizeof TZones);
	bool Distributed=false;
	ZType ID=1;
	do{
		if(FindEmpty(ID)){
			FillTerrainZone(ID);
			ID++;
		}else Distributed=true;
	}while(!Distributed);
	Distributed=false;
	do{
		if(FindWEmpty(ID)){
			FillWZone(ID);
			ID++;
		}else Distributed=true;

	}while(!Distributed);
	CreateRZAMap();
};