Index: trunk/VUT/work/README_ONLINE.txt
===================================================================
--- trunk/VUT/work/README_ONLINE.txt	(revision 227)
+++ trunk/VUT/work/README_ONLINE.txt	(revision 316)
@@ -24,5 +24,7 @@
    RenderSystem_Direct7
    OgreMain
-   example projects
+   GuiRenderer
+   
+   Also add the flag to the example projects you want to use
 
 5) Add following resources to OGRE_PATH\Samples\Common\bin\Release\resource.cfg:
Index: trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp
===================================================================
--- trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp	(revision 259)
+++ trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp	(revision 316)
@@ -450,7 +450,7 @@
 	sm->GetVisibilityManager()->SetQueryManager(mQueryManager);
 
-	InfoContainer<GtpVisibility::NodeInfo> visibleNodes;
-	InfoContainer<GtpVisibility::MeshInfo> visibleGeometry;
-	InfoContainer<GtpVisibility::PatchInfo> visiblePatches;
+	GtpVisibility::NodeInfoContainer visibleNodes;
+	GtpVisibility::MeshInfoContainer visibleGeometry;
+	GtpVisibility::PatchInfoContainer visiblePatches;
 
 
@@ -478,5 +478,5 @@
 	int geomSize = 0, nodesSize = 0, patchSize = 0;
 
-	InfoContainer<GtpVisibility::MeshInfo>::iterator geomIt, geomIt_end = visibleGeometry.end();
+	GtpVisibility::MeshInfoContainer::iterator geomIt, geomIt_end = visibleGeometry.end();
 
 	for (geomIt = visibleGeometry.begin(); geomIt != geomIt_end; ++geomIt)
@@ -492,5 +492,5 @@
 			
 			std::stringstream d; 
-			d << "Geometry " << geomSize << " id: " << (*geomIt).GetMesh()->getSubEntity(0)->getId() 
+			d << "Geometry " << geomSize << " id: " << (*geomIt).GetSource()->getSubEntity(0)->getId() 
 			  << " visibility: "  << (*geomIt).GetVisiblePixels() << ", " << (*geomIt).GetProjectedPixels();
 			LogManager::getSingleton().logMessage(d.str());
@@ -498,5 +498,5 @@
 	}
 
-	InfoContainer<GtpVisibility::NodeInfo>::iterator nodesIt, nodesIt_end = visibleNodes.end();
+	GtpVisibility::NodeInfoContainer::iterator nodesIt, nodesIt_end = visibleNodes.end();
 
 	for (nodesIt = visibleNodes.begin(); nodesIt != nodesIt_end; ++nodesIt)
@@ -516,5 +516,5 @@
 	}
 
-	InfoContainer<GtpVisibility::PatchInfo>::iterator patchIt, patchIt_end = visiblePatches.end();
+	GtpVisibility::PatchInfoContainer::iterator patchIt, patchIt_end = visiblePatches.end();
 
 	for (patchIt = visiblePatches.begin(); patchIt != patchIt_end; ++ patchIt)
Index: trunk/VUT/work/ogre_changes/OgreMain/include/OgreRenderSystem.h
===================================================================
--- trunk/VUT/work/ogre_changes/OgreMain/include/OgreRenderSystem.h	(revision 193)
+++ trunk/VUT/work/ogre_changes/OgreMain/include/OgreRenderSystem.h	(revision 316)
@@ -947,10 +947,4 @@
         virtual Real getMaximumDepthInputValue(void) = 0;
 
-#ifdef GTP_VISIBILITY_MODIFIED_OGRE
-		/** sets colour.
-		*/
-		void setColour(int r, int g, int b, int a);
-#endif // GTP_VISIBILITY_MODIFIED_OGRE
-
     protected:
 
@@ -990,8 +984,4 @@
 
         bool mInvertVertexWinding;
-
-#ifdef GTP_VISIBILITY_MODIFIED_OGRE
-		int mColour[4];
-#endif // GTP_VISIBILITY_MODIFIED_OGRE
     };
 }
Index: trunk/VUT/work/ogre_changes/OgreMain/include/OgreSceneManager.h
===================================================================
--- trunk/VUT/work/ogre_changes/OgreMain/include/OgreSceneManager.h	(revision 183)
+++ trunk/VUT/work/ogre_changes/OgreMain/include/OgreSceneManager.h	(revision 316)
@@ -136,10 +136,10 @@
 		*/
 		void _deleteRenderedQueueGroups(int leavePassesInQueue = 0);
