Who can will prompt as to load skeletal animation from a file *.x
I try to make it with the help invoke D3DXLoadMeshHierarchyFromXA, the program takes off. I suspect a problem in correct definition of interface ID3DXAllocateHierarchy.
Who can the problem knows in what?
Paste the code.
You speak very good England.
hitchhikr,
Sarcasim doesnt come across well in text if being sarcastic is what you meant by writing "You speak very good England.".
Otherwise I guess you were just being mean.
I'm not beeing mean here, proof: i'm even willing to help you to understand the difference between sarcasm (http://dictionary.reference.com/search?q=sarcasm) & irony (http://dictionary.reference.com/search?q=irony)
invoke GlobalAlloc,GMEM_FIXED,16
mov hmem,eax
invoke GlobalLock,hmem
mov Alloc,eax
mov [eax],CreateFrame
mov [eax+4],CreateMeshContainer
mov [eax+8],DestroyFrame
mov [eax+12],DestroyMeshContainer
invoke D3DXLoadMeshHierarchyFromXA,CStr("models\sample.x"),D3DXMESH_MANAGED,lpD3DDevice,ADDR Alloc,NULL,ADDR m_pFrameRoot,ADDR m_pAnimController
Implementing such stuff in asm is going to be rather cumbersome since it's usually created as C++ classes.
This may or may not work:
(Btw, there's no need to use GlobalLock when GlobalAlloc is used with GMEM_FIXED).
invoke GlobalAlloc, GMEM_FIXED, 4
mov Allocate_Hierarchy,eax
invoke GlobalAlloc, GMEM_FIXED, 4 * 4
mov Class_VirtualFunctions,eax
mov eax,Allocate_Hierarchy
mov ebx,Class_VirtualFunctions
mov [eax], ebx
mov [ebx], offset CreateFrame
mov [ebx + 4], offset CreateMeshContainer
mov [ebx + 8], offset DestroyFrame
mov [ebx + 12], offset DestroyMeshContainer
invoke D3DXLoadMeshHierarchyFromXA, CStr("models\sample.x"), D3DXMESH_MANAGED, lpD3DDevice, toto,NULL, ADDR m_pFrameRoot, ADDR m_pAnimController
Methods need to be implemented like that:
CreateFrame proc pThis:dword, szName:dword, pNewFrame:dword
mov eax,D3D_OK
ret
CreateFrame endp
CreateMeshContainer proc pThis:dword, szName:dword, pMeshData:dword,
pMaterials:dword, pEffectInstances:dword,
NumMaterials:dword, pAdjacency:dword,
pSkinInfo:dword, ppNewMeshContainer:dword
mov eax,D3D_OK
ret
CreateMeshContainer endp
DestroyFrame proc pThis:dword, pFrameToFree:dword
mov eax,D3D_OK
ret
DestroyFrame endp
DestroyMeshContainer proc pThis:dword, pMeshContainerToFree:dword
mov eax,D3D_OK
ret
DestroyMeshContainer endp
You better switch to C++ if you want to deal with such kind of stuff.
hitchhikr, thank!
I do not like C++ and classes. I like ASM!