//Off loader does not read the cross file correctly.  This is due to the was carage returns are handled.
//Off loader needs improvement.

class Mesh;

class OFFLoader
{

public:

	void load( char *pFileName, Mesh **ppInMesh );

private:

	HANDLE hFile;

	char *pBuf;
	unsigned long iBufSize;
	unsigned long iCursor;

	unsigned long iMaxVert, iMaxFace, iMaxEdge;

	int iOption_N, iOption_C, iOption_4;

	Mesh **ppMesh;

	void readEOL();

	int readIntegerFromBuffer();
	float readFloatFromBuffer();

	void read3Floats( float &fA, float &fB, float &fC );

	void readHeader();
	void readMaxParams();
	
	void readVertexList();
	void readFaceList();

	void eatWhiteSpace();
};