void MapView::unload() { if (mIsLoaded) { mIsLoaded = false; destroyObjects(); destroyTerrain(); Ogre::Root::getSingleton().destroySceneManager(mManager); } }
void TerrainImpl::createTerrain(TerrainInfo* info, ushort tileSize) { // ensure we have a viewport height set if (mOpt.factorC <= 0) OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "You need to set a valid pixel error margin.", "TerrainImpl::createTerrain"); // delete currently loaded terrain (if any) destroyTerrain(); // load new terrain mInfo = info; mOpt.tileSize = tileSize; mIndexHandler = new IndexHandler(mOpt.tileSize); createTiles(); mTerrainLoaded = true; }
TerrainImpl::~TerrainImpl() { destroyTerrain(); }