Index: OpenSceneGraph/trunk/src/osgShadow/ShadowMap.cpp
===================================================================
--- OpenSceneGraph/trunk/src/osgShadow/ShadowMap.cpp (revision 11137)
+++ OpenSceneGraph/trunk/src/osgShadow/ShadowMap.cpp (revision 13041)
@@ -1,12 +1,12 @@
-/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 
+/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
  *
- * This library is open source and may be redistributed and/or modified under  
- * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
+ * This library is open source and may be redistributed and/or modified under
+ * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
  * (at your option) any later version.  The full license is in LICENSE file
  * included with this distribution, and on the openscenegraph.org website.
- * 
+ *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * OpenSceneGraph Public License for more details.
 */
@@ -35,5 +35,5 @@
 // fragment shader
 //
-static const char fragmentShaderSource_noBaseTexture[] = 
+static const char fragmentShaderSource_noBaseTexture[] =
     "uniform sampler2DShadow osgShadow_shadowTexture; \n"
     "uniform vec2 osgShadow_ambientBias; \n"
@@ -47,5 +47,5 @@
 // fragment shader
 //
-static const char fragmentShaderSource_withBaseTexture[] = 
+static const char fragmentShaderSource_withBaseTexture[] =
     "uniform sampler2D osgShadow_baseTexture; \n"
     "uniform sampler2DShadow osgShadow_shadowTexture; \n"
@@ -217,5 +217,5 @@
 #if 1
         // cull front faces so that only backfaces contribute to depth map
-        
+
 
         osg::ref_ptr<osg::CullFace> cull_face = new osg::CullFace;
@@ -252,5 +252,5 @@
 
     {
-        _stateset = new osg::StateSet;        
+        _stateset = new osg::StateSet;
         _stateset->setTextureAttributeAndModes(_shadowTextureUnit,_texture.get(),osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
         _stateset->setTextureMode(_shadowTextureUnit,GL_TEXTURE_GEN_S,osg::StateAttribute::ON);
@@ -375,10 +375,10 @@
 
             osg::RefMatrix* matrix = itr->second.get();
-            if (matrix) 
+            if (matrix)
             {
                 lightpos = light->getPosition() * (*matrix);
                 lightDir = osg::Matrix::transform3x3( light->getDirection(), *matrix );
             }
-            else 
+            else
             {
                 lightpos = light->getPosition();
@@ -392,5 +392,5 @@
     eyeToWorld.invert(*cv.getModelViewMatrix());
 
-    lightpos = lightpos * eyeToWorld;     
+    lightpos = lightpos * eyeToWorld;
     lightDir = osg::Matrix::transform3x3( lightDir, eyeToWorld );
     lightDir.normalize();
@@ -413,5 +413,5 @@
         else
         {
-            // get the bounds of the model.    
+            // get the bounds of the model.
             osg::ComputeBoundsVisitor cbbv(osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN);
             cbbv.setTraversalMask(getShadowedScene()->getCastsShadowTraversalMask());
@@ -464,5 +464,5 @@
         }
 
-        cv.setTraversalMask( traversalMask & 
+        cv.setTraversalMask( traversalMask &
             getShadowedScene()->getCastsShadowTraversalMask() );
 
@@ -486,8 +486,8 @@
         cv.getRenderStage()->getPositionalStateContainer()->
              addPositionedTextureAttribute( _shadowTextureUnit, refMatrix, _texgen.get() );
-#else 
+#else
         // compute the matrix which takes a vertex from local coords into tex coords
         // will use this later to specify osg::TexGen..
-        osg::Matrix MVPT = _camera->getViewMatrix() * 
+        osg::Matrix MVPT = _camera->getViewMatrix() *
                _camera->getProjectionMatrix() *
                osg::Matrix::translate(1.0,1.0,1.0) *
@@ -513,13 +513,13 @@
 ////////////////////////////////////////////////////////////////////////////////
 // Callback used by debugging hud to display Shadow Map in color buffer
-// OSG does not allow to use the same GL Texture Id with different glTexParams. 
-// Callback simply turns shadow compare mode off via GL while rendering hud and 
-// restores it afterwards. 
+// OSG does not allow to use the same GL Texture Id with different glTexParams.
+// Callback simply turns shadow compare mode off via GL while rendering hud and
+// restores it afterwards.
 ////////////////////////////////////////////////////////////////////////////////
-class ShadowMap::DrawableDrawWithDepthShadowComparisonOffCallback: 
+class ShadowMap::DrawableDrawWithDepthShadowComparisonOffCallback:
     public osg::Drawable::DrawCallback
 {
 public:
-    // 
+    //
     DrawableDrawWithDepthShadowComparisonOffCallback
         ( osg::Texture2D * texture, unsigned stage = 0 )
@@ -536,5 +536,5 @@
 
             // Turn off depth comparison mode
-            glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, 
+            glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB,
                              GL_NONE );
         }
@@ -544,5 +544,5 @@
         if( _texture.valid() ) {
             // Turn it back on
-            glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, 
+            glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB,
                              GL_COMPARE_R_TO_TEXTURE_ARB );
         }
@@ -565,5 +565,5 @@
     camera->setProjectionMatrix(osg::Matrix::ortho2D(0,size.x(),0,size.y()));
 
-    // set the view matrix    
+    // set the view matrix
     camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
     camera->setViewMatrix(osg::Matrix::identity());
@@ -583,5 +583,5 @@
 
     osg::Vec3 position(10.0f,size.y()-100.0f,0.0f);
-    osg::Vec3 delta(0.0f,-120.0f,0.0f); 
+    osg::Vec3 delta(0.0f,-120.0f,0.0f);
     float length = 300.0f;
 
