Bläddra i källkod

Bugfixing the illumination stage

Panagiotis Christopoulos Charitos 15 år sedan
förälder
incheckning
5f831bdbf6

+ 6 - 2
build/debug/Makefile

@@ -4,8 +4,8 @@ PHFLAGS = -c -pedantic-errors -pedantic -ansi -Wall -Wextra -W -pipe -O0 -g3 -pg
 LFLAGS = -rdynamic -L../../../SDL-hg/build/.libs -L../../../glew/lib -L../../../bullet_svn/src/BulletSoftBody -L../../../bullet_svn/src/BulletDynamics -L../../../bullet_svn/src/BulletCollision -L../../../bullet_svn/src/LinearMath -Wl,-Bstatic -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath -lGLEW -lSDL_image -lGLU -lSDL -Wl,-Bdynamic -lGL -ljpeg -lpng -ltiff
 EXECUTABLE = AnKi.bin
 INCPATH = -I../../src/Math/ -I../../src/Util/Tokenizer/ -I../../src/Misc/ -I../../src/ -I../../src/Renderer/ -I../../src/Scene/ -I../../src/Ui/ -I../../src/Resources/ -I../../src/Util/ -I../../src/Scene/Controllers/ -I../../src/Physics/ -I../../src/Renderer/BufferObjects/ -I../../src/Resources/Helpers/ -I../../../bullet_svn/src/ -I../../../SDL-hg/include -I../../glew/include 
-SOURCES = ../../src/Util/Tokenizer//Scanner.cpp ../../src/Misc//collision.cpp ../../src/Misc//skybox.cpp ../../src/Misc//map.cpp ../../src/Misc//memory.cpp ../../src/Misc//particles.cpp ../../src//Main.cpp ../../src/Renderer//Ez.cpp ../../src/Renderer//Dbg.cpp ../../src/Renderer//Sm.cpp ../../src/Renderer//Hdr.cpp ../../src/Renderer//Ssao.cpp ../../src/Renderer//Ms.cpp ../../src/Renderer//Pps.cpp ../../src/Renderer//MainRenderer.cpp ../../src/Renderer//Is.cpp ../../src/Renderer//Renderer.cpp ../../src/Scene//SkelNode.cpp ../../src/Scene//Light.cpp ../../src/Scene//SkelModelNode.cpp ../../src/Scene//Scene.cpp ../../src/Scene//MeshNode.cpp ../../src/Scene//Camera.cpp ../../src/Scene//SceneNode.cpp ../../src/Scene//ParticleEmitter.cpp ../../src/Ui//Ui.cpp ../../src/Resources//LightProps.cpp ../../src/Resources//SkelAnim.cpp ../../src/Resources//Mesh.cpp ../../src/Resources//ShaderProg.cpp ../../src/Resources//Material.cpp ../../src/Resources//Extension.cpp ../../src/Resources//Skeleton.cpp ../../src/Resources//Texture.cpp ../../src/Resources//Resource.cpp ../../src/Util//Input.cpp ../../src/Util//App.cpp ../../src/Util//Common.cpp ../../src/Util//Util.cpp ../../src/Scene/Controllers//SkelAnimCtrl.cpp ../../src/Scene/Controllers//Controller.cpp ../../src/Physics//PhyWorld.cpp ../../src/Resources/Helpers//ShaderPrePreprocessor.cpp ../../src/Resources/Helpers//Image.cpp 
-OBJECTS = Scanner.o collision.o skybox.o map.o memory.o particles.o Main.o Ez.o Dbg.o Sm.o Hdr.o Ssao.o Ms.o Pps.o MainRenderer.o Is.o Renderer.o SkelNode.o Light.o SkelModelNode.o Scene.o MeshNode.o Camera.o SceneNode.o ParticleEmitter.o Ui.o LightProps.o SkelAnim.o Mesh.o ShaderProg.o Material.o Extension.o Skeleton.o Texture.o Resource.o Input.o App.o Common.o Util.o SkelAnimCtrl.o Controller.o PhyWorld.o ShaderPrePreprocessor.o Image.o 
+SOURCES = ../../src/Util/Tokenizer//Scanner.cpp ../../src/Misc//collision.cpp ../../src/Misc//skybox.cpp ../../src/Misc//map.cpp ../../src/Misc//memory.cpp ../../src/Misc//particles.cpp ../../src//Main.cpp ../../src/Renderer//Ez.cpp ../../src/Renderer//Smo.cpp ../../src/Renderer//Dbg.cpp ../../src/Renderer//Sm.cpp ../../src/Renderer//Hdr.cpp ../../src/Renderer//Ssao.cpp ../../src/Renderer//Ms.cpp ../../src/Renderer//Pps.cpp ../../src/Renderer//MainRenderer.cpp ../../src/Renderer//Is.cpp ../../src/Renderer//Renderer.cpp ../../src/Scene//SkelNode.cpp ../../src/Scene//Light.cpp ../../src/Scene//SkelModelNode.cpp ../../src/Scene//Scene.cpp ../../src/Scene//MeshNode.cpp ../../src/Scene//Camera.cpp ../../src/Scene//SceneNode.cpp ../../src/Scene//ParticleEmitter.cpp ../../src/Ui//Ui.cpp ../../src/Resources//LightProps.cpp ../../src/Resources//SkelAnim.cpp ../../src/Resources//Mesh.cpp ../../src/Resources//ShaderProg.cpp ../../src/Resources//Material.cpp ../../src/Resources//Extension.cpp ../../src/Resources//Skeleton.cpp ../../src/Resources//Texture.cpp ../../src/Resources//Resource.cpp ../../src/Util//Input.cpp ../../src/Util//App.cpp ../../src/Util//Common.cpp ../../src/Util//Util.cpp ../../src/Scene/Controllers//SkelAnimCtrl.cpp ../../src/Scene/Controllers//Controller.cpp ../../src/Physics//PhyWorld.cpp ../../src/Resources/Helpers//ShaderPrePreprocessor.cpp ../../src/Resources/Helpers//Image.cpp 
+OBJECTS = Scanner.o collision.o skybox.o map.o memory.o particles.o Main.o Ez.o Smo.o Dbg.o Sm.o Hdr.o Ssao.o Ms.o Pps.o MainRenderer.o Is.o Renderer.o SkelNode.o Light.o SkelModelNode.o Scene.o MeshNode.o Camera.o SceneNode.o ParticleEmitter.o Ui.o LightProps.o SkelAnim.o Mesh.o ShaderProg.o Material.o Extension.o Skeleton.o Texture.o Resource.o Input.o App.o Common.o Util.o SkelAnimCtrl.o Controller.o PhyWorld.o ShaderPrePreprocessor.o Image.o 
 PRECOMPILED_HEADERS = 
 
 all: $(PRECOMPILED_HEADERS) $(SOURCES) $(EXECUTABLE)
