Index: GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp	(revision 2106)
+++ GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp	(revision 2108)
@@ -235,7 +235,26 @@
 	// the scale factor for the visualized bounding boxes
 	mSceneMgr->setOption("NodeVizScale", &mVizScale);
-		
+	
+	/////////
 	//-- set the current culling algorithm type
-	setAlgorithm(mApplication->mAlgorithm);
+	//setAlgorithm(mApplication->mAlgorithm);
+
+	bool isNormalExecution;
+		
+	mSceneMgr->getOption("NormalExecution", &isNormalExecution);
+	if (isNormalExecution)
+	{
+		// no algorithm
+		mCurrentAlgorithm = 
+			GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS;
+	}
+	else
+	{
+		mSceneMgr->getOption("Algorithm", &mCurrentAlgorithm);
+	}
+	
+	applyCurrentAlgorithm();
+	
+	///////////////////////////////
 
 	// set scene manager options
@@ -481,5 +500,4 @@
 		// frame start time
 		mTimeFrameStarted = mTimer->getMilliseconds();
-		//Ogre::LogManager::getSingleton().logMessage("Frame started");
 	}
 
@@ -517,8 +535,10 @@
 		{
 			mApplication->Clamp2Terrain(mCamNode, 5);
+			//Ogre::LogManager::getSingleton().logMessage("clamp to terrain");
 		}
 		else
 		{
 			mApplication->Clamp2FloorPlane(mFloorDist);
+			//Ogre::LogManager::getSingleton().logMessage("clamp to floor");
 		}
 
@@ -526,4 +546,5 @@
 
 	default:
+		Ogre::LogManager::getSingleton().logMessage("should not come here");
 		break;
 	};	
Index: GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp	(revision 2106)
+++ GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp	(revision 2108)
@@ -217,6 +217,6 @@
 	if (!val.empty())
 		mInitialPosition.z = atof( val.c_str());
-
 */
+
 /*	val = config.getSetting("OnlineCullingAlgorithm");
 
@@ -457,5 +457,5 @@
 	loadConfig("terrainCulling.cfg");
 	
-	if (!LoadScene(mFilename))
+	if (0 && !LoadScene(mFilename))
 	   	LogManager::getSingleton().logMessage("error loading scene");
 	
@@ -499,8 +499,8 @@
 	if (1)//||msShowHillyTerrain)
 	{
-        mSceneMgr->getOption("ShowTerrain", &msShowHillyTerrain); 
-		std::string terrain_cfg("terrainCulling.cfg");
+      	std::string terrain_cfg("terrainCulling.cfg");
 		mSceneMgr->setWorldGeometry(terrain_cfg);
 
+		mSceneMgr->getOption("ShowTerrain", &msShowHillyTerrain); 
 	}
 	
@@ -660,17 +660,9 @@
 	}
 #else
-	if (msShowHillyTerrain)
-	{
-		mSceneMgr = mRoot->createSceneManager("OcclusionCullingSceneManager");
-		//mSceneMgr = mRoot->createSceneManager("TerrainSceneManager");
-		//mSceneMgr = mRoot->createSceneManager("KdTreeSceneManager");
-	}
-	else
-	{	
-		mSceneMgr = mRoot->createSceneManager("OcclusionCullingSceneManager");
-		//mSceneMgr = mRoot->createSceneManager("OctreeSceneManager");
-		//mSceneMgr = mRoot->createSceneManager("KdTreeSceneManager");
-	}
-
+	
+	mSceneMgr = mRoot->createSceneManager("OcclusionCullingSceneManager");
+	//mSceneMgr = mRoot->createSceneManager("TerrainSceneManager");
+	//mSceneMgr = mRoot->createSceneManager("KdTreeSceneManager");
+	
 #endif
 }
@@ -703,6 +695,7 @@
 	RaySceneQueryResult::iterator rit = qryResult.begin();
 	bool success = false;
-float yVal = 0;
-float minVal = 999999999999;
+	
+	float yVal = 0;
+	float minVal = 999999999999;
 
 	while (rit != qryResult.end() && rit->movable)
@@ -779,5 +772,5 @@
 			{
 				// terrain hack
-				msShowHillyTerrain = true;
+				//msShowHillyTerrain = true;
 				LogManager::getSingleton().logMessage("error loading scene => load terrain");
 			}
Index: GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h
===================================================================
--- GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h	(revision 1607)
+++ GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h	(revision 2108)
@@ -78,12 +78,12 @@
 		//-- write out stats for recorded walkthrough
 		d << "Algorithm: " << algorithmName << "\n"
-			<< "avg. FPS: " << avgFps << "\n"
-			<< "best FPS: " << mBestFps << "\n"
-			<< "worst FPS: " << mWorstFps << "\n"
-			<< "#frames: " << mFrameCount << "\n"
-			<< "avg. #triangles: " << avgTris << " M\n"
-			<< "avg. #query culled nodes: " << avgFrustumCulledNodes << "\n"
-			<< "avg. #frustum culled nodes: " << avgQueryCulledNodes << "\n"
-			<< "avg. #rendered nodes: " << avgRenderedNodes << "\n";
+		  << "avg. FPS: " << avgFps << "\n"
+		  << "best FPS: " << mBestFps << "\n"
+		  << "worst FPS: " << mWorstFps << "\n"
+		  << "#frames: " << mFrameCount << "\n"
+		  << "avg. #triangles: " << avgTris << " M\n"
+		  << "avg. #query culled nodes: " << avgFrustumCulledNodes << "\n"
+		  << "avg. #frustum culled nodes: " << avgQueryCulledNodes << "\n"
+		  << "avg. #rendered nodes: " << avgRenderedNodes << "\n";
 	}
 
