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); } }
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_; }
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_; }
ByteStream& PtrDynArray<T>::BinaryRead(ByteStream& Is_, Boolean* Ok_) { ReadObjectData(*this, Is_, FALSE); ReturnReadValid(Is_, Ok_); return Is_; }
istream& PtrDynArray<T>::BinaryIgnore(istream& Is_, Boolean* Ok_) { ReadObjectData(*this, Is_, TRUE); ReturnReadValid(Is_, Ok_); return Is_; }