-		/** Internal method used by _renderVisibleObjects to deal with renderables
+		/** Wrapper for useRenderableViewProjMde with is an 
+			Internal method used by _renderVisibleObjects to deal with renderables
             which override the camera's own view / projection materices. 
-			@remark made public by matt 
-		*/
-        void useRenderableViewProjMode(Renderable* pRend);
-		/** Method for setting up the renderstate for a rendering pass.
+		*/
+        void useRenderableViewProjModeWrapper(Renderable* pRend); // HACK
+		/** HACK: A public wrapper method for setting up the renderstate for a rendering pass.
             @param
                 pass The Pass details to set.
@@ -149,5 +149,5 @@
 			@remark made public by matt
         */
-        virtual Pass* setPass(Pass* pass);
+        virtual Pass* setPassWrapper(Pass* pass);
 
 		/** Renders an Ogre Entity.
@@ -273,5 +273,5 @@
         /** Retrieves the internal render queue. */
         virtual RenderQueue* getRenderQueue(void);
-#ifndef GTP_VISIBILITY_MODIFIED_OGRE // made public, is found in the modfified section
+
         /** Internal method for setting up the renderstate for a rendering pass.
             @param
@@ -282,5 +282,5 @@
         */
         virtual Pass* setPass(Pass* pass);
-#endif
+
         /// A pass designed to let us render shadow colour on white for texture shadows
         Pass* mShadowCasterPlainBlackPass;
@@ -357,9 +357,9 @@
         AnimationList mAnimationsList;
         AnimationStateSet mAnimationStates;
-#ifndef GTP_VISIBILITY_MODIFIED_OGRE // made public, is found in the modfified section
+
         /** Internal method used by _renderVisibleObjects to deal with renderables
             which override the camera's own view / projection materices. */
         void useRenderableViewProjMode(Renderable* pRend);
-#endif
+
         /// Controller flag for determining if we need to set view/proj matrices
         bool mCamChanged;
Index: trunk/VUT/work/ogre_changes/OgreMain/src/OgreRenderSystem.cpp
===================================================================
--- trunk/VUT/work/ogre_changes/OgreMain/src/OgreRenderSystem.cpp	(revision 150)
+++ trunk/VUT/work/ogre_changes/OgreMain/src/OgreRenderSystem.cpp	(revision 316)
@@ -63,8 +63,4 @@
         // instanciate RenderSystemCapabilities
         mCapabilities = new RenderSystemCapabilities();
-
-#ifdef GTP_VISIBILITY_MODIFIED_OGRE
-		mColour[0] = mColour[1] = mColour[2] = mColour[3] = 255;
-#endif // GTP_VISIBILITY_MODIFIED_OGRE
     }
 
@@ -420,14 +416,4 @@
         }
     }
-#ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	// ------------------------------------------------------------------
-	void RenderSystem::setColour(int r, int g, int b, int a)
-	{
-		mColour[0] = r;
-		mColour[1] = g;
-		mColour[2] = b;
-		mColour[3] = a;
-	}
-#endif //  GTP_VISIBILITY_MODIFIED_OGRE
 }
 
Index: trunk/VUT/work/ogre_changes/OgreMain/src/OgreSceneManager.cpp
===================================================================
--- trunk/VUT/work/ogre_changes/OgreMain/src/OgreSceneManager.cpp	(revision 193)
+++ trunk/VUT/work/ogre_changes/OgreMain/src/OgreSceneManager.cpp	(revision 316)
@@ -4200,4 +4200,9 @@
 #ifdef GTP_VISIBILITY_MODIFIED_OGRE
 //-----------------------------------------------------------------------
+Pass* SceneManager::setPassWrapper(Pass* pass)
+{
+	return setPass(pass);
+}
+//-----------------------------------------------------------------------
 void SceneManager::_renderSceneNode(Camera *cam, SceneNode *node, const int leavePassesInQueue)
 {
@@ -4259,4 +4264,9 @@
 	renderSingleObject(rend, pass, false);
 }
+//-----------------------------------------------------------------------
+void SceneManager::useRenderableViewProjModeWrapper(Renderable* pRend)
+{
+	useRenderableViewProjMode(pRend);
+}
 #endif //GTP_VISIBILITY_MODIFIED_OGRE
 }
