PLSM 2 BUG

ruichaves

31-07-2007 17:53:42

Well, i have the listenner:

mterrainreadylistener = new PagingLandscapeDelegate();
mterrainreadylistener->bind(this,&PLSM::terrainReady);
m_SceneManager->setOption( "addTerrainListener", mterrainreadylistener );


So when the terrain is ready this event is executed, right??

I use this to cleanup the loading bar, background.. and when it shows the map, he is still drawing..

So, what is happen??

ruichaves

31-07-2007 18:14:22

Well, in the file OgrePagingLandscapeManager.cpp

i change in the frameEnded the next code:


if (!mTerrainReady &&

mPagePreloadQueue.empty() &&

mPageLoadQueue.empty() &&

mPageTextureloadQueue.empty()

{

mSceneManager->getListenerManager()->fireTerrainReady();// no more to load

mTerrainReady = true;

}


To



if (!mTerrainReady &&

mPagePreloadQueue.empty() &&

mPageLoadQueue.empty() &&

mPageTextureloadQueue.empty() &&

mRenderablesMgr->numVisibles() == mRenderablesMgr->numRenderables())

{

mSceneManager->getListenerManager()->fireTerrainReady();// no more to load

mTerrainReady = true;

}




adding the line :

mRenderablesMgr->numVisibles() == mRenderablesMgr->numRenderables())

And now the map is shown, and the terrain is now ready!!!

My question is, this change is right?? or it would influence something else...??!

Jon

01-08-2007 01:22:01

Have you tried subclassing the CustomPagingLandScapeListener class? I've done this, and haven't had problems receiving events. The PLSM demo is a good model.