Code:
void DrawBone(LPDIRECT3DDEVICE9 pDevice,CPlayer* pPlayer, int Start,int End, DWORD Color)
{
D3DXVECTOR3 vStart,vEnd;
GetBoneOrigin(pPlayer,Start,&vStart);
GetBoneOrigin(pPlayer,End,&vEnd);
D3DXVECTOR3 vStartPos,vEndPos;
if (!WorldToScreen(pDevice,&vStart,&vStartPos)) return;
if (!WorldToScreen(pDevice,&vEnd,&vEndPos)) return;
pCanvas->Line(vStartPos.x,vStartPos.y,vEndPos.x,vEndPos.y,Color);
}
void DrawSkeleton(LPDIRECT3DDEVICE9 pDevice,CPlayer* pPlayer,DWORD Color)
{
DrawBone(pDevice,pPlayer,1,2,Color);
DrawBone(pDevice,pPlayer,2,3,Color);
DrawBone(pDevice,pPlayer,3,4,Color);
DrawBone(pDevice,pPlayer,4,5,Color);
DrawBone(pDevice,pPlayer,5,6,Color);
DrawBone(pDevice,pPlayer,6,7,Color);
DrawBone(pDevice,pPlayer,5,36,Color);
DrawBone(pDevice,pPlayer,36,37,Color);
DrawBone(pDevice,pPlayer,37,38,Color);
DrawBone(pDevice,pPlayer,5,9,Color);
DrawBone(pDevice,pPlayer,9,10,Color);
DrawBone(pDevice,pPlayer,10,11,Color);
DrawBone(pDevice,pPlayer,1,69,Color);
DrawBone(pDevice,pPlayer,69,70,Color);
DrawBone(pDevice,pPlayer,70,71,Color);
DrawBone(pDevice,pPlayer,71,73,Color);
DrawBone(pDevice,pPlayer,1,63,Color);
DrawBone(pDevice,pPlayer,63,64,Color);
DrawBone(pDevice,pPlayer,64,65,Color);
DrawBone(pDevice,pPlayer,65,67,Color);
}