@@ -685,6 +685,10 @@ Ez.o: ../../src/Renderer//Ez.cpp ../../src/Renderer//Renderer.h \
 	@echo Compiling ../../src/Renderer//Ez.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Renderer//Ez.cpp -o Ez.o
 
+Smo.o: ../../src/Renderer//Smo.cpp
+	@echo Compiling ../../src/Renderer//Smo.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/Renderer//Smo.cpp -o Smo.o
+
 Dbg.o: ../../src/Renderer//Dbg.cpp ../../src/Renderer//Renderer.h \
  ../../src/Util/Common.h ../../src/Misc/memory.h ../../src/Math/Math.h \
  ../../src/Math/Vec2.h ../../src/Math/MathForwardDecls.h \

+ 3 - 3
shaders/IsLpGeneric.glsl

@@ -191,7 +191,7 @@ vec3 phong( in vec3 _frag_pos_vspace, out float _frag_light_dist )
 	 * Instead of using normalize(_frag_light_dist) we brake the operation because we want frag_light_dist for the calc of
 	 * the attenuation
 	 */
-	_frag_light_dist = dot( _light_frag_vec, _light_frag_vec ); 
+	_frag_light_dist = dot( _light_frag_vec, _light_frag_vec );
 	vec3 _light_dir = _light_frag_vec * inversesqrt(_frag_light_dist);
 
 	// read the normal
