Пример #1
0
	/////////
	// PolygonRecord
	PolygonRecord::PolygonRecord(InStream &src)
	{
		mParts = 0;
		mVertices = 0;
		
		try
		{
			mBoundingRect.mMin[0] = (float)src.ReadDouble();
			mBoundingRect.mMin[1] = (float)src.ReadDouble();
			mBoundingRect.mMax[0] = (float)src.ReadDouble();
			mBoundingRect.mMax[1] = (float)src.ReadDouble();
			
			mNumParts = src.ReadUInt32();
			mNumVertices = src.ReadUInt32();
			mParts = new uint32_t[mNumParts];
			mVertices = new Vec2[mNumVertices];
			
			src.ReadUInt32Arr(mNumParts,mParts);
			for(int i = 0;i < mNumVertices;i++)
			{
				float x = (float)src.ReadDouble();
				float y = (float)src.ReadDouble();
				mVertices[i] = MakeVec2(x,y);
			}
		}
		catch(...)
		{
			delete [] mParts;
			delete [] mVertices;
			throw;
		}
	}