Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/IrradianceMapping.vcproj
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/IrradianceMapping.vcproj	(revision 3037)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/IrradianceMapping.vcproj	(revision 3220)
@@ -41,4 +41,5 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
+				AdditionalIncludeDirectories="libs;src;libs/GL;libs/Devil/include;libs/Zlib/include;&quot;$(CG_INC_PATH)&quot;"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
 				MinimalRebuild="true"
@@ -61,5 +62,8 @@
 			<Tool
 				Name="VCLinkerTool"
+				AdditionalDependencies="DemoEngine.lib glut32.lib glew32s.lib glew32.lib DevIL.lib ILUT.lib zlib.lib cg.lib cgGL.lib"
 				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;lib/$(ConfigurationName)&quot;;libs;&quot;$(CG_LIB_PATH)&quot;;libs/GL;libs/Devil/lib;libs/Zlib/lib"
+				IgnoreDefaultLibraryNames="LIBCMT"
 				GenerateDebugInformation="true"
 				SubSystem="1"
@@ -121,5 +125,5 @@
 				OmitFramePointers="true"
 				EnableFiberSafeOptimizations="true"
-				AdditionalIncludeDirectories="libs;libs/GL;libs/Devil/include;src;libs/Zlib/include;&quot;$(CG_INC_PATH)&quot;"
+				AdditionalIncludeDirectories="libs;src;libs/GL;libs/Devil/include;libs/Zlib/include;&quot;$(CG_INC_PATH)&quot;"
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE; _CRT_SECURE_NO_WARNINGS"
 				RuntimeLibrary="2"
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/WalkThroughRecorder.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/WalkThroughRecorder.cpp	(revision 3219)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/WalkThroughRecorder.cpp	(revision 3220)
@@ -17,4 +17,10 @@
 
 
+WalkThroughRecorder::~WalkThroughRecorder()
+{
+	mFile.close();
+}
+
+
 void WalkThroughRecorder::WriteFrame(Camera *cam)
 {
@@ -28,16 +34,26 @@
 {
 	ifstream file(filename.c_str());
-	FrameInfo info;
-	int i=0;
 
-	std::string token;
+	if (file.is_open())
+	{
+		FrameInfo info;
+		int i=0;
 
-	while(std::getline(file, token)) 
+		std::string token;
+
+		while(std::getline(file, token)) 
+		{
+			std::stringstream line(token);
+
+			line >> info;
+			mFrameInfos.push_back(info);
+		}
+	}
+	else
 	{
-		std::stringstream line(token);
+		cerr << "problem: cannot open file " << filename << endl;
+	}
 
-		line >> info;
-		mFrameInfos.push_back(info);
-	}
+	file.close();
 }
 
@@ -45,4 +61,7 @@
 bool WalkThroughPlayer::ReadNextFrame(Camera *cam)
 {
+	if (mFrameInfos.empty())
+		return false;
+
 	cam->SetDirection(mFrameInfos[mFrame].mDirection);
 	cam->SetPosition(mFrameInfos[mFrame].mPosition);
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Environment.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Environment.cpp	(revision 2829)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Environment.cpp	(revision 3220)
@@ -69,4 +69,19 @@
 
 
+bool Environment::GetStringParam(std::string &str, string &val) const
+{
+	map<string, string>::const_iterator it = mParams.find(str);
+
+	if (it == mParams.end()) // parameter not found
+		return false;
+	
+	// just assign value as it is - the line break character
+	val = (*it).second;
+	val.erase(val.end() - 1);
+
+	return true;
+}
+
+
 bool Environment::Read(const string &filename)
 {
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Environment.h
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Environment.h	(revision 2828)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Environment.h	(revision 3220)
@@ -16,4 +16,5 @@
 
 /** Loads startup environment for the demo
+	Options are stored as name / value pair
 */
 class Environment
@@ -25,8 +26,10 @@
 	bool Read(const std::string &filename);
 
-	bool GetFloatParam(std::string &str, float &val) const;
-	bool GetIntParam(std::string &str, int &val) const;
-	bool GetVectorParam(std::string &str, Vector3 &val) const;
-	bool GetBoolParam(std::string &str, bool &val) const;
+	bool GetFloatParam(std::string &name, float &val) const;
+	bool GetIntParam(std::string &name, int &val) const;
+	bool GetVectorParam(std::string &name, Vector3 &val) const;
+	bool GetBoolParam(std::string &name, bool &val) const;
+	bool GetStringParam(std::string &name, std::string &val) const;
+
 
 protected:
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.h
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.h	(revision 3219)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.h	(revision 3220)
@@ -86,5 +86,5 @@
 		using the specified frame number
 	*/
-	void SetSaveFrame(int frameNumber);
+	void SetSaveFrame(const std::string &suffix, int frameNumber);
 
 
@@ -202,4 +202,5 @@
 
 	int mSavedFrameNumber;
+	std::string mSavedFrameSuffix;
 };
 
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 3219)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 3220)
@@ -122,4 +122,6 @@
 int currentReplayFrame = -1;
 
