Index: GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp	(revision 937)
+++ GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp	(revision 945)
@@ -217,4 +217,19 @@
 	}
 
+	// loading overlay
+
+	mLoadingOverlay = OverlayManager::getSingleton().getByName("Example/Visibility/LoadingOverlay");
+	mMyLoadingInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/Loading/MyLoadingInfo");
+	mMyLoadingInfo->setCaption("loading view cells ...");
+	
+	/*const int top = 10;
+		mMyStatsAlgorithmInfo->setTop(top);
+
+		char str[100]; sprintf(str,": %d", 0);
+		mMyStatsFpsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/MyFpsInfo");
+		mMyStatsFpsInfo->setCaption(str);*/
+
+	mLoadingOverlay->hide();
+
 	// note: larger magnification for terrain to show single objects
 	if (TestCullingTerrainApplication::msShowHillyTerrain)
@@ -990,6 +1005,10 @@
 	mAlgorithmInfo->setCaption(": " + msAlgorithmCaptions[mCurrentAlgorithm]);
 	mSceneMgr->setOption("Algorithm", &mCurrentAlgorithm);
-	std::stringstream d; d << "algorithm: " << msAlgorithmCaptions[mCurrentAlgorithm];
-	if (1) Ogre::LogManager::getSingleton().logMessage(d.str());
+
+	if (1)
+	{
+		std::stringstream d; d << "algorithm: " << msAlgorithmCaptions[mCurrentAlgorithm];
+		Ogre::LogManager::getSingleton().logMessage(d.str());
+	}
 }
 //-----------------------------------------------------------------------
@@ -1173,6 +1192,18 @@
 	if (mUseViewCells && !mViewCellsLoaded)
 	{
+		mLoadingOverlay->show();
+
+		// call once to load view cell loading overlay
+		mWindow->update();
+
 		mViewCellsLoaded = mApplication->LoadViewCells(mApplication->mViewCellsFilename);
-	}
+		
+		mLoadingOverlay->hide();
+	}
+
+	if (mUseViewCells)
+		mViewCellsInfo->setCaption(": on");
+	else
+		mViewCellsInfo->setCaption(": off");
 
 	mSceneMgr->setOption("UseViewCells", &mUseViewCells);
@@ -1364,5 +1395,5 @@
 	
 	case KC_F7:
-		setObjectType(++mCurrentObjectType);
+		setObjectType(++ mCurrentObjectType);
 		break;
 	case KC_F8:
@@ -1383,10 +1414,10 @@
 		break;
 	case KC_8:
-	//	changeAssumedVisibility(-5);
-		changeAssumedVisibility(-500);
+		changeAssumedVisibility(-5);
+	//	changeAssumedVisibility(-500);
 		break;
 	case KC_9:
-		changeAssumedVisibility(500);
-		//changeAssumedVisibility(5);
+	//	changeAssumedVisibility(500);
+		changeAssumedVisibility(5);
 		break;
 	case KC_LSHIFT:
@@ -1771,4 +1802,5 @@
 	initOverlayElement(&mAssumedVisibilityInfo, ext, "AssumedVisibility", top, ": 0"); top += vert_space;
 	initOverlayElement(&mCurrentObjectTypeInfo, ext, "CurrentObjectType", top, ": "); top += vert_space;
+	initOverlayElement(&mViewCellsInfo, ext, "ViewCells", top, ": "); top += vert_space;
 	//initOverlayElement(&mHelpInfo, ext, "Help", top, ": "); top += vert_space;
 
Index: GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp	(revision 937)
+++ GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp	(revision 945)
@@ -149,7 +149,7 @@
 
 
-/**************************************************************/
-/*        TestCullingTerrainApplication implementation        */
-/**************************************************************/
+/********************************************************************/
+/*            TestCullingTerrainApplication implementation          */
+/********************************************************************/
 
 
@@ -159,5 +159,5 @@
 mIVReader(NULL),
 mFilename("terrain"),
-mEnvironmentFilename("simple.env")
+mEnvironmentFilename("generate_viewcells.env")
 {
 }
@@ -335,4 +335,6 @@
 	mIVReader = new IVReader();
 
+	Timer *timer = PlatformManager::getSingleton().createTimer();
+	timer->reset();
 	if (1)
 	{
@@ -350,17 +352,24 @@
 
 		mIVReader->buildTree(mSceneMgr, node);
+		
+		mIVReader->collapse();
 		OGRE_DELETE(mIVReader);
+
+
+		std::stringstream d; 
+		d << "loaded " << filename << " in " << timer->getMilliseconds() * 1e-3 << " secs";
+		LogManager::getSingleton().logMessage(d.str());
+		
+		PlatformManager::getSingleton().destroyTimer(timer);
+
+		//-- bake into static geometry
+		if (USE_STATIC_GEOMETRY)
+		{
+			BakeSceneIntoStaticGeometry("staticVienna", "Vienna");
+		}
+	
 		return true;
 	}
 
-	mIVReader->collapse();
-
-	//-- bake into static geometry
-	if (USE_STATIC_GEOMETRY)
-	{
-		BakeSceneIntoStaticGeometry("staticVienna", "Vienna");
-	}
-	
-	OGRE_DELETE(mIVReader);
 
 	return false;
@@ -391,5 +400,5 @@
 	//roofsNode->detachAllObjects();
 	//roadsNode->detachAllObjects();
-	//	planeNode->detachAllObjects();
+	//planeNode->detachAllObjects();
 	
 	//viennaNode->removeChild("Walls");
@@ -470,5 +479,4 @@
 
 	mSceneMgr->setShadowColour(ColourValue(0.5, 0.5, 0.5));
-   
 
 	//-- terrain content setup
@@ -485,8 +493,10 @@
 
 	mTerrainContentGenerator = new TerrainContentGenerator(mSceneMgr);
-	
-	
+		
+	if (!msShowHillyTerrain)
+		return;
+
 	// if no objects in file, we generate new objects
-	if (msShowHillyTerrain && !mTerrainContentGenerator->LoadObjects("objects.out"))
+	if (!mTerrainContentGenerator->LoadObjects("objects.out"))
 	{
 		// the objects are generated randomly distributed over the terrain
Index: GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h
===================================================================
--- GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h	(revision 937)
+++ GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h	(revision 945)
@@ -327,8 +327,11 @@
 	OverlayElement *mDelayedTraversedNodesInfo;
 	OverlayElement *mCurrentObjectTypeInfo;
+	OverlayElement *mViewCellsInfo;
 
 	OverlayElement *mMyStatsAlgorithmInfo;
 	OverlayElement *mMyStatsFpsInfo;
 
+	OverlayElement *mMyLoadingInfo;
+	
 	OverlayElement *mQueryTypeInfo;
 	OverlayElement *mQueryVisibleNodesInfo;
@@ -402,4 +405,5 @@
 	Overlay* mQueryOverlay;
 	Overlay* mMyStatsOverlay;
+	Overlay *mLoadingOverlay;
 
 	Light *mSunLight;
@@ -417,5 +421,5 @@
 
 	int mCurrentObjectType;
-
+	
 	bool mDeleteObjects;
 	bool mRecordVideo;