@@ -264,7 +264,7 @@ void main()
 		)
 		{
 			#if defined( _SHADOW_ )
-				#if defined( _SHADOW_MAPPING_pcf )
+				#if defined( PCF_ENABLED )
 					float _shadow_color = pcfLow( _texCoords3 );
 					//float _shadow_color = MedianFilterPCF( shadowMap, _texCoords3 );
 				#else
@@ -293,7 +293,7 @@ void main()
 	#endif // spot light
 
 	/*#if defined(_SPOT_LIGHT_)
-	gl_FragData[0] = vec4( UnpackNormal(texture2D( msNormalFai, texCoords ).rg), 1.0 );
+	gl_FragData[0] = gl_FragData[0] - gl_FragData[0] + vec4( texture2D( msDepthFai, texCoords ).r );
 	//gl_FragData[0] = vec4( texture2D( msDepthFai, texCoords ).rg), 1.0 );
 	#endif*/
 }

+ 4 - 2
shaders/dp_generic.glsl

@@ -6,6 +6,8 @@
 attribute vec3 position;
 attribute vec2 texCoords;
 
+uniform mat4 modelViewProjectionMat;
+
 varying vec2 texCoords_v2f;
 
 void main()
@@ -21,9 +23,9 @@ void main()
 		HWSkinning( _rot, _tsl );
 		
 		vec3 pos_lspace = ( _rot * position) + _tsl;
-		gl_Position =  gl_ModelViewProjectionMatrix * vec4(pos_lspace, 1.0);
+		gl_Position =  modelViewProjectionMat * vec4(pos_lspace, 1.0);
 	#else
-	  gl_Position =  gl_ModelViewProjectionMatrix * vec4(position, 1.0);
+	  gl_Position =  modelViewProjectionMat * vec4(position, 1.0);
 	#endif
 }
 

+ 2 - 2
src/Main.cpp

@@ -235,12 +235,12 @@ void init()
 	point_lights[1]->init( "maps/temple/light1.light" );
 	point_lights[1]->setLocalTransform( Transform( Vec3( 2.5, 1.4, 1.0 ), Mat3::getIdentity(), 1.0 ) );
 
-	/*spot_lights[0] = new SpotLight();
+	spot_lights[0] = new SpotLight();
 	spot_lights[0]->init( "maps/temple/light2.light" );
 	spot_lights[0]->setLocalTransform( Transform( Vec3( 1.3, 4.3, 3.0 ), Mat3( Euler(toRad(-20), toRad(20), 0.0) ), 1.0 ) );
 	spot_lights[1] = new SpotLight();
 	spot_lights[1]->init( "maps/temple/light3.light" );
-	spot_lights[1]->setLocalTransform( Transform( Vec3( -2.3, 6.3, 2.9 ), Mat3( Euler(toRad(-70), toRad(-20), 0.0) ), 1.0 ) );*/
+	spot_lights[1]->setLocalTransform( Transform( Vec3( -2.3, 6.3, 2.9 ), Mat3( Euler(toRad(-70), toRad(-20), 0.0) ), 1.0 ) );
 
 	// horse
 	horse = new MeshNode();

+ 3 - 3
src/Misc/collision.h

@@ -246,7 +246,7 @@ class aabb_t: public bvolume_t
 		// constructors & destractor
 		aabb_t(): bvolume_t(AABB) {}
 		aabb_t( const aabb_t& other ): bvolume_t(AABB) { (*this) = other; }
-		aabb_t( const Vec3& min_, const Vec3& max_ ): bvolume_t(AABB), min(min_), max(max_) { DEBUG_ERR( max.x<min.x || max.y<min.y || max.z<min.z ) }
+		aabb_t( const Vec3& min_, const Vec3& max_ ): bvolume_t(AABB), min(min_), max(max_) { DEBUG_ERR( max.x<min.x || max.y<min.y || max.z<min.z ); }
 
 		// operators
 		aabb_t& operator =( const aabb_t& other ) { min=other.min; max=other.max; return (*this); }
@@ -301,8 +301,8 @@ class obb_t: public bvolume_t
 		bool Intersects( const obb_t& obb ) const;
 		bool SeperationTest( const bvolume_t& bv, Vec3& normal, Vec3& impact_point, float& depth ) const;
 		bool SeperationTest( const bsphere_t& sphere, Vec3& normal, Vec3& impact_point, float& depth ) const;
