Sign in to follow this  
arindampatra06

Runtime exception

Recommended Posts

Hi all,
I am trying to develop a small children game, i am almost to the end of it.but now the game is getting crashed / is just giving an error .I am getting a "runtime libary C++ error" on my gaming code.Which is bothering me a lot.

I will be kind to all , if anyone can suggest me a solution.

Share this post


Link to post
Share on other sites
Use a debugger to trace the source of the problem (which will be in your code). I'm sorry, but with an extremely general question without any helpful information this is the best answer anyone can give you.

Share this post


Link to post
Share on other sites
Thanks for you information.......BitMaster

I am showing you the source of the problem in below.Can anyone tell me what's might be the reason of get an exceptions over here.
----------------------------------------------------------------------------------------------------------------------------------------------------------------

for(int k=0;k<FirstMesh.size();k++)
{
//pMesh = FirstMesh[k];
if( FirstMesh[k] && FirstMesh[k]->pSkinInfo&&visibility[k]==TRUE)
{
unsigned int Bones = FirstMesh[k]->pSkinInfo->GetNumBones();
D3DXMATRIX *mat=new D3DXMATRIX[Bones];

for (DWORD i = 0; i < Bones; ++i)
{
D3DXMatrixMultiply(&boneMatrices[i],& FirstMesh[k]->exBoneOffsets[i], FirstMesh[k]->exFrameCombinedMatrixPointer[i]);
D3DXMatrixInverse(&boneMatrices[i],0,&mat[i]);
D3DXMatrixTranspose(&mat[i],&mat[i]);
}




void *srcPtr=0;
FirstMesh[k]->MeshData.pMesh->LockVertexBuffer(0, (void**)&srcPtr);

void *destPtr=0;
FirstMesh[k]->exSkinMesh->LockVertexBuffer(0, (void**)&destPtr);


FirstMesh[k]->pSkinInfo->UpdateSkinnedMesh(boneMatrices, NULL, srcPtr, destPtr);

FirstMesh[k]->exSkinMesh->UnlockVertexBuffer();
FirstMesh[k]->MeshData.pMesh->UnlockVertexBuffer();
//D3DXComputeNormals( FirstMesh[k]->exSkinMesh,NULL);
}
}
}




Share this post


Link to post
Share on other sites
You've been told about [ source ]-tags, I think. See also The Holy FAQ.

Apart from that: You don't post enough context. Have you checked what the debugger says? Of what type are involved variables? How are they declared? Et cetera.

Share this post


Link to post
Share on other sites
Setting aside that the problem is still horribly under-defined, there are several questions popping into mind:
* does FirstMesh.size() return realistic values?
* do all the arrays involved (FirstMesh, visibility, ...) actually have the correct size?
* is FirstMesh[k] guaranteed to be 0 if it is not yet initialized or has been deleted along the way?

Share this post


Link to post
Share on other sites

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