+string recordedFramesSuffix("frames");
+
 /// the walkThroughRecorder
 WalkThroughRecorder *walkThroughRecorder = NULL;
@@ -416,6 +418,7 @@
 		env.GetFloatParam(string("ssaoKernelRadius"), ssaoKernelRadius);
 		env.GetFloatParam(string("ssaoSampleIntensity"), ssaoSampleIntensity);
-
 		env.GetBoolParam(string("ssaoUseFullResolution"), ssaoUseFullResolution);
+
+		env.GetStringParam(string("recordedFramesSuffix"), recordedFramesSuffix);
 
 		//env.GetStringParam(string("modelPath"), model_path);
@@ -446,4 +449,5 @@
 		cout << "kernel radius: " << ssaoKernelRadius << endl;
 		cout << "ssao full resolution: " << ssaoUseFullResolution << endl;
+		cout << "recorded frames suffix: " << recordedFramesSuffix << endl;
 
 		//cout << "model path: " << model_path << endl;
@@ -511,4 +515,5 @@
 	resourceManager = ResourceManager::GetSingleton();
 	shaderManager = ShaderManager::GetSingleton();
+
 
 	///////////
@@ -1261,5 +1266,5 @@
 		deferredShader->SetUseTemporalCoherence(useTemporalCoherence);
 		deferredShader->SetSortSamples(sortSamples);
-		deferredShader->SetSaveFrame((recordFrames && replayPath) ? -1 : currentReplayFrame);
+		deferredShader->SetSaveFrame(recordedFramesSuffix, (recordFrames && replayPath) ? currentReplayFrame : -1);
 
 		ShadowMap *sm = showShadowMap ? shadowMap : NULL;
@@ -1490,4 +1495,5 @@
 	case 'u':
 	case 'U':
+		// move light source instead of camera tilt
 		moveLight = !moveLight;
 		break;
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 3219)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp	(revision 3220)
@@ -333,5 +333,6 @@
 mSampleIntensity(0.2f),
 mSunVisiblePixels(0),
-mSavedFrameNumber(-1)
+mSavedFrameNumber(-1),
+mSavedFrameSuffix("")
 {
 	///////////
@@ -1326,5 +1327,5 @@
 
 	static char imageName[200];
-	sprintf(imageName, "myframe%05d.bmp", mSavedFrameNumber);
+	sprintf(imageName, "%s_%05d.bmp", mSavedFrameSuffix.c_str(), mSavedFrameNumber);
 
 	ILstring fileName = ILstring(imageName);
@@ -1422,6 +1423,7 @@
 
 
-void DeferredRenderer::SetSaveFrame(int frameNumber)
-{
+void DeferredRenderer::SetSaveFrame(const string &suffix, int frameNumber)
+{
+	mSavedFrameSuffix = suffix;
 	mSavedFrameNumber = frameNumber;
 }
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/WalkThroughRecorder.h
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/src/WalkThroughRecorder.h	(revision 3219)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/src/WalkThroughRecorder.h	(revision 3220)
@@ -31,5 +31,5 @@
 
 
-// Overload << operator for C++-style output
+/// Overload << operator for C++-style output
 inline std::ostream& operator<< (std::ostream &s, const FrameInfo &A)
 {
@@ -38,10 +38,9 @@
 
 
-// Overload >> operator for C++-style input
+/// Overload >> operator for C++-style input
 inline std::istream& operator>> (std::istream &s, FrameInfo &A)
 {
 	return s >> A.mPosition >> A.mDirection;
 }
-
 
 
@@ -54,12 +53,17 @@
 	*/
 	WalkThroughRecorder(const std::string &filename);
+
+	~WalkThroughRecorder();
+
 	/** Writes current camera data.
 	*/
 	void WriteFrame(Camera *cam);
 	
+
 protected:
 
 	std::ofstream mFile;
 };
+
 
 /** Replays a given walkthrough
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/VboFormatConverter.vcproj
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/VboFormatConverter.vcproj	(revision 3107)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/VboFormatConverter.vcproj	(revision 3220)
@@ -18,6 +18,6 @@
 		<Configuration
 			Name="Debug|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
+			OutputDirectory="$(SolutionDir)$\VboFormatConverter\(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)\VboFormatConverter"
 			ConfigurationType="1"
 			CharacterSet="1"
Index: GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
===================================================================
--- GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env	(revision 3217)
+++ GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env	(revision 3220)
@@ -3,4 +3,12 @@
 #####################################################
 
+
+################
+# misc stuff
+
+useLODs=1
+shadowSize=4096
+# the filenames given to recorded frames (+ number.bmp)
+recordedFramesSuffix=image
 
 
@@ -15,8 +23,4 @@
 maxDepthForTestingChildren=3
 
-################
-
-useLODs=1
-shadowSize=4096
 
 ####################
