Hello,
I try to embed some custom data in the .x file as they are really speedy to load, I just take advantage of that.
Now I am loading this file.
xof 0303txt 0032
template ColorRGBA {
<35ff44e0-6c7c-11cf-8f52-0040333594a3>
FLOAT red;
FLOAT green;
FLOAT blue;
FLOAT alpha;
}
template ColorRGB {
<d3e16e81-7835-11cf-8f52-0040333594a3>
FLOAT red;
FLOAT green;
FLOAT blue;
}
template Material {
<3d82ab4d-62da-11cf-ab39-0020af71e433>
ColorRGBA faceColor;
FLOAT power;
ColorRGB specularColor;
ColorRGB emissiveColor;
[...]
}
template TextureFilename {
<a42790e1-7810-11cf-8f52-0040333594a3>
STRING filename;
}
template Frame {
<3d82ab46-62da-11cf-ab39-0020af71e433>
[...]
}
template Matrix4x4 {
<f6f23f45-7686-11cf-8f52-0040333594a3>
array FLOAT matrix[16];
}
template FrameTransformMatrix {
<f6f23f41-7686-11cf-8f52-0040333594a3>
Matrix4x4 frameMatrix;
}
template Vector {
<3d82ab5e-62da-11cf-ab39-0020af71e433>
FLOAT x;
FLOAT y;
FLOAT z;
}
template MeshFace {
<3d82ab5f-62da-11cf-ab39-0020af71e433>
DWORD nFaceVertexIndices;
array DWORD faceVertexIndices[nFaceVertexIndices];
}
template Mesh {
<3d82ab44-62da-11cf-ab39-0020af71e433>
DWORD nVertices;
array Vector vertices[nVertices];
DWORD nFaces;
array MeshFace faces[nFaces];
[...]
}
template MeshMaterialList {
<f6f23f42-7686-11cf-8f52-0040333594a3>
DWORD nMaterials;
DWORD nFaceIndexes;
array DWORD faceIndexes[nFaceIndexes];
[Material <3d82ab4d-62da-11cf-ab39-0020af71e433>]
}
template VertexElement {
<f752461c-1e23-48f6-b9f8-8350850f336f>
DWORD Type;
DWORD Method;
DWORD Usage;
DWORD UsageIndex;
}
template DeclData {
<bf22e553-292c-4781-9fea-62bd554bdd93>
DWORD nElements;
array VertexElement Elements[nElements];
DWORD nDWords;
array DWORD data[nDWords];
}
Material Material__1 {
1.000000;0.643137;0.294118;1.000000;;
29.999997;
0.530000;0.530000;0.530000;;
0.000000;0.000000;0.000000;;
}
Material BLACK_PLASTIC {
0.180392;0.168627;0.168627;1.000000;;
42.000000;
0.690667;0.690667;0.690667;;
0.000000;0.000000;0.000000;;
}
Material BLACK_METAL {
0.180392;0.168627;0.168627;1.000000;;
44.000000;
0.933333;0.933333;0.933333;;
0.000000;0.000000;0.000000;;
}
Material BODY_MAPS {
1.000000;0.643137;0.294118;1.000000;;
29.999997;
0.530000;0.530000;0.530000;;
0.000000;0.000000;0.000000;;
}
Material MAP1 {
1.000000;1.000000;1.000000;1.000000;;
29.999997;
0.477000;0.477000;0.477000;;
0.000000;0.000000;0.000000;;
TextureFilename {
"Tex__1.bmp";
}
}
Material MAP2 {
1.000000;1.000000;1.000000;1.000000;;
29.999997;
0.477000;0.477000;0.477000;;
0.000000;0.000000;0.000000;;
TextureFilename {
"Tex__4.bmp";
}
}
Material MAP3 {
1.000000;1.000000;1.000000;1.000000;;
29.999997;
0.477000;0.477000;0.477000;;
0.000000;0.000000;0.000000;;
TextureFilename {
"Tex__6.bmp";
}
}
Material MAP4 {
1.000000;1.000000;1.000000;1.000000;;
29.999997;
0.477000;0.477000;0.477000;;
0.000000;0.000000;0.000000;;
TextureFilename {
"Tex__9.bmp";
}
}
Material MAP5 {
1.000000;1.000000;1.000000;1.000000;;
29.999997;
0.477000;0.477000;0.477000;;
0.000000;0.000000;0.000000;;
TextureFilename {
"Tex__12.bmp";
}
}
Material CROMED {
0.623529;0.623529;0.623529;1.000000;;
44.000000;
0.933333;0.933333;0.933333;;
0.000000;0.000000;0.000000;;
}
Material MAP_VERT {
1.000000;0.643137;0.294118;1.000000;;
29.999997;
0.530000;0.530000;0.530000;;
0.000000;0.000000;0.000000;;
}
Material Material__83 {
1.000000;1.000000;1.000000;1.000000;;
29.999997;
0.477000;0.477000;0.477000;;
0.000000;0.000000;0.000000;;
TextureFilename {
"Tex__17.bmp";
}
}
Material Material__84 {
1.000000;1.000000;1.000000;1.000000;;
29.999997;
0.477000;0.477000;0.477000;;
0.000000;0.000000;0.000000;;
TextureFilename {
"Tex__21.bmp";
}
}
Frame Counter_Balance {
FrameTransformMatrix {
-0.006293,0.000000,-0.000000,0.000000,0.000000,0.005689,0.000000,0.000000,0.000000,0.000000,-0.005391,0.000000,0.000000,0.000000,0.000000,1.000000;;
}
Frame ET_YELL02 {
FrameTransformMatrix {
-208.245082,-0.000024,3.720288,0.000000,3.720476,-0.000280,208.245005,0.000000,0.000009,208.278131,0.000080,0.000000,1.260498,204.234022,260.463437,1.000000;;
}
....
const GUID *cXParser::GetObjectGUID( \
ID3DXFileData *pDataObj)
{
GUID *Type = NULL;
// Error checking
if(pDataObj == NULL)
return NULL;
// Get the template type
if(FAILED(pDataObj->GetType((GUID*)Type)))
return NULL;
return Type;
}
The pDataObj does contain a ID3DXFileData interface. But When it gets to GetType, the Type variable is corrupted on the stack
Does anyone know why?
Thanks
Jack