I'll just start off with the code..
Code:
int nVertices = *( word* )pPtr;
NumVertices = nVertices;
Vertices = new Vertex[nVertices];
pPtr += sizeof( word );
int i;
for ( i = 0; i < nVertices; i++ )
{
MS3DVertex * pVertex = ( MS3DVertex* )pPtr;
// Vertices[i].BoneID = pVertex->m_boneID;
memcpy( Vertices[i].vx, pVertex->m_vertex[0], sizeof(float));
memcpy( Vertices[i].vy, pVertex->m_vertex[1], sizeof(float));
memcpy( Vertices[i].vz, pVertex->m_vertex[2], sizeof(float));
pPtr += sizeof( MS3DVertex );
}
Okay, so I'm copying pVertex->m_vertex elements to each element in my structure in code, I'll show you the definitions of each of these structs..
I'm copying from this one
Code:
// Vertex information
struct MS3DVertex
{
byte m_flags;
float m_vertex[3];
char m_boneID;
byte m_refCount;
} PACK_STRUCT;
To this one
Code:
struct Vertex
{
float vx;
float vy;
float vz;
float nx;
float ny;
float nz;
float s;
float t;
unsigned char r,g,b,a;
};
int NumVertices;
Vertex * Vertices;
That is all I'm doing, maybe I'm not using memcpy right?
Here are the errors..
Code:
--------------------Configuration: NeHeGL - Win32 Debug--------------------
Compiling...
MS3D.CPP
\\student\courses\cedar_cliff\computer\senior project\auditorium\engine source\ms3d.cpp(192) : error C2664: 'memcpy' : cannot convert parameter 1 from 'float' to 'void *'
There is no context in which this conversion is possible
\\student\courses\cedar_cliff\computer\senior project\auditorium\engine source\ms3d.cpp(193) : error C2664: 'memcpy' : cannot convert parameter 1 from 'float' to 'void *'
There is no context in which this conversion is possible
\\student\courses\cedar_cliff\computer\senior project\auditorium\engine source\ms3d.cpp(194) : error C2664: 'memcpy' : cannot convert parameter 1 from 'float' to 'void *'
There is no context in which this conversion is possible
Any ideas?