Original Post
Hey there, I've recently converted my game project over from Visual Basic to C/C++. Now I'm at the stage where I'm writing the model loader, I've rewritten the MAXScript exporter I was using to work with binary files, to make the files smaller and more easily read. Now I've gotten my program to read the header for my binary file, but now comes the tricky part, loading the data in the file. Below are the structs I'm using, I just want to know who I can allocate enough space for the oVertices, oTVertics and oFaces arrays so that I can reference oVertices(0).x for the x component of the 1st vertex. Simple, huh?
[source lang=cpp]
struct VERTEX {
float x;
float y;
float z;
};
struct FACE {
short a;
short b;
short c;
};
struct CMF_FILE_HEADER {
float fVersion;
char fNumObjs;
};
struct CMF_OBJECT_HEADER {
long hVertices;
short hFaces;
long hTVertices;
};
struct CMF_FILE_DATA {
VERTEX oVertices();
VERTEX oTVertices();
FACE oFaces();
};