Пример #1
0
//-----------------------------------------------------------------------------
// Purpose: Prev 나 Next를 눌러서 선택된 캐릭터가 변경된 경우.
//-----------------------------------------------------------------------------
void CUICreateChar::ChangeSelJob()
{
//강동민 수정 시작 클로즈 2차 작업	08.18
	// FIXME : 모든 캐릭터가 다 나오면 주석을 풀것.
	//if(m_iSelectedJob < 0) 
	//	m_iSelectedJob = TOTAL_JOB - 1;
	//m_iSelectedJob	= m_iSelectedJob % TOTAL_JOB;

	// FIXME : 클로즈 2차때 나이트와 힐러를 보여주기 위한 부분.
	if(m_iSelectedJob < 0) 
		m_iSelectedJob = MAXJOB - 1;

	if(m_iSelectedJob > MAXJOB - 1)
		m_iSelectedJob = 0;
	
	m_sbSelectedHair= 0;
	m_sbSelectedFace= 0;
	m_iSelectedColor= 0;
	
//강동민 수정 끝 클로즈 2차 작업		08.18

	m_fRotDelta		= 0.0f;
	m_fZDelta		= 0.0f;
	if(!m_pWorld)			return;
	
	// 카메라 설정, 캐릭터 위치 설정.	
	const int iMarker			= _aiMarkerEntities[m_iSelectedJob];
	CEntity *penMarker			= m_pWorld->EntityFromID(iMarker);
	//penMarker->SetSkaModel(_aJobFileName[m_iSelectedJob]);

	CModelInstance* pMI	= penMarker->GetModelInstance();
	if(pMI)
	{
		//pMI->mi_iFaceMesh	= -1;
		//pMI->mi_iFaceTexture= -1;
		//pMI->mi_iHairMesh	= -1;
		//pMI->mi_iHairTexture= -1;

		((CPlayerEntity*)CEntity::GetPlayerEntity(0))->ChangeFaceMesh(pMI, m_iSelectedJob, 0);
		((CPlayerEntity*)CEntity::GetPlayerEntity(0))->ChangeHairMesh(pMI, m_iSelectedJob, 0);

		pMI->mi_iFaceMesh	= -1;
		pMI->mi_iHairMesh	= -1;

		if(_pNetwork->wo_iNumOfItem > 0)
		{
			// 슬롯의 캐릭터에 장비를 장착한 모습을 보여줘야 하는 부분...
			// 상의 무기 하의 방패 장갑 신발
			for(int i = 0; i < 6; ++i)
			{
				const SLONG lWear = _aiBasicWearing[m_iSelectedJob][i];
				if(lWear > 0)
				{
					CItemData* pID = _pNetwork->GetItemData(lWear);
					_pGameState->DeleteDefaultArmor(pMI, pID->GetWearingPosition(), m_iSelectedJob);
					_pGameState->WearingArmor(pMI, *pID);					
				}
			}
		}

		//INDEX idWalk		= ska_GetIDFromStringTable(_afnIdleAnim[m_iSelectedJob]);
		//pMI->AddAnimation(idWalk,AN_LOOPING|AN_NORESTART|AN_CLEAR,1,0);
		// 선택한 캐릭터에 대한 설명을 보여줍니다.
		GetCharInfo();
	}	
}
Пример #2
0
/*
 * Copy entity from another entity of same class.
 * NOTES:
 *  - Doesn't copy placement, it must be done on creation.
 *  - Entity must be initialized afterwards.
 */
