Sign in to follow this  

Parsing X files

This topic is 4040 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

I understand that, for DirectX 9.0, D3DXLoadMeshHierarchyFromX() will load the entire DirectX file with animation sets. No parsing required. However, I would like to convert the parsing code for DirectX 8.0, found here: http://www.gamedev.net/reference/articles/article1493.asp to DirectX 9.0. For DirectX 8.0, they use variables:
 LPDIRECTXFILE           pDXFile  = NULL;
 LPDIRECTXFILEENUMOBJECT pEnumObj = NULL;
 LPDIRECTXFILEDATA       pData    = NULL;
which is replaced with:
 LPD3DXFILE           pDXFile   = NULL;
 LPD3DXFILEENUMOBJECT pEnumObj  = NULL;
 LPD3DXFILEDATA       pFileData = NULL;
for DirectX 9.0. Some parts are easy to convert, but, there is one part that is giving me trouble. I'm getting errors that Resolve() doesn't accept the ID3DXFileData file type. I'm not sure if I really need this code or not. Throw it all out?
    // Process embedded references
    if(SUCCEEDED(pSubObj->QueryInterface(IID_IDirectXFileDataReference, (void**)&pDataRef))) {
      if(SUCCEEDED(pDataRef->Resolve(&pSubData))) {
        ParseXFileData(pSubData);
        ReleaseCOM(pSubData);
      }
      ReleaseCOM(pDataRef);
    }

    // Process non-referenced embedded templates
    if(SUCCEEDED(pSubObj->QueryInterface(IID_IDirectXFileData, (void**)&pSubData))) {
      ParseXFileData(pSubData);
      ReleaseCOM(pSubData);
    }
    ReleaseCOM(pSubObj);
Or perhaps if this code is already converted to DX 9.0 somewhere, please post a link and save me the trouble!

Share this post


Link to post
Share on other sites

This topic is 4040 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this