Jump to content
  • Advertisement
Sign in to follow this  
darkm00n

Converting .X file parser from directx 8 to directx 9

This topic is 4905 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, I've tried updating my engine implementation to DirectX version 9, and I have smoothed out all the bugs in the code - except for in the .X parser that I have. I keep getting errors saying that functions now do not exist and some have an incorrect number of parameters. I understood the original code, but am having trouble translating to the new ID3DMesh interface. Any ideas? I followed the link in the FAQ, but the tutorials there don't do texturing/materials and lighting. Thanks muchly, Rob

Share this post


Link to post
Share on other sites
Advertisement
Try this:

Change in your Allocatehierarchy.h the prototype of the CreateMeshContainer function in this:

STDMETHOD(CreateMeshContainer)(THIS_
LPCSTR Name,
CONST D3DXMESHDATA *pMeshData,
CONST D3DXMATERIAL *pMaterials,
CONST D3DXEFFECTINSTANCE *pEffectInstances,
DWORD NumMaterials,
CONST DWORD *pAdjacency,
LPD3DXSKININFO pSkinInfo,
LPD3DXMESHCONTAINER *ppNewMeshContainer);





Change in your Allocatehierarchy.cpp the definition of the CreateMeshContainer function in this:

HRESULT CAllocateHierarchy::CreateMeshContainer(LPCTSTR Name,
CONST D3DXMESHDATA *pMeshData,
CONST D3DXMATERIAL *pMaterials,
CONST D3DXEFFECTINSTANCE *pEffectInstances,
DWORD NumMaterials,
CONST DWORD *pAdjacency,
LPD3DXSKININFO pSkinInfo,
LPD3DXMESHCONTAINER *ppNewMeshContainer)





And dont use:

m_pAnimController->SetTime(m_pAnimController->GetTime()+dElapsedTime);


but use:

m_pAnimController->AdvanceTime(dElapsedTime, NULL);




Anyway Jasonjurecka wrote an article about files .x : "Working with the DirectX .X File Format and Animation in DirectX 9.0",
and in the feedback article(http://www.gamedev.net/community/forums/topic.asp?topic_id=216597) this problem is argued.

Hope that this helps :)
Kev

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!