-		bool SeperationTest( const aabb_t& /*aabb*/, Vec3& /*normal*/, Vec3& /*impact_point*/, float& /*depth*/ ) const { ERROR("ToDo") return false; }
-		bool SeperationTest( const obb_t& /*obb*/, Vec3& /*normal*/, Vec3& /*impact_point*/, float& /*depth*/ ) const { ERROR("ToDo") return false; }
+		bool SeperationTest( const aabb_t& /*aabb*/, Vec3& /*normal*/, Vec3& /*impact_point*/, float& /*depth*/ ) const { ERROR("ToDo"); return false; }
+		bool SeperationTest( const obb_t& /*obb*/, Vec3& /*normal*/, Vec3& /*impact_point*/, float& /*depth*/ ) const { ERROR("ToDo"); return false; }
 
 		// other funcs
 		void Set( const void* pointer, uint stride, int count ); ///< Set from vec3 array

+ 1 - 1
src/Physics/PhyWorld.cpp

@@ -7,7 +7,7 @@
 btRigidBody* PhyWorld::createNewRigidBody( float mass, const Transform& startTransform, btCollisionShape* shape, SceneNode* node, int group,
                                            int mask )
 {
-	DEBUG_ERR( shape==NULL || shape->getShapeType()==INVALID_SHAPE_PROXYTYPE )
+	DEBUG_ERR( shape==NULL || shape->getShapeType()==INVALID_SHAPE_PROXYTYPE );
 
 	//rigidbody is dynamic if and only if mass is non zero, otherwise static
 	bool isDynamic = (mass != 0.0);

+ 6 - 0
src/Renderer/Dbg.cpp

@@ -1,3 +1,9 @@
+/**
+ * @file
+ *
+ * Debugging stage
+ */
+
 #include "Renderer.h"
 #include "App.h"
 #include "Scene.h"

+ 6 - 0
src/Renderer/Ez.cpp

@@ -1,3 +1,9 @@
+/**
+ * @file
+ *
+ * Material stage EarlyZ pass
+ */
+
 #include "Renderer.h"
 #include "App.h"
 #include "MeshNode.h"

+ 6 - 0
src/Renderer/Hdr.cpp

@@ -1,3 +1,9 @@
+/**
+ * @file
+ *
+ * Post-processing stage hight dynamic range lighting pass
+ */
+
 #include "Renderer.h"
 
 

+ 21 - 15
src/Renderer/Is.cpp

@@ -1,3 +1,9 @@
+/**
+ * @file
+ *
+ * Illumination stage
+ */
+
 #include "Renderer.h"
 #include "Camera.h"
 #include "Light.h"
@@ -164,6 +170,8 @@ void Renderer::Is::init()
 	spotLightNoShadowSProg.uniVars.texProjectionMat = spotLightNoShadowSProg.findUniVar("texProjectionMat");
 
 	string pps = "#define SHADOWMAP_SIZE " + Util::intToStr( sm.resolution ) + "\n#define _SPOT_LIGHT_\n#define _SHADOW_\n";
+	if( sm.pcfEnabled )
+		pps += "#define PCF_ENABLED";
 	spotLightShadowSProg.customLoad( "shaders/IsLpGeneric.glsl", pps.c_str() );
 	spotLightShadowSProg.uniVars.msNormalFai = spotLightShadowSProg.findUniVar("msNormalFai");
 	spotLightShadowSProg.uniVars.msDiffuseFai = spotLightShadowSProg.findUniVar("msDiffuseFai");
@@ -373,11 +381,6 @@ void Renderer::Is::spotLightPass( const SpotLight& light )
 	//
 	if( !cam.insideFrustum( light.camera ) ) return;
 
-	//
-	// stencil optimization
-	//
-	stencilOptPass( light );
-
 	//
 	// generate the shadow map (if needed)
 	//
@@ -394,6 +397,11 @@ void Renderer::Is::spotLightPass( const SpotLight& light )
 		glDisable( GL_DEPTH_TEST );
 	}
 
+	//
+	// stencil optimization
+	//
+	stencilOptPass( light );
+
 	//
 	// set the shader and uniforms
 	//
@@ -406,15 +414,12 @@ void Renderer::Is::spotLightPass( const SpotLight& light )
 
 	shdr->bind();
 
-	// bind the framebuffer attachable images
+	// bind the FAIs
 	shdr->uniVars.msNormalFai->setTexture( r.ms.normalFai, 0 );
 	shdr->uniVars.msDiffuseFai->setTexture( r.ms.diffuseFai, 1 );
 	shdr->uniVars.msSpecularFai->setTexture( r.ms.specularFai, 2 );
 	shdr->uniVars.msDepthFai->setTexture( r.ms.depthFai, 3 );
 
