Re: Making this code generic with C++ Standard Lib
"Jack" <jl@knight.com> ???g???l???s?D:OEx1HLJ5HHA.1992@TK2MSFTNGP03.phx.gbl...
I managed to cut it down to a few.
Here is the changed code:
struct D3DXFRAME_EX : D3DXFRAME
{
D3DXMATRIX matCombined;
D3DXMATRIX matOriginal;
D3DXFRAME_EX()
{
Name = NULL;
pMeshContainer = NULL;
pFrameSibling = pFrameFirstChild = NULL;
D3DXMatrixIdentity (&matCombined);
D3DXMatrixIdentity (&matOriginal);
D3DXMatrixIdentity (&TransformationMatrix);
}
~D3DXFRAME_EX()
{
// delete[] Name; Name = NULL;
// delete pFrameSibling; pFrameSibling = NULL;
// delete pFrameFirstChild; pFrameFirstChild = NULL;
}
vector<D3DXFRAME_EX>& Find (std::string& FrameName)
{
vector<D3DXFRAME_EX> pFrame;
vector<D3DXFRAME_EX> pFramePtr;
if (Name && FrameName.c_str() && !FrameName.compare(Name))
return this;
if (pFramePtr == (vector<D3DXFRAME_EX>)pFrameSibling)
{
if ((pFrame = pFramePtr.Find(FrameName)))
return pFrame;
}
if (pFramePtr == (vector<D3DXFRAME_EX>)pFrameFirstChild)
{
if (pFrame = pFramePtr.Find(FrameName))
return pFrame;
}
return NULL;
}
...
Thanks
Jack
Warning 1 warning C4819: The file contains a character that cannot be
represented in the current code page (950). Save the file in Unicode format
to prevent data loss c:\program files\microsoft directx sdk (october
2006)\include\d3d9types.h 1385
Error 2 error C2440: 'return' : cannot convert from 'D3DXFRAME_EX *const '
to 'std::vector<_Ty> &' c:\documents and settings\luckie\osm\direct3d.h 47
Error 3 error C2440: 'type cast' : cannot convert from '_D3DXFRAME *' to
'std::vector<_Ty>' c:\documents and settings\luckie\osm\direct3d.h 49
Error 4 error C2039: 'Find' : is not a member of 'std::vector<_Ty>'
c:\documents and settings\luckie\osm\direct3d.h 51
Warning 5 warning C4172: returning address of local variable or temporary
c:\documents and settings\luckie\osm\direct3d.h 52
Error 6 error C2440: 'type cast' : cannot convert from '_D3DXFRAME *' to
'std::vector<_Ty>' c:\documents and settings\luckie\osm\direct3d.h 55
Error 7 error C2039: 'Find' : is not a member of 'std::vector<_Ty>'
c:\documents and settings\luckie\osm\direct3d.h 57
Warning 8 warning C4172: returning address of local variable or temporary
c:\documents and settings\luckie\osm\direct3d.h 58
Error 9 error C2440: 'return' : cannot convert from 'int' to
'std::vector<_Ty> &' c:\documents and settings\luckie\osm\direct3d.h 62
Thanks
Jack