Ejemplo n.º 1
0
bool ZMapDesc::Open(RBspObject* pBspObject)
{
	m_SpawnManager.Clear();

	const size_t nSpawnTokLen = strlen(ZTOK_SPAWN);
	const size_t nWaitCamTokLen = strlen(ZTOK_WAIT_CAMERA_POS);
	const size_t nSmokeSSTokLen = strlen(ZTOK_SMOKE_SS);
	const size_t nSmokeTSTokLen = strlen(ZTOK_SMOKE_TS);
	const size_t nSmokeSTTokLen = strlen(ZTOK_SMOKE_ST);

	RDummyList* pDummyList = pBspObject->GetDummyList();

	for (RDummyList::iterator itor = pDummyList->begin(); itor != pDummyList->end(); ++itor)
	{
		RDummy* pDummy = (*itor);
		const char* szDummyName = pDummy->szName.c_str();

		if (!strnicmp(pDummy->szName.c_str(), ZTOK_SPAWN, nSpawnTokLen))
		{
			char szSpawnName[256];
			strcpy(szSpawnName, szDummyName);

			m_SpawnManager.AddSpawnData(szSpawnName, pDummy->Position, pDummy->Direction);
		}
		else if (!strnicmp(pDummy->szName.c_str(), ZTOK_WAIT_CAMERA_POS, nWaitCamTokLen))
		{
			m_WaitCamDir = pDummy->Direction;
			m_WaitCamPos = pDummy->Position;
		}
		else if(!strnicmp(pDummy->szName.c_str(), ZTOK_SMOKE_SS , nSmokeSSTokLen ))
		{
			ZMapSmokeSS* smkSS = new ZMapSmokeSS;

			smkSS->m_vPos = pDummy->Position;
			smkSS->m_vDir = pDummy->Direction;
			smkSS->m_Name = pDummy->szName;

			m_SmokeDummyMgr.push_back(smkSS);
		}
		else if(!strnicmp(pDummy->szName.c_str(), ZTOK_SMOKE_TS , nSmokeTSTokLen ))
		{
			ZMapSmokeTS* smkTS = new ZMapSmokeTS;

			smkTS->m_vPos = pDummy->Position;
			smkTS->m_vDir = pDummy->Direction;
			smkTS->m_Name = pDummy->szName;

			m_SmokeDummyMgr.push_back(smkTS);
		}
		else if(!strnicmp(pDummy->szName.c_str(), ZTOK_SMOKE_ST , nSmokeSTTokLen ))
		{
			ZMapSmokeST* smkST = new ZMapSmokeST;

			smkST->m_vPos = pDummy->Position;
			smkST->m_vDir = pDummy->Direction;
			smkST->m_Name = pDummy->szName;

			m_SmokeDummyMgr.push_back(smkST);
		}
		else if(!strnicmp(pDummy->szName.c_str(), ZTOK_DUMMY_LINK , (int)strlen(ZTOK_DUMMY_LINK) ))
		{
			char szName[32];
			strcpy(szName, pDummy->szName.c_str());
			int idx = (int)strlen(ZTOK_DUMMY_LINK);
			int nLinkIndex = atoi(&szName[idx]) - 1;
			
			if ((nLinkIndex >= 0) && (nLinkIndex < MAX_QUEST_MAP_SECTOR_COUNT))
			{
				m_QuestMapDesc.m_vLinks[nLinkIndex] = pDummy->Position;
			}
		}

	}

	m_SmokeSSDrawBackupTime = 0.f;
	m_SmokeSTDrawBackupTime = 0.f;
	m_SmokeTSDrawBackupTime = 0.f;

	m_StartTime = timeGetTime();

	return true;
}
void ZInterfaceBackground::LoadMesh( void)
{
#ifdef _FASTDEBUG
	return;
#endif

	if ( m_pLogin == NULL)
	{
		m_pLogin = new RBspObject();

#ifndef _DEBUG
		const char* descExt = "xml";
#else
		const char* descExt = "xml";
#endif
		m_pLogin->Open( DIR_LOGIN"/login.rs", descExt);

		RDummyList* pDummyList = m_pLogin->GetDummyList();

		for ( RDummyList::iterator itor = pDummyList->begin();  itor != pDummyList->end();  ++itor)
		{
			RDummy* pDummy = *itor;

			if( stricmp( pDummy->szName.c_str(), "camera_pos 01" ) == 0 )
			{
				m_vCamPosSt = pDummy->Position;
				m_vCamDirSt = pDummy->Direction;
			}
			else if( stricmp( pDummy->szName.c_str(), "camera_pos 02" ) == 0 )
			{
				m_vCamPosEd = pDummy->Position;
				m_vCamDirEd = pDummy->Direction;
			}
			else if( stricmp( pDummy->szName.c_str(), "spawn_solo_101" ) == 0 )
			{
				m_vCharPos = pDummy->Position;
				m_vCharDir = pDummy->Direction;
			}
		}

		RMapObjectList* pMapObject = m_pLogin->GetMapObjectList();

		list<ROBJECTINFO*>::iterator it;

		ROBJECTINFO* pInfo = NULL;

		for(it = pMapObject->begin();it!=pMapObject->end();it++ ) {

			pInfo = (*it);

			if(!pInfo->pVisualMesh) continue;

			if(pInfo) {// 필요하면 xml 로 빼기..
				string str = "login_obj_ef_sky02.elu";
				if( pInfo->name == str ) {
					pInfo->pVisualMesh->SetUVAnimation(-0.055f,0.f);
				}
			}
		}
			

		// Map description
		if ( m_pMapDesc == NULL)
		{
			m_pMapDesc = new ZMapDesc();
			m_pMapDesc->Open( m_pLogin);

			if( m_pMapDesc ) {

				char szBuf[128];
				sprintf( szBuf, "%s/smoke.xml", DIR_LOGIN );
				m_pMapDesc->LoadSmokeDesc(szBuf);
				mlog("Load smoke description mesh.\n");
			}

		}

		m_pLogin->SetMapObjectOcclusion( true );
	}
}