-	if( light.lightProps->getTexture() == NULL )
-		ERROR( "No texture is attached to the light. lightProps name: " << light.lightProps->getRsrcName() );
-
 	// the planes
 	shdr->uniVars.planes->setVec2( &planes );
 
@@ -426,7 +431,10 @@ void Renderer::Is::spotLightPass( const SpotLight& light )
 	shdr->uniVars.lightSpecularCol->setVec3( &light.lightProps->getSpecularColor() );
 
 	// set the light texture
-	shdr->uniVars.lightTex->setTexture( *light.lightProps->getTexture(), 3 );
+	if( light.lightProps->getTexture() == NULL )
+		ERROR( "No texture is attached to the light. lightProps name: " << light.lightProps->getRsrcName() );
+	else
+		shdr->uniVars.lightTex->setTexture( *light.lightProps->getTexture(), 4 );
 
 	/*
 	 * Before we render disable anisotropic in the light.texture because it produces artifacts.
@@ -443,9 +451,10 @@ void Renderer::Is::spotLightPass( const SpotLight& light )
 	static Mat4 biasMat4( 0.5, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0 );
 	Mat4 texProjectionMat;
 	texProjectionMat = biasMat4 * light.camera.getProjectionMatrix() *
-	                   Mat4::combineTransformations( light.camera.getViewMatrix(), Mat4( cam.getWorldTransform() ) );
+	                   Mat4::combineTransformations( light.camera.getViewMatrix(), Mat4( cam.getWorldTransform() ) ) ;
 	shdr->uniVars.texProjectionMat->setMat4( &texProjectionMat );
 
+
 	// the shadow stuff
 	if( light.castsShadow && sm.enabled )
 	{
@@ -466,11 +475,8 @@ void Renderer::Is::spotLightPass( const SpotLight& light )
 	glDisableVertexAttribArray( 0 );
 	glDisableVertexAttribArray( 1 );
 
-	// restore texture matrix
-	glMatrixMode( GL_TEXTURE );
-	glLoadIdentity();
-	glMatrixMode(GL_MODELVIEW);
 
+	// restore
 	glDisable( GL_STENCIL_TEST );
 }
 

+ 5 - 2
src/Renderer/MainRenderer.cpp

@@ -211,7 +211,10 @@ void MainRenderer::takeScreenshot( const char* filename )
 		ERROR( "File \"" << filename << "\": Unsupported extension. Watch for capital" );
 		return;
 	}
-	if( !ret ) ERROR( "In taking screenshot" )
-	else PRINT( "Screenshot \"" << filename << "\" saved" );
+
+	if( !ret )
+		ERROR( "In taking screenshot" );
+	else
+		INFO( "Screenshot \"" << filename << "\" saved" );
 }
 

+ 6 - 0
src/Renderer/Pps.cpp

@@ -1,3 +1,9 @@
+/**
+ * @file
+ *
+ * Post-processing stage
+ */
+
 #include "Renderer.h"
 
 

+ 1 - 1
src/Renderer/Renderer.cpp

@@ -69,7 +69,7 @@ void Renderer::render( Camera& cam_ )
 	ms.run();
 	is.run();
 	pps.run();
-	//dbg.run();
+	dbg.run();
 
 	++framesNum;
 }

+ 7 - 1
src/Renderer/Sm.cpp

@@ -1,3 +1,9 @@
+/**
+ * @file
+ *
+ * Illumination stage shadowmapping pass
+ */
+
 #include "Renderer.h"
 #include "App.h"
 #include "Scene.h"
@@ -27,7 +33,7 @@ void Renderer::Is::Sm::init()
 	shadowMap.texParameter( GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE );
 	shadowMap.texParameter( GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL );
 	/*
-	 * If you dont want to use the FFP for comparing the shadwomap (the above two lines) then you can make the comparison
+	 * If you dont want to use the FFP for comparing the shadowmap (the above two lines) then you can make the comparison
 	 * inside the glsl shader. The GL_LEQUAL means that: shadow = ( R <= Dt ) ? 1.0 : 0.0; . The R is given by:
 	 * R = _tex_coord2.z/_tex_coord2.w; and the Dt = shadow2D(shadow_depth_map, _shadow_uv ).r (see lp_generic.frag).
 	 * Hardware filters like GL_LINEAR cannot be applied.

+ 5 - 0
src/Renderer/Smo.cpp

@@ -0,0 +1,5 @@
+/**
+ * @file
+ *
+ * Illumination stage stencil masking optimization passes
+ */

