What is wrong with the following code? It was working fine yesterday and when I cam back to work on the code, it's started giving me the following errors.
.h
Code:
#define MD2_IDP2 (('2'<<24) + ('P'<<16) + ('D'<<8) + 'I')
#define MD2_VERSION 8
typedef float Vec3[3];
struct Vertex {
Vec3 Pos;
float *Normal;
};
struct Frame {
char Name[16];
Vertex* Vertices;
Vec3 Scale;
Vec3 Translate;
};
//Few more structs
class MD2Model {
private:
Frame* Frames;
TexCoord* TexCoords;
Vertex* Vertices;
Header Head;
GLuint TextureID;
int CurrentFrame;
public:
~MD2Model();
MD2Model();
void setAnimation(const char* Name);
void Advance(float DT);
void Draw(void);
int Load(const char* Filename);
}; .ccp
Code:
//... MD2Model::Load(const char *Filename)
ifstream F;
char *buffer;
F.open(Filename, ios::in | ios::binary);
F.read((char *)&Head, sizeof(Header)); //Header is head's struct.
Frames = new Frame[Head.FrameCount]; // Memory Allocation - Frames is part of a class, same with head
buffer = new char[Head.FrameCount * Head.FrameSize]; //Memory Allocation
F.seekg(Head.FrameOffset, ios::beg);
F.read((char *)buffer, Head.FrameCount * Head.FrameSize);
for(int i=0; i<Head.FrameCount; i++)
{
Frames[i].Vertices = new Vertex[Head.VertexCount];
Frames[i] = (Frame *)&buffer[Head.FrameCount * i]; // Error from this line
}
//... Error:
Quote:
|
error C2679: binary '=' : no operator found which takes a right-hand operand of type 'Frame *' (or there is no acceptable conversion)
|