Index: trunk/VUT/GtpVisibilityPreprocessor/src/Makefile
===================================================================
--- trunk/VUT/GtpVisibilityPreprocessor/src/Makefile	(revision 177)
+++ trunk/VUT/GtpVisibilityPreprocessor/src/Makefile	(revision 181)
@@ -1,5 +1,5 @@
 #############################################################################
 # Makefile for building: preprocessor
-# Generated by qmake (1.07a) (Qt 3.3.2) on: Sat Jul 16 12:10:59 2005
+# Generated by qmake (1.07a) (Qt 3.3.2) on: Mon Jul 18 20:55:14 2005
 # Project:  preprocessor.pro
 # Template: app
@@ -13,11 +13,11 @@
 LEX		= flex
 YACC		= byacc
-CFLAGS	=	-nologo -Zm200 -W0 -MD -O2 -GX  -DUNICODE -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG
-CXXFLAGS	=	-nologo -Zm200 -W0 -MD -O2 -GX  -DUNICODE -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG
+CFLAGS	=	-nologo -Zm200 -W0 -MDd -Zi -GX  -DUNICODE -DQT_DLL -DQT_THREAD_SUPPORT
+CXXFLAGS	=	-nologo -Zm200 -W0 -MDd -Zi -GX  -DUNICODE -DQT_DLL -DQT_THREAD_SUPPORT
 LEXFLAGS	=
 YACCFLAGS	=-d
 INCPATH	=	 -I"..\src" -I"..\support\xerces\include" -I"..\support\zlib\include" -I"..\support\boost" -I"$(QTDIR)\include" -I"d:\gametools\svn\trunk\VUT\GtpVisibilityPreprocessor\src" -I"C:\Qt\3.3.2\mkspecs\win32-msvc"
 LINK	=	link
-LFLAGS	=	/NOLOGO delayimp.lib /DELAYLOAD:comdlg32.dll /DELAYLOAD:oleaut32.dll /DELAYLOAD:winmm.dll /DELAYLOAD:wsock32.dll /DELAYLOAD:winspool.dll /SUBSYSTEM:console /LIBPATH:"../support/expat/lib" /LIBPATH:"../support/xerces/lib" /LIBPATH:"$(QTDIR)\lib"
+LFLAGS	=	/NOLOGO /DEBUG /SUBSYSTEM:console /LIBPATH:"../support/xerces/lib" /LIBPATH:"$(QTDIR)\lib"
 LIBS	=	 "qt-mt332.lib" "qtmain.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "imm32.lib" "winmm.lib" "wsock32.lib" "winspool.lib" "xerces-c_2.lib" "opengl32.lib" "glu32.lib" "delayimp.lib"
 MOC		=	$(QTDIR)\bin\moc.exe
@@ -167,4 +167,9 @@
 	-$(DEL_FILE) MeshKdTree.obj
 	-$(DEL_FILE) Pvs.obj
+	-$(DEL_FILE) preprocessor.pdb
+	-$(DEL_FILE) preprocessor.ilk
+	-$(DEL_FILE) vc*.pdb
+	-$(DEL_FILE) vc*.idb
+
 
 
Index: trunk/VUT/GtpVisibilityPreprocessor/src/preprocessor.pro
===================================================================
--- trunk/VUT/GtpVisibilityPreprocessor/src/preprocessor.pro	(revision 177)
+++ trunk/VUT/GtpVisibilityPreprocessor/src/preprocessor.pro	(revision 181)
@@ -13,5 +13,5 @@
 
 # debuc config
-CONFIG		+= console warn_off thread release
+CONFIG		+= console warn_off thread debug
 
 # RELEASE CONFIG
Index: trunk/VUT/GtpVisibilityPreprocessor/src/KdTree.cpp
===================================================================
--- trunk/VUT/GtpVisibilityPreprocessor/src/KdTree.cpp	(revision 177)
+++ trunk/VUT/GtpVisibilityPreprocessor/src/KdTree.cpp	(revision 181)
@@ -674,2 +674,38 @@
   return NULL;
 }
+
+int
+KdTree::FindNeighbors(KdNode *n,
+		      vector<KdNode *> &neighbors,
+		      bool onlyUnmailed
+		      )
+{
+  stack<KdNode *> nodeStack;
+  
+  nodeStack.push(mRoot);
+
+  AxisAlignedBox3 box = GetBox(n);
+
+  while (!nodeStack.empty()) {
+    KdNode *node = nodeStack.top();
+    nodeStack.pop();
+    if (node->IsLeaf()) {
+      if ( node != n && (!onlyUnmailed || !node->Mailed()) ) 
+	neighbors.push_back(node);
+    } else {
+      KdInterior *interior = (KdInterior *)node;
+      if (interior->mPosition > box.Max(interior->mAxis))
+	nodeStack.push(interior->mBack);
+      else
+	if (interior->mPosition < box.Min(interior->mAxis))
+	  nodeStack.push(interior->mFront);
+	else {
+	  // random decision
+	    nodeStack.push(interior->mBack);
+	    nodeStack.push(interior->mFront);
+	}
+    }
+  }
+  
+  return neighbors.size();
+}
Index: trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
===================================================================
--- trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp	(revision 179)
+++ trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp	(revision 181)
@@ -81,6 +81,7 @@
 
       int pvsSize = object->mKdPvs.GetSize();
-      
-    if (0 && pvsSize) {
+
+      
+    if (pvsSize) {
 		// mail all nodes from the pvs
 		Intersectable::NewMail();
@@ -102,5 +103,5 @@
 	}
 
-    if (pvsSize) {
+    if (0 && pvsSize) {
 		// mail all nodes from the pvs
 		Intersectable::NewMail();
Index: trunk/VUT/GtpVisibilityPreprocessor/src/Camera.cpp
===================================================================
--- trunk/VUT/GtpVisibilityPreprocessor/src/Camera.cpp	(revision 179)
+++ trunk/VUT/GtpVisibilityPreprocessor/src/Camera.cpp	(revision 181)
@@ -19,7 +19,9 @@
 
   
-  
- // QImage image(mWidth, mHeight, 32); changed by matt
+#if QT_VERSION < 0x040000
+  QImage image(mWidth, mHeight, 32);
+#else
   QImage image(mWidth, mHeight, QImage::Format_RGB32);
+#endif
   
   vector<Ray> rays;
