Druha
25-10-2009 11:16:14
Hi, betajaen!
I followed your suggestion to recreate Scene when I change map.
But after I destroy a scene in the next frame I get an error somwhere inside TimeController. I've looked through code and found a bug.
In Scene constructror:
But in destructor only:
I've looked at the last git commit - that comment still exists there.
I've replaced that commented line with:
Everything works fine now. Hope it'll be helpfull for someone...
Commit, I am using - http://github.com/betajaen/nxogre/commi ... 50b4a4afb3
I followed your suggestion to recreate Scene when I change map.
But after I destroy a scene in the next frame I get an error somwhere inside TimeController. I've looked through code and found a bug.
In Scene constructror:
// .. some code ..
TimeController::getSingleton()->mListeners[mProcessingPriority].insert(this);
TimeController::getSingleton()->mListeners[mFetchingPriority].insert(this);
// .. some other code ..
But in destructor only:
/// TimeController::getSingleton()->removeListener(this); < -- yeah it is commented here!
if (mSDK && mScene)
{
mActors.destroyAll();
mSceneGeometries.destroyAll();
mKinematicActors.destroyAll();
mKinematicControllers.destroyAll();
mVolumes.destroyAll();
mMaterials.destroyAll();
mCloths.destroyAll();
mSoftBodies.destroyAll();
NxOgre_Delete(mSceneTimer);
mSDK->releaseScene(*mScene);
NxOgre_Delete(mPhysXCallback);
}
I've looked at the last git commit - that comment still exists there.
I've replaced that commented line with:
TimeController::getSingleton()->mListeners[mProcessingPriority].remove(this);
TimeController::getSingleton()->mListeners[mFetchingPriority].remove(this);
Everything works fine now. Hope it'll be helpfull for someone...
Commit, I am using - http://github.com/betajaen/nxogre/commi ... 50b4a4afb3