예제 #1
0
파일: Ase.cpp 프로젝트: RinM/CGA
void CLoadASE::ReadAseFile(t3DModel *pModel)
{
	tMaterialInfo newMaterial = {0};
	tMaterialInfo newNormalMap = {0};
	t3DObject     newObject   = {0};
				
	int i = 0;	

	pModel->numOfObjects   = GetObjectCount();

	pModel->numOfMaterials = GetMaterialCount();

	for(i = 0; i < pModel->numOfMaterials; i++)
	{
		pModel->pMaterials.push_back(newMaterial);
		GetTextureInfo(&(pModel->pMaterials[i]), i + 1);
	}

	for(i = 0; i < pModel->numOfObjects; i++)
	{	
		pModel->pObject.push_back(newObject);
		pModel->pObject[i].materialID = -1;

		MoveToObject(i + 1);

		ReadObjectInfo(pModel, &(pModel->pObject[i]), i + 1);
		ReadObjectData(pModel, &(pModel->pObject[i]), i + 1);
		
	}

}
예제 #2
0
ByteStream& ShortInt::BinaryRead(ByteStream& Is_, Boolean* Ok_)
{
  Boolean RdChk_;
  if (!Ok_)
    Ok_ = &RdChk_;

  *Ok_ = ReadObjectData(*this, Is_, FALSE);
  if (*Ok_ && Is_.iread((char*)(&_Value), DataSize()).good())
    SetIOstate(TRUE, IO_CLEAR, TRUE);

  SetIOstate(FALSE, IO_STREAMERROR);
  ReturnReadValid(Is_, Ok_);
  return Is_;
}
예제 #3
0
ByteStream& ShortInt::BinaryIgnore(ByteStream& Is_, Boolean* Ok_)
{
  Boolean RdChk_;
  if (!Ok_)
    Ok_ = &RdChk_;

  *Ok_ = ReadObjectData(*this, Is_, TRUE);
  if (*Ok_ && Is_.iseekg(DataSize(), ios::cur).good())
    SetIOstate(TRUE, IO_CLEAR, TRUE);

  SetIOstate(FALSE, IO_STREAMERROR);
  ReturnReadValid(Is_, Ok_);
  return Is_;
}
예제 #4
0
ByteStream& PtrDynArray<T>::BinaryRead(ByteStream& Is_, Boolean* Ok_)
{
  ReadObjectData(*this, Is_, FALSE);
  ReturnReadValid(Is_, Ok_);
  return Is_;
}
예제 #5
0
istream& PtrDynArray<T>::BinaryIgnore(istream& Is_, Boolean* Ok_)
{
  ReadObjectData(*this, Is_, TRUE);
  ReturnReadValid(Is_, Ok_);
  return Is_;
}