+ 6 - 0
src/Renderer/Ssao.cpp

@@ -1,3 +1,9 @@
+/**
+ * @file
+ *
+ * Post-processing stage screen space ambient occlusion pass
+ */
+
 #include "Renderer.h"
 #include "Camera.h"
 

+ 1 - 1
src/Resources/Texture.cpp

@@ -91,7 +91,7 @@ bool Texture::createEmpty2D( float width_, float height_, int internalFormat, in
 
 	target = GL_TEXTURE_2D;
 	DEBUG_ERR( internalFormat>0 && internalFormat<=4 ); // deprecated internal format
-	DEBUG_ERR( glId != numeric_limits<uint>::max() ) // Texture already loaded
+	DEBUG_ERR( glId != numeric_limits<uint>::max() ); // Texture already loaded
 
 	// GL stuff
 	glGenTextures( 1, &glId );

+ 1 - 1
src/Util/App.cpp

@@ -213,7 +213,7 @@ void App::printAppInfo()
 	msg << "build date " __DATE__ << ", ";
 	msg << "rev " << REVISION;
 
-	INFO( msg.str() )
+	INFO( msg.str() );
 }
 
 

+ 5 - 5
src/Util/Common.h

@@ -59,22 +59,22 @@ extern ostream& msgSuffix( ostream& cs );
 #endif
 
 /// Use it like this: ERROR( "tralala" << 10 << ' ' )
-#define ERROR( x ) msgPrefix( MT_ERROR, __FILE__, __LINE__, FUNCTION ) << x << msgSuffix;
+#define ERROR( x ) msgPrefix( MT_ERROR, __FILE__, __LINE__, FUNCTION ) << x << msgSuffix
 
 /// Show a warning
-#define WARNING( x ) msgPrefix( MT_WARNING, __FILE__, __LINE__, FUNCTION ) << x << msgSuffix;
+#define WARNING( x ) msgPrefix( MT_WARNING, __FILE__, __LINE__, FUNCTION ) << x << msgSuffix
 
 /// Show an error and exit application
 #define FATAL( x ) { msgPrefix( MT_FATAL, __FILE__, __LINE__, FUNCTION ) << x << ". Bye!" << msgSuffix; ::exit( 1 ); }
 
 /// Show an info message
-#define INFO( x ) msgPrefix( MT_INFO, __FILE__, __LINE__, FUNCTION ) << x << msgSuffix;
+#define INFO( x ) msgPrefix( MT_INFO, __FILE__, __LINE__, FUNCTION ) << x << msgSuffix
 
 /// Reverse assertion
 #ifdef DEBUG
 	#define DEBUG_ERR( x ) \
 		if( x ) \
-			msgPrefix( MT_DEBUG_ERR, __FILE__, __LINE__, FUNCTION ) << #x << msgSuffix;
+			msgPrefix( MT_DEBUG_ERR, __FILE__, __LINE__, FUNCTION ) << #x << msgSuffix
 #else
 	#define DEBUG_ERR( x )
 #endif
@@ -132,7 +132,7 @@ extern ostream& msgSuffix( ostream& cs );
 
 
 /// Just print
-#define PRINT( x ) cout << x << endl;
+#define PRINT( x ) cout << x << endl
 
 
 /// BUFFER_OFFSET

+ 1 - 1
src/Util/Tokenizer/Scanner.cpp

@@ -261,7 +261,7 @@ bool Scanner::loadIstream( istream& istream_, const char* scriptName_ )
 	inStream = &istream_;
 
 	// init globals
-	DEBUG_ERR( strlen(scriptName_) > sizeof(scriptName)/sizeof(char) - 1 ) // Too big name
+	DEBUG_ERR( strlen(scriptName_) > sizeof(scriptName)/sizeof(char) - 1 ); // Too big name
 	crntToken.code = TC_ERROR;
 	lineNmbr = 0;
 	strcpy( scriptName, scriptName_ );