void CEntity::Copy(CEntity &enOther, ULONG ulFlags)
{
  BOOL bRemapPointers = ulFlags & COPY_REMAP;

  // copy base class data
  en_RenderType     = enOther.en_RenderType;
  en_ulPhysicsFlags = enOther.en_ulPhysicsFlags;
  en_ulCollisionFlags = enOther.en_ulCollisionFlags;
  en_ulFlags        = enOther.en_ulFlags &
    ~(ENF_SELECTED|ENF_FOUNDINGRIDSEARCH|ENF_VALIDSHADINGINFO|ENF_INRENDERING);
  en_ulSpawnFlags   = enOther.en_ulSpawnFlags;

  // if this is a brush
  if ( enOther.en_RenderType == RT_BRUSH || en_RenderType == RT_FIELDBRUSH) {
    // there must be no existing brush
    ASSERT(en_pbrBrush == NULL);
    // create a new empty brush in the brush archive of current world
    en_pbrBrush = en_pwoWorld->wo_baBrushes.ba_abrBrushes.New();
    en_pbrBrush->br_penEntity = this;
    // copy the brush
    if (_bMirrorAndStretch) {
      en_pbrBrush->Copy(*enOther.en_pbrBrush, _fStretch, _wmtMirror!=WMT_NONE);
    } else {
      en_pbrBrush->Copy(*enOther.en_pbrBrush, 1.0f, FALSE);
    }
  // if this is a terrain
  } else if( enOther.en_RenderType == RT_TERRAIN) {
    ASSERT(en_ptrTerrain == NULL);
    // create a new empty terrain in the brush archive of current world
    en_ptrTerrain = en_pwoWorld->wo_taTerrains.ta_atrTerrains.New();
    en_ptrTerrain->tr_penEntity = this;
    // Copy terrain
    TR_CopyTerrain(en_ptrTerrain,enOther.en_ptrTerrain);
    // Update terrain shadowmap
    Matrix12 mTerrain;
    TR_GetMatrixFromEntity(mTerrain,en_ptrTerrain);
    TR_UpdateShadowMap(en_ptrTerrain,mTerrain,FLOATaabbox3D());
  // if this is a model
  } if ( enOther.en_RenderType == RT_MODEL || en_RenderType == RT_EDITORMODEL) {
    // if will not initialize
    if (!(ulFlags&COPY_REINIT)) {
      ASSERT(en_pmoModelObject==NULL);
      ASSERT(en_psiShadingInfo==NULL);
      if(en_pmoModelObject!=NULL) {
        delete en_pmoModelObject;
      }
      if(en_psiShadingInfo!=NULL) {
        delete en_psiShadingInfo;
      }
      // create a new model object
      en_pmoModelObject = new CModelObject;
      en_psiShadingInfo = new CShadingInfo;
      en_ulFlags &= ~ENF_VALIDSHADINGINFO;
      // copy it
      en_pmoModelObject->Copy(*enOther.en_pmoModelObject);
    }
  // if this is ska model
  } else if ( enOther.en_RenderType == RT_SKAMODEL || en_RenderType == RT_SKAEDITORMODEL) {
      ASSERT(en_psiShadingInfo==NULL);
      if(en_psiShadingInfo!=NULL) {
        delete en_psiShadingInfo;
      }
      en_psiShadingInfo = new CShadingInfo;
      en_ulFlags &= ~ENF_VALIDSHADINGINFO;
      ASSERT(en_pmiModelInstance==NULL);
      if(en_pmiModelInstance!=NULL) {
        DeleteModelInstance(en_pmiModelInstance);
      }
      en_pmiModelInstance = CreateModelInstance("");
      // copy it
      GetModelInstance()->Copy(*enOther.GetModelInstance());
  }

  // copy the parent pointer
  if (bRemapPointers) {
    en_penParent = FindRemappedEntityPointer(enOther.en_penParent);
  } else {
    en_penParent = enOther.en_penParent;
  }
  // if the entity has a parent
  if (en_penParent!=NULL) {
    // create relative offset
    en_plRelativeToParent = en_plPlacement;
    en_plRelativeToParent.AbsoluteToRelativeSmooth(en_penParent->en_plPlacement);
    // link to parent
    en_penParent->en_lhChildren.AddTail(en_lnInParent);
  }

  // copy the derived class properties
  CopyEntityProperties(enOther, ulFlags);

}