Index: trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h
===================================================================
--- trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h	(revision 193)
+++ trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h	(revision 316)
@@ -208,5 +208,4 @@
 	int mDepth;
 	
-
 #endif // GTP_VISIBILITY_MODIFIED_OGRE
 };
Index: trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreTerrainRenderable.h
===================================================================
--- trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreTerrainRenderable.h	(revision 193)
+++ trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreTerrainRenderable.h	(revision 316)
@@ -49,5 +49,5 @@
 
 #ifdef GTP_VISIBILITY_MODIFIED_OGRE
-#define MAX_RENDERLEVEL_INDEX 15
+#define MAX_RENDERLEVEL_INDEX 15 // maximal different number of render levels, e.g., used for chc
 #endif // GTP_VISIBILITY_MODIFIED_OGRE
 
Index: trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctreeSceneManager.h
===================================================================
--- trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctreeSceneManager.h	(revision 193)
+++ trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctreeSceneManager.h	(revision 316)
@@ -261,8 +261,8 @@
 
 #ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	/* the number of nodes in the octree. do not confuse this with the OctreeNode
-	class with is derived from SceneNode.
+	/** The number of nodes in the octree.
+		@remark counts the octree hierarchy nodes in the tree.
 	*/
-	int mNumOctreeNodes;
+	int mNumOctants;
 #endif // GTP_VISIBILITY_MODIFIED_OGRE
 
Index: trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctree.cpp
===================================================================
--- trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctree.cpp	(revision 193)
+++ trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctree.cpp	(revision 316)
@@ -108,6 +108,7 @@
 	else
 		mDepth = 0;
-
+	// update bounds because we want tight octree
 	_updateBounds();
+	
 #endif //GTP_VISIBILITY_MODIFIED_OGRE
     mNumNodes = 0;
@@ -133,4 +134,5 @@
 
     mParent = 0;
+
 }
 
Index: trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctreeSceneManager.cpp
===================================================================
--- trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctreeSceneManager.cpp	(revision 158)
+++ trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctreeSceneManager.cpp	(revision 316)
@@ -318,5 +318,5 @@
 
 #ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	mNumOctreeNodes = 1; // count number of octants
+	mNumOctants = 1; // initialise number of octants in tree
 #endif // GTP_VISIBILITY_MODIFIED_OGRE
 
@@ -470,5 +470,5 @@
             octant -> mChildren[ x ][ y ][ z ] = new Octree( octant );
 #ifdef GTP_VISIBILITY_MODIFIED_OGRE
-	++ mNumOctreeNodes;
+			++ mNumOctants;
 #endif // GTP_VISIBILITY_MODIFIED_OGRE
 
Index: trunk/VUT/work/ogre_changes/RenderSystems/GL/src/OgreGLRenderSystem.cpp
===================================================================
--- trunk/VUT/work/ogre_changes/RenderSystems/GL/src/OgreGLRenderSystem.cpp	(revision 193)
+++ trunk/VUT/work/ogre_changes/RenderSystems/GL/src/OgreGLRenderSystem.cpp	(revision 316)
@@ -2328,9 +2328,4 @@
             glDisableVertexAttribArrayARB_ptr(1); // disable weights
         }
-#ifndef GTP_VISIBILITY_MODIFIED_OGRE
-        glColor4f(1,1,1,1);
-#else
-		glColor4ub(mColour[0], mColour[1], mColour[2], mColour[3]);
-#endif  // GTP_VISIBILITY_MODIFIED_OGRE
 
         glSecondaryColor3fEXT_ptr(0.0f, 0.0f, 0.0f);
Index: trunk/VUT/work/iv/IVFrameListener.cpp
===================================================================
--- trunk/VUT/work/iv/IVFrameListener.cpp	(revision 259)
+++ trunk/VUT/work/iv/IVFrameListener.cpp	(revision 316)
@@ -436,5 +436,5 @@
 		  << "worst frame time: " << mWindow->getWorstFrameTime() << "\n"
 		  << "avg. #triangles: " << avgTris << " M\n"
-		  << "#frames: " << mFrameCount < "\n";
+		  << "#frames: " << mFrameCount << "\n";
 
 		LogManager::getSingleton().logMessage(d.str());
