Sources/CryGame C++/Solution1/CryGame/XDemoMgr.cpp
//////////////////////////////////////////////////////////////////////////
// Stores a chunk of demo-data on disk.

Stores a chunk of demo-data on disk.
Stores a chunk of demo - data on disk .
bool CXDemoMgr::AddChunk(float fTimestamp, CStream &stm, IEntity *player)
{
	unsigned int nStreamSizeInBytes=BITS2BYTES(stm.GetSize());
	unsigned int nStreamSizeInBits=stm.GetSize();
	if(nStreamSizeInBits==0)
		return false;
	if(m_pFile==NULL)
		return false;
	if(fwrite(&fTimestamp,sizeof(fTimestamp),1,m_pFile)!=1)
		return false;
	if(fwrite(&nStreamSizeInBits,sizeof(nStreamSizeInBits),1,m_pFile)!=1)
		return false;
	if(fwrite(stm.GetPtr(),nStreamSizeInBytes,1,m_pFile)!=1)
		return false;
	if(fwrite(&player->GetAngles(),sizeof(Vec3d),1,m_pFile)!=1)
		return false;
	return true;
}
bool CXDemoMgr :: AddChunk ( float fTimestamp , CStream & stm , IEntity * player ) { unsigned int nStreamSizeInBytes = BITS2BYTES ( stm . GetSize ( ) ) ; unsigned int nStreamSizeInBits = stm . GetSize ( ) ; if ( nStreamSizeInBits == 0 ) return false ; if ( m_pFile == NULL ) return false ; if ( fwrite ( & fTimestamp , sizeof ( fTimestamp ) , 1 , m_pFile ) != 1 ) return false ; if ( fwrite ( & nStreamSizeInBits , sizeof ( nStreamSizeInBits ) , 1 , m_pFile ) != 1 ) return false ; if ( fwrite ( stm . GetPtr ( ) , nStreamSizeInBytes , 1 , m_pFile ) != 1 ) return false ; if ( fwrite ( & player -> GetAngles ( ) , sizeof ( Vec3d ) , 1 , m_pFile ) != 1 ) return false ; return true ; }
Stores a chunk of demo-data on disk.
Stores a chunk of demo - data on disk .