소스 검색

- The column width is now 120
- New error code

Panagiotis Christopoulos Charitos 15 년 전
부모
커밋
817a11e9df
57개의 변경된 파일1463개의 추가작업 그리고 1447개의 파일을 삭제
  1. 388 471
      build/debug/Makefile
  2. 2 2
      build/debug/gen.cfg.py
  3. 9 8
      src/Main.cpp
  4. 15 15
      src/Math/MathFuncs.h
  5. 86 85
      src/Math/MathFuncs.inl.h
  6. 99 99
      src/Misc/collision.cpp
  7. 8 8
      src/Misc/collision.h
  8. 11 11
      src/Misc/map.cpp
  9. 2 2
      src/Misc/map.h
  10. 34 34
      src/Misc/memory.cpp
  11. 4 4
      src/Misc/particles.cpp
  12. 1 1
      src/Misc/particles.h
  13. 3 3
      src/Misc/skybox.cpp
  14. 3 3
      src/Physics/PhyWorld.cpp
  15. 18 18
      src/Renderer/Dbg.cpp
  16. 6 6
      src/Renderer/Ez.cpp
  17. 17 17
      src/Renderer/Hdr.cpp
  18. 3 3
      src/Renderer/Is.cpp
  19. 15 15
      src/Renderer/MainRenderer.cpp
  20. 6 6
      src/Renderer/Ms.cpp
  21. 6 6
      src/Renderer/Pps.cpp
  22. 36 36
      src/Renderer/Renderer.cpp
  23. 9 9
      src/Renderer/Renderer.h
  24. 6 6
      src/Renderer/Sm.cpp
  25. 16 14
      src/Renderer/Ssao.cpp
  26. 15 15
      src/Resources/Helpers/Image.cpp
  27. 29 23
      src/Resources/Helpers/ShaderPrePreprocessor.cpp
  28. 10 6
      src/Resources/Helpers/ShaderPrePreprocessor.h
  29. 6 6
      src/Resources/LightProps.cpp
  30. 18 18
      src/Resources/Material.cpp
  31. 8 7
      src/Resources/Material.h
  32. 24 24
      src/Resources/Mesh.cpp
  33. 1 1
      src/Resources/Resource.cpp
  34. 2 2
      src/Resources/Resource.h
  35. 48 55
      src/Resources/ShaderProg.cpp
  36. 3 16
      src/Resources/ShaderProg.h
  37. 3 3
      src/Resources/SkelAnim.cpp
  38. 3 3
      src/Resources/Skeleton.cpp
  39. 21 21
      src/Resources/Texture.cpp
  40. 30 30
      src/Scene/Camera.cpp
  41. 15 15
      src/Scene/Controllers/SkelAnimCtrl.cpp
  42. 18 18
      src/Scene/Light.cpp
  43. 9 9
      src/Scene/MeshNode.cpp
  44. 12 12
      src/Scene/ParticleEmitter.cpp
  45. 18 18
      src/Scene/Scene.cpp
  46. 19 19
      src/Scene/SceneNode.cpp
  47. 12 12
      src/Scene/SkelNode.cpp
  48. 17 17
      src/Ui/Ui.cpp
  49. 59 42
      src/Util/App.cpp
  50. 2 1
      src/Util/App.h
  51. 105 0
      src/Util/Common.cpp
  52. 43 62
      src/Util/Common.h
  53. 7 7
      src/Util/Input.cpp
  54. 6 6
      src/Util/Tokenizer/Parser.h
  55. 64 64
      src/Util/Tokenizer/Scanner.cpp
  56. 6 6
      src/Util/Tokenizer/Scanner.h
  57. 27 27
      src/Util/Util.cpp

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 388 - 471
build/debug/Makefile


+ 2 - 2
build/debug/gen.cfg.py

@@ -7,6 +7,6 @@ precompiledHeaders = []
 executableName = "AnKi.bin"
 compiler = "g++"
 commonFlags_ = ""
-compilerFlags = "-c -pedantic-errors -pedantic -ansi -Wall -Wextra -W -pipe -O0 -g3 -pg -fsingle-precision-constant -D_DEBUG_ -D_TERMINAL_COLORING__ -DPLATFORM=LINUX -DREVISION=\\\"`svnversion -c ../..`\\\" "
+compilerFlags = "-c -pedantic-errors -pedantic -ansi -Wall -Wextra -W -pipe -O0 -g3 -pg -fsingle-precision-constant -DDEBUG -DPLATFORM_LINUX -DREVISION=\\\"`svnversion -c ../..`\\\" "
 precompiledHeadersFlags = compilerFlags + " -x "
-linkerFlags = "-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" # a few libs are now static
+linkerFlags = "-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"

+ 9 - 8
src/Main.cpp

@@ -189,9 +189,9 @@ void initPhysics()
 
 
 
-//=====================================================================================================================================
-// init                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// init                                                                                                                =
+//======================================================================================================================
 void init()
 {
 	INFO( "Engine initializing..." );
@@ -291,13 +291,14 @@ void init()
 }
 
 
-
-//=====================================================================================================================================
-// main                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// main                                                                                                                =
+//======================================================================================================================
 int main( int argc, char* argv[] )
 {
-	app = new App( argc, argv );
+	app = new App;
+	app->init( argc, argv );
+
 	init();
 
 	INFO( "Entering main loop" );

+ 15 - 15
src/Math/MathFuncs.h

@@ -12,29 +12,29 @@ const float PI = 3.14159265358979323846;
 const float EPSILON = 1.0e-6;
 
 
-void  mathSanityChecks(); ///< Used to test the compiler
-void  sinCos( float rad, float& sin_, float& cos_ ); ///< A fast func that given the angle in rads it returns the sin and cos
-float invSqrt( float f ); ///< Inverted square root
-float sqrt( float f ); ///< Square root
-float toRad( float degrees );
-float toDegrees( float rad );
-float sin( float rad );
-float cos( float rad );
-bool  isZero( float f ); ///< The proper way to test if a float is zero
+extern void  mathSanityChecks(); ///< Used to test the compiler
+extern void  sinCos( float rad, float& sin_, float& cos_ ); ///< A fast func that given the angle in rads it returns the sin and cos
+extern float invSqrt( float f ); ///< Inverted square root
+extern float sqrt( float f ); ///< Square root
+extern float toRad( float degrees );
+extern float toDegrees( float rad );
+extern float sin( float rad );
+extern float cos( float rad );
+extern bool  isZero( float f ); ///< The proper way to test if a float is zero
 
 /**
  * mat4(t0,r0,s0)*mat4(t1,r1,s1) == mat4(tf,rf,sf)
  */
-void combineTransformations( const Vec3& t0, const Mat3& r0, float s0, // in 0
-                             const Vec3& t1, const Mat3& r1, float s1, // in 1
-                             Vec3& tf, Mat3& rf, float& sf ); // out
+extern void combineTransformations( const Vec3& t0, const Mat3& r0, float s0, // in 0
+                                    const Vec3& t1, const Mat3& r1, float s1, // in 1
+                                    Vec3& tf, Mat3& rf, float& sf ); // out
 
 /**
  * mat4(t0,r0,1.0)*mat4(t1,r1,1.0) == mat4(tf,rf,sf)
  */
-void combineTransformations( const Vec3& t0, const Mat3& r0, // in 0
-                             const Vec3& t1, const Mat3& r1, // in 1
-                             Vec3& tf, Mat3& rf); // out
+extern void combineTransformations( const Vec3& t0, const Mat3& r0, // in 0
+                                    const Vec3& t1, const Mat3& r1, // in 1
+                                    Vec3& tf, Mat3& rf); // out
 
 
 } // end namespace

+ 86 - 85
src/Math/MathFuncs.inl.h

@@ -5,112 +5,113 @@ namespace M {
 
 
 // mathSanityChecks
-// test if the compiler keeps the correct sizes for the classes
 inline void mathSanityChecks()
 {
 	const int fs = sizeof(float); // float size
-	if( sizeof(Vec2)!=fs*2 || sizeof(Vec3)!=fs*3 || sizeof(Vec4)!=fs*4 || sizeof(Quat)!=fs*4 || sizeof(Euler)!=fs*3 ||
-	    sizeof(Mat3)!=fs*9 || sizeof(Mat4)!=fs*16 )
-		FATAL("Your compiler does class alignment. Quiting");
+	if( sizeof(Vec2)!=fs*2 || sizeof(Vec3)!=fs*3 || sizeof(Vec4)!=fs*4 || sizeof(Quat)!=fs*4 ||
+	    sizeof(Euler)!=fs*3 || sizeof(Mat3)!=fs*9 || sizeof(Mat4)!=fs*16 )
+	{
+		FATAL("Your compiler does class alignment");
+	}
 }
 
 
 // 1/sqrt(f)
 inline float invSqrt( float f )
 {
-#if defined( _DEBUG_ )
-	return 1.0/sqrtf(f);
-#elif PLATFORM==WIN
-	float fhalf = 0.5*f;
-	int i = *(int*)&f;
-	i = 0x5F3759DF - (i>>1);
-	f = *(float*)&i;
-	f *= 1.5 - fhalf*f*f;
-	return f;
-#elif PLATFORM==LINUX
-	float fhalf = 0.5*f;
-	asm
-	(
-		"mov %1, %%eax;"
-		"sar %%eax;"
-		"mov $0x5F3759DF, %%ebx;"
-		"sub %%eax, %%ebx;"
-		"mov %%ebx, %0"
-		:"=g"(f)
-		:"g"(f)
-		:"%eax", "%ebx"
-	);
-	f *= 1.5 - fhalf*f*f;
-	return f;
-#else
-	#error "See file"
-#endif
+	#if defined( PLATFORM_WIN )
+		float fhalf = 0.5*f;
+		int i = *(int*)&f;
+		i = 0x5F3759DF - (i>>1);
+		f = *(float*)&i;
+		f *= 1.5 - fhalf*f*f;
+		return f;
+	#elif defined( PLATFORM_LINUX )
+		float fhalf = 0.5*f;
+		asm
+		(
+			"mov %1, %%eax;"
+			"sar %%eax;"
+			"mov $0x5F3759DF, %%ebx;"
+			"sub %%eax, %%ebx;"
+			"mov %%ebx, %0"
+			:"=g"(f)
+			:"g"(f)
+			:"%eax", "%ebx"
+		);
+		f *= 1.5 - fhalf*f*f;
+		return f;
+	#else
+		#error "See file"
+	#endif
 }
 
 
-// PolynomialSinQuadrant
-// used in sinCos
-#if !defined(_DEBUG_)
-inline static float PolynomialSinQuadrant(float a)
-{
-	return a * ( 1.0 + a * a * (-0.16666 + a * a * (0.0083143 - a * a * 0.00018542)));
-}
+// polynomialSinQuadrant
+#if !defined(DEBUG)
+	/**
+	 * Used in sinCos
+	 */
+	inline static float polynomialSinQuadrant( float a )
+	{
+		return a * ( 1.0 + a * a * (-0.16666 + a * a * (0.0083143 - a * a * 0.00018542)));
+	}
 #endif
 
 
 // Sine and Cosine
 inline void sinCos( float a, float& sina, float& cosa )
 {
-#ifdef _DEBUG_
-	sina = M::sin(a);
-	cosa = M::cos(a);
-#else
-	bool negative = false;
-	if (a < 0.0)
-	{
-		a = -a;
-		negative = true;
-	}
-	const float kTwoOverPi = 1.0 / (PI/2.0);
-	float floatA = kTwoOverPi * a;
-	int int_a = (int)floatA;
-
-	const float k_rational_half_pi = 201 / 128.0;
-	const float kRemainderHalfPi = 4.8382679e-4;
-
-	floatA = (a - k_rational_half_pi * int_a) - kRemainderHalfPi * int_a;
-
-	float floatAMinusHalfPi = (floatA - k_rational_half_pi) - kRemainderHalfPi;
-
-	switch( int_a & 3 )
-	{
-	case 0: // 0 - Pi/2
-		sina = PolynomialSinQuadrant(floatA);
-		cosa = PolynomialSinQuadrant(-floatAMinusHalfPi);
-		break;
-	case 1: // Pi/2 - Pi
-		sina = PolynomialSinQuadrant(-floatAMinusHalfPi);
-		cosa = PolynomialSinQuadrant(-floatA);
-		break;
-	case 2: // Pi - 3Pi/2
-		sina = PolynomialSinQuadrant(-floatA);
-		cosa = PolynomialSinQuadrant(floatAMinusHalfPi);
-		break;
-	case 3: // 3Pi/2 - 2Pi
-		sina = PolynomialSinQuadrant(floatAMinusHalfPi);
-		cosa = PolynomialSinQuadrant(floatA);
-		break;
-	};
-
-	if( negative )
-		sina = -sina;
-#endif
+	#ifdef DEBUG
+		sina = M::sin(a);
+		cosa = M::cos(a);
+	#else
+		bool negative = false;
+		if (a < 0.0)
+		{
+			a = -a;
+			negative = true;
+		}
+		const float kTwoOverPi = 1.0 / (PI/2.0);
+		float floatA = kTwoOverPi * a;
+		int intA = (int)floatA;
+
+		const float k_rational_half_pi = 201 / 128.0;
+		const float kRemainderHalfPi = 4.8382679e-4;
+
+		floatA = (a - k_rational_half_pi * intA) - kRemainderHalfPi * intA;
+
+		float floatAMinusHalfPi = (floatA - k_rational_half_pi) - kRemainderHalfPi;
+
+		switch( intA & 3 )
+		{
+			case 0: // 0 - Pi/2
+				sina = polynomialSinQuadrant(floatA);
+				cosa = polynomialSinQuadrant(-floatAMinusHalfPi);
+				break;
+			case 1: // Pi/2 - Pi
+				sina = polynomialSinQuadrant(-floatAMinusHalfPi);
+				cosa = polynomialSinQuadrant(-floatA);
+				break;
+			case 2: // Pi - 3Pi/2
+				sina = polynomialSinQuadrant(-floatA);
+				cosa = polynomialSinQuadrant(floatAMinusHalfPi);
+				break;
+			case 3: // 3Pi/2 - 2Pi
+				sina = polynomialSinQuadrant(floatAMinusHalfPi);
+				cosa = polynomialSinQuadrant(floatA);
+				break;
+		};
+
+		if( negative )
+			sina = -sina;
+	#endif
 }
 
 
-//=====================================================================================================================================
-// Small funcs                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// Small funcs                                                                                                         =
+//======================================================================================================================
 inline float sqrt( float f ) { return 1/invSqrt(f); }
 inline float toRad( float degrees ) { return degrees*(PI/180.0); }
 inline float toDegrees( float rad ) { return rad*(180.0/PI); }

+ 99 - 99
src/Misc/collision.cpp

@@ -12,7 +12,7 @@ static int render_seperation_lock = 0;
 
 /*
 =======================================================================================================================================
-misc                                                                                                                                  =
+misc                                                                                                                   =
 =======================================================================================================================================
 */
 static void RenderSeparationData( const Vec3& normal, const Vec3& impact_point, float depth )
@@ -45,7 +45,7 @@ static void RenderSeparationData( const Vec3& normal, const Vec3& impact_point,
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
+Intersects                                                                                                             =
 =======================================================================================================================================
 */
 bool bvolume_t::Intersects( const bvolume_t& bv ) const
@@ -73,7 +73,7 @@ bool bvolume_t::Intersects( const bvolume_t& bv ) const
 
 /*
 =======================================================================================================================================
-SeperationTest                                                                                                                        =
+SeperationTest                                                                                                         =
 =======================================================================================================================================
 */
 bool bvolume_t::SeperationTest( const bvolume_t& bv, Vec3& normal, Vec3& impact_point, float& depth ) const
@@ -95,8 +95,8 @@ bool bvolume_t::SeperationTest( const bvolume_t& bv, Vec3& normal, Vec3& impact_
 
 /*
 =======================================================================================================================================
-getDistanceSquared                                                                                                                       =
-seg - seg                                                                                                                             =
+getDistanceSquared                                                                                                        =
+seg - seg                                                                                                              =
 =======================================================================================================================================
 */
 float lineseg_t::DistanceSquared( const lineseg_t& ls, float& s_c, float& t_c ) const
@@ -185,8 +185,8 @@ float lineseg_t::DistanceSquared( const lineseg_t& ls, float& s_c, float& t_c )
 
 /*
 =======================================================================================================================================
-getDistanceSquared                                                                                                                       =
-seg - ray                                                                                                                             =
+getDistanceSquared                                                                                                        =
+seg - ray                                                                                                              =
 =======================================================================================================================================
 */
 float lineseg_t::DistanceSquared( const ray_t& ray, float& s_c, float& t_c ) const
@@ -262,8 +262,8 @@ float lineseg_t::DistanceSquared( const ray_t& ray, float& s_c, float& t_c ) con
 
 /*
 =======================================================================================================================================
-getDistanceSquared                                                                                                                       =
-seg - point                                                                                                                           =
+getDistanceSquared                                                                                                        =
+seg - point                                                                                                            =
 =======================================================================================================================================
 */
 float lineseg_t::DistanceSquared( const Vec3& point, float& t_c ) const
@@ -297,8 +297,8 @@ float lineseg_t::DistanceSquared( const Vec3& point, float& t_c ) const
 
 /*
 =======================================================================================================================================
-ClosestPoints                                                                                                                         =
-seg - seg                                                                                                                             =
+ClosestPoints                                                                                                          =
+seg - seg                                                                                                              =
 =======================================================================================================================================
 */
 void lineseg_t::ClosestPoints( const lineseg_t& segment1, Vec3& point0, Vec3& point1 ) const
@@ -388,8 +388,8 @@ void lineseg_t::ClosestPoints( const lineseg_t& segment1, Vec3& point0, Vec3& po
 
 /*
 =======================================================================================================================================
-ClosestPoints                                                                                                                         =
-seg - ray                                                                                                                             =
+ClosestPoints                                                                                                          =
+seg - ray                                                                                                              =
 =======================================================================================================================================
 */
 void lineseg_t::ClosestPoints( const ray_t& ray, Vec3& point0, Vec3& point1 ) const
@@ -473,8 +473,8 @@ void lineseg_t::ClosestPoints( const ray_t& ray, Vec3& point0, Vec3& point1 ) co
 
 /*
 =======================================================================================================================================
-ClosestPoints                                                                                                                         =
-seg - point                                                                                                                           =
+ClosestPoints                                                                                                          =
+seg - point                                                                                                            =
 =======================================================================================================================================
 */
 Vec3 lineseg_t::ClosestPoints( const Vec3& point ) const
@@ -499,7 +499,7 @@ Vec3 lineseg_t::ClosestPoints( const Vec3& point ) const
 
 /*
 =======================================================================================================================================
-Transformed                                                                                                                           =
+Transformed                                                                                                            =
 =======================================================================================================================================
 */
 lineseg_t lineseg_t::Transformed( const Vec3& translate, const Mat3& rotate, float scale  ) const
@@ -515,7 +515,7 @@ lineseg_t lineseg_t::Transformed( const Vec3& translate, const Mat3& rotate, flo
 
 /*
 =======================================================================================================================================
-render                                                                                                                                =
+render                                                                                                                 =
 =======================================================================================================================================
 */
 void lineseg_t::Render()
@@ -548,7 +548,7 @@ void lineseg_t::Render()
 
 /*
 =======================================================================================================================================
-PlaneTest                                                                                                                             =
+PlaneTest                                                                                                              =
 =======================================================================================================================================
 */
 float lineseg_t::PlaneTest( const plane_t& plane ) const
@@ -578,8 +578,8 @@ float lineseg_t::PlaneTest( const plane_t& plane ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-line - sphere                                                                                                                         =
+Intersects                                                                                                             =
+line - sphere                                                                                                          =
 =======================================================================================================================================
 */
 bool lineseg_t::Intersects( const bsphere_t& sphere ) const
@@ -590,8 +590,8 @@ bool lineseg_t::Intersects( const bsphere_t& sphere ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-line - aabb                                                                                                                           =
+Intersects                                                                                                             =
+line - aabb                                                                                                            =
 =======================================================================================================================================
 */
 bool lineseg_t::Intersects( const aabb_t& box ) const
@@ -602,8 +602,8 @@ bool lineseg_t::Intersects( const aabb_t& box ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-line - obb                                                                                                                            =
+Intersects                                                                                                             =
+line - obb                                                                                                             =
 =======================================================================================================================================
 */
 bool lineseg_t::Intersects( const obb_t& obb ) const
@@ -614,7 +614,7 @@ bool lineseg_t::Intersects( const obb_t& obb ) const
 
 /*
 =======================================================================================================================================
-Transformed                                                                                                                           =
+Transformed                                                                                                            =
 =======================================================================================================================================
 */
 ray_t ray_t::Transformed( const Vec3& translate, const Mat3& rotate, float scale ) const
@@ -641,7 +641,7 @@ ray_t ray_t::Transformed( const Vec3& translate, const Mat3& rotate, float scale
 
 /*
 =======================================================================================================================================
-render                                                                                                                                =
+render                                                                                                                 =
 =======================================================================================================================================
 */
 void ray_t::Render()
@@ -673,7 +673,7 @@ void ray_t::Render()
 
 /*
 =======================================================================================================================================
-PlaneTest                                                                                                                             =
+PlaneTest                                                                                                              =
 =======================================================================================================================================
 */
 float ray_t::PlaneTest( const plane_t& plane ) const
@@ -700,8 +700,8 @@ float ray_t::PlaneTest( const plane_t& plane ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-ray - sphere                                                                                                                          =
+Intersects                                                                                                             =
+ray - sphere                                                                                                           =
 =======================================================================================================================================
 */
 bool ray_t::Intersects( const bsphere_t& sphere ) const
@@ -712,8 +712,8 @@ bool ray_t::Intersects( const bsphere_t& sphere ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-ray - aabb                                                                                                                            =
+Intersects                                                                                                             =
+ray - aabb                                                                                                             =
 =======================================================================================================================================
 */
 bool ray_t::Intersects( const aabb_t& box ) const
@@ -724,8 +724,8 @@ bool ray_t::Intersects( const aabb_t& box ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-ray - obb                                                                                                                             =
+Intersects                                                                                                             =
+ray - obb                                                                                                              =
 =======================================================================================================================================
 */
 bool ray_t::Intersects( const obb_t& obb ) const
@@ -737,8 +737,8 @@ bool ray_t::Intersects( const obb_t& obb ) const
 
 /*
 =======================================================================================================================================
-Set                                                                                                                                   =
-from plane eqtuation                                                                                                                  =
+Set                                                                                                                    =
+from plane eqtuation                                                                                                   =
 =======================================================================================================================================
 */
 void plane_t::Set( float a, float b, float c, float d )
@@ -765,8 +765,8 @@ void plane_t::Set( float a, float b, float c, float d )
 
 /*
 =======================================================================================================================================
-Set                                                                                                                                   =
-from 3 points                                                                                                                         =
+Set                                                                                                                    =
+from 3 points                                                                                                          =
 =======================================================================================================================================
 */
 void plane_t::Set( const Vec3& p0, const Vec3& p1, const Vec3& p2 )
@@ -788,7 +788,7 @@ void plane_t::Set( const Vec3& p0, const Vec3& p1, const Vec3& p2 )
 
 /*
 =======================================================================================================================================
-Transformed                                                                                                                           =
+Transformed                                                                                                            =
 =======================================================================================================================================
 */
 plane_t plane_t::Transformed( const Vec3& translate, const Mat3& rotate, float scale ) const
@@ -808,7 +808,7 @@ plane_t plane_t::Transformed( const Vec3& translate, const Mat3& rotate, float s
 
 /*
 =======================================================================================================================================
-render                                                                                                                                =
+render                                                                                                                 =
 =======================================================================================================================================
 */
 void plane_t::Render()
@@ -855,8 +855,8 @@ void plane_t::Render()
 
 /*
 =======================================================================================================================================
-Set                                                                                                                                   =
-from a vec3 array                                                                                                                     =
+Set                                                                                                                    =
+from a vec3 array                                                                                                      =
 =======================================================================================================================================
 */
 void bsphere_t::Set( const void* pointer, uint stride, int count )
@@ -901,7 +901,7 @@ void bsphere_t::Set( const void* pointer, uint stride, int count )
 
 /*
 =======================================================================================================================================
-render                                                                                                                                =
+render                                                                                                                 =
 =======================================================================================================================================
 */
 void bsphere_t::Render()
@@ -920,7 +920,7 @@ void bsphere_t::Render()
 
 /*
 =======================================================================================================================================
-Transformed                                                                                                                           =
+Transformed                                                                                                            =
 =======================================================================================================================================
 */
 bsphere_t bsphere_t::Transformed( const Vec3& translate, const Mat3& rotate, float scale ) const
@@ -935,8 +935,8 @@ bsphere_t bsphere_t::Transformed( const Vec3& translate, const Mat3& rotate, flo
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-sphere - sphere                                                                                                                       =
+Intersects                                                                                                             =
+sphere - sphere                                                                                                        =
 =======================================================================================================================================
 */
 bool bsphere_t::Intersects( const bsphere_t& other ) const
@@ -948,8 +948,8 @@ bool bsphere_t::Intersects( const bsphere_t& other ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-sphere - aabb                                                                                                                         =
+Intersects                                                                                                             =
+sphere - aabb                                                                                                          =
 =======================================================================================================================================
 */
 bool bsphere_t::Intersects( const aabb_t& box ) const
@@ -960,8 +960,8 @@ bool bsphere_t::Intersects( const aabb_t& box ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-sphere - ray                                                                                                                          =
+Intersects                                                                                                             =
+sphere - ray                                                                                                           =
 =======================================================================================================================================
 */
 bool bsphere_t::Intersects( const ray_t& ray ) const
@@ -983,8 +983,8 @@ bool bsphere_t::Intersects( const ray_t& ray ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-sphere - segment                                                                                                                      =
+Intersects                                                                                                             =
+sphere - segment                                                                                                       =
 =======================================================================================================================================
 */
 bool bsphere_t::Intersects( const lineseg_t& segment ) const
@@ -1010,8 +1010,8 @@ bool bsphere_t::Intersects( const lineseg_t& segment ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-sphere - obb                                                                                                                          =
+Intersects                                                                                                             =
+sphere - obb                                                                                                           =
 =======================================================================================================================================
 */
 bool bsphere_t::Intersects( const obb_t& obb ) const
@@ -1022,7 +1022,7 @@ bool bsphere_t::Intersects( const obb_t& obb ) const
 
 /*
 =======================================================================================================================================
-PlaneTest                                                                                                                             =
+PlaneTest                                                                                                              =
 =======================================================================================================================================
 */
 float bsphere_t::PlaneTest( const plane_t& plane ) const
@@ -1040,8 +1040,8 @@ float bsphere_t::PlaneTest( const plane_t& plane ) const
 
 /*
 =======================================================================================================================================
-SeperationTest                                                                                                                        =
-sphere - sphere                                                                                                                       =
+SeperationTest                                                                                                         =
+sphere - sphere                                                                                                        =
 =======================================================================================================================================
 */
 bool bsphere_t::SeperationTest( const bsphere_t& sphere, Vec3& normal, Vec3& impact_point, float& depth ) const
@@ -1071,8 +1071,8 @@ bool bsphere_t::SeperationTest( const bsphere_t& sphere, Vec3& normal, Vec3& imp
 
 /*
 =======================================================================================================================================
-SeperationTest                                                                                                                        =
-sphere - aabb                                                                                                                         =
+SeperationTest                                                                                                         =
+sphere - aabb                                                                                                          =
 =======================================================================================================================================
 */
 bool bsphere_t::SeperationTest( const aabb_t& box, Vec3& normal, Vec3& impact_point, float& depth ) const
@@ -1091,8 +1091,8 @@ bool bsphere_t::SeperationTest( const aabb_t& box, Vec3& normal, Vec3& impact_po
 
 /*
 =======================================================================================================================================
-SeperationTest                                                                                                                        =
-sphere - obb                                                                                                                          =
+SeperationTest                                                                                                         =
+sphere - obb                                                                                                           =
 =======================================================================================================================================
 */
 bool bsphere_t::SeperationTest( const obb_t& obb, Vec3& normal, Vec3& impact_point, float& depth ) const
@@ -1113,8 +1113,8 @@ bool bsphere_t::SeperationTest( const obb_t& obb, Vec3& normal, Vec3& impact_poi
 
 /*
 =======================================================================================================================================
-Set                                                                                                                                   =
-Calc origin and radius from a vec3 array                                                                                              =
+Set                                                                                                                    =
+Calc origin and radius from a vec3 array                                                                               =
 =======================================================================================================================================
 */
 void aabb_t::Set( const void* pointer, uint stride, int count )
@@ -1143,7 +1143,7 @@ void aabb_t::Set( const void* pointer, uint stride, int count )
 
 /*
 =======================================================================================================================================
-Transformed                                                                                                                           =
+Transformed                                                                                                            =
 =======================================================================================================================================
 */
 aabb_t aabb_t::Transformed( const Vec3& translate, const Mat3& rotate, float scale ) const
@@ -1181,7 +1181,7 @@ aabb_t aabb_t::Transformed( const Vec3& translate, const Mat3& rotate, float sca
 
 /*
 =======================================================================================================================================
-render                                                                                                                                =
+render                                                                                                                 =
 =======================================================================================================================================
 */
 void aabb_t::Render()
@@ -1211,8 +1211,8 @@ void aabb_t::Render()
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-aabb - aabb                                                                                                                           =
+Intersects                                                                                                             =
+aabb - aabb                                                                                                            =
 =======================================================================================================================================
 */
 bool aabb_t::Intersects( const aabb_t& other ) const
@@ -1236,8 +1236,8 @@ bool aabb_t::Intersects( const aabb_t& other ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-aabb - sphere                                                                                                                         =
+Intersects                                                                                                             =
+aabb - sphere                                                                                                          =
 =======================================================================================================================================
 */
 bool aabb_t::Intersects( const bsphere_t& sphere ) const
@@ -1268,8 +1268,8 @@ bool aabb_t::Intersects( const bsphere_t& sphere ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-aabb - ray                                                                                                                            =
+Intersects                                                                                                             =
+aabb - ray                                                                                                             =
 =======================================================================================================================================
 */
 bool aabb_t::Intersects( const ray_t& ray ) const
@@ -1317,8 +1317,8 @@ bool aabb_t::Intersects( const ray_t& ray ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-aabb - segment                                                                                                                        =
+Intersects                                                                                                             =
+aabb - segment                                                                                                         =
 =======================================================================================================================================
 */
 bool aabb_t::Intersects( const lineseg_t& segment ) const
@@ -1366,8 +1366,8 @@ bool aabb_t::Intersects( const lineseg_t& segment ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-aabb - obb                                                                                                                            =
+Intersects                                                                                                             =
+aabb - obb                                                                                                             =
 =======================================================================================================================================
 */
 bool aabb_t::Intersects( const obb_t& obb ) const
@@ -1378,7 +1378,7 @@ bool aabb_t::Intersects( const obb_t& obb ) const
 
 /*
 =======================================================================================================================================
-PlaneTest                                                                                                                             =
+PlaneTest                                                                                                              =
 =======================================================================================================================================
 */
 float aabb_t::PlaneTest( const plane_t& plane ) const
@@ -1416,8 +1416,8 @@ float aabb_t::PlaneTest( const plane_t& plane ) const
 
 /*
 =======================================================================================================================================
-SeperationTest                                                                                                                        =
-aabb - aabb                                                                                                                           =
+SeperationTest                                                                                                         =
+aabb - aabb                                                                                                            =
 =======================================================================================================================================
 */
 bool aabb_t::SeperationTest( const aabb_t& other, Vec3& normal, Vec3& impact_point, float& depth ) const
@@ -1495,8 +1495,8 @@ bool aabb_t::SeperationTest( const aabb_t& other, Vec3& normal, Vec3& impact_poi
 
 /*
 =======================================================================================================================================
-SeperationTest                                                                                                                        =
-aabb - obb                                                                                                                           =
+SeperationTest                                                                                                         =
+aabb - obb                                                                                                            =
 =======================================================================================================================================
 */
 bool aabb_t::SeperationTest( const obb_t& obb, Vec3& normal, Vec3& impact_point, float& depth ) const
@@ -1517,8 +1517,8 @@ bool aabb_t::SeperationTest( const obb_t& obb, Vec3& normal, Vec3& impact_point,
 
 /*
 =======================================================================================================================================
-SeperationTest                                                                                                                        =
-aabb - sphere                                                                                                                         =
+SeperationTest                                                                                                         =
+aabb - sphere                                                                                                          =
 =======================================================================================================================================
 */
 bool aabb_t::SeperationTest( const bsphere_t& sphere, Vec3& normal, Vec3& impact_point, float& depth ) const
@@ -1597,8 +1597,8 @@ bool aabb_t::SeperationTest( const bsphere_t& sphere, Vec3& normal, Vec3& impact
 
 /*
 =======================================================================================================================================
-Set                                                                                                                                   =
-calc from a vec3 array                                                                                                                =
+Set                                                                                                                    =
+calc from a vec3 array                                                                                                 =
 =======================================================================================================================================
 */
 void obb_t::Set( const void* pointer, uint stride, int count )
@@ -1632,7 +1632,7 @@ void obb_t::Set( const void* pointer, uint stride, int count )
 
 /*
 =======================================================================================================================================
-render                                                                                                                                =
+render                                                                                                                 =
 =======================================================================================================================================
 */
 void obb_t::Render()
@@ -1658,7 +1658,7 @@ void obb_t::Render()
 
 /*
 =======================================================================================================================================
-Transformed                                                                                                                           =
+Transformed                                                                                                            =
 =======================================================================================================================================
 */
 obb_t obb_t::Transformed( const Vec3& translate, const Mat3& rotate, float scale ) const
@@ -1675,7 +1675,7 @@ obb_t obb_t::Transformed( const Vec3& translate, const Mat3& rotate, float scale
 
 /*
 =======================================================================================================================================
-PlaneTest                                                                                                                             =
+PlaneTest                                                                                                              =
 =======================================================================================================================================
 */
 float obb_t::PlaneTest( const plane_t& plane ) const
@@ -1700,8 +1700,8 @@ float obb_t::PlaneTest( const plane_t& plane ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-obb - obb                                                                                                                             =
+Intersects                                                                                                             =
+obb - obb                                                                                                              =
 =======================================================================================================================================
 */
 bool obb_t::Intersects( const obb_t& other ) const
@@ -1836,8 +1836,8 @@ bool obb_t::Intersects( const obb_t& other ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-obb - ray                                                                                                                             =
+Intersects                                                                                                             =
+obb - ray                                                                                                              =
 =======================================================================================================================================
 */
 bool obb_t::Intersects( const ray_t& ray ) const
@@ -1855,9 +1855,9 @@ bool obb_t::Intersects( const ray_t& ray ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-obb - segment                                                                                                                         =
-ToDo: not working good                                                                                                                =
+Intersects                                                                                                             =
+obb - segment                                                                                                          =
+ToDo: not working good                                                                                                 =
 =======================================================================================================================================
 */
 bool obb_t::Intersects( const lineseg_t& segment ) const
@@ -1916,8 +1916,8 @@ bool obb_t::Intersects( const lineseg_t& segment ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-obb - sphere                                                                                                                          =
+Intersects                                                                                                             =
+obb - sphere                                                                                                           =
 =======================================================================================================================================
 */
 bool obb_t::Intersects( const bsphere_t& sphere ) const
@@ -1932,8 +1932,8 @@ bool obb_t::Intersects( const bsphere_t& sphere ) const
 
 /*
 =======================================================================================================================================
-Intersects                                                                                                                            =
-obb - aabb                                                                                                                            =
+Intersects                                                                                                             =
+obb - aabb                                                                                                             =
 =======================================================================================================================================
 */
 bool obb_t::Intersects( const aabb_t& aabb ) const
@@ -1948,8 +1948,8 @@ bool obb_t::Intersects( const aabb_t& aabb ) const
 
 /*
 =======================================================================================================================================
-SeperationTest                                                                                                                        =
-obb - sphere                                                                                                                          =
+SeperationTest                                                                                                         =
+obb - sphere                                                                                                           =
 =======================================================================================================================================
 */
 bool obb_t::SeperationTest( const bsphere_t& sphere, Vec3& normal, Vec3& impact_point, float& depth ) const

+ 8 - 8
src/Misc/collision.h

@@ -22,7 +22,7 @@ class obb_t;
 
 /*
 =======================================================================================================================================
-bvolume_t (A)                                                                                                                         =
+bvolume_t (A)                                                                                                          =
 =======================================================================================================================================
 */
 class bvolume_t
@@ -69,7 +69,7 @@ class bvolume_t
 
 /*
 =======================================================================================================================================
-line segment                                                                                                                          =
+line segment                                                                                                           =
 =======================================================================================================================================
 */
 class lineseg_t: public bvolume_t
@@ -115,7 +115,7 @@ class lineseg_t: public bvolume_t
 
 /*
 =======================================================================================================================================
-ray                                                                                                                                   =
+ray                                                                                                                    =
 =======================================================================================================================================
 */
 class ray_t: bvolume_t
@@ -150,7 +150,7 @@ class ray_t: bvolume_t
 
 /*
 =======================================================================================================================================
-plane                                                                                                                                 =
+plane                                                                                                                  =
 =======================================================================================================================================
 */
 class plane_t: public bvolume_t
@@ -195,7 +195,7 @@ class plane_t: public bvolume_t
 
 /*
 =======================================================================================================================================
-bounding sphere                                                                                                                       =
+bounding sphere                                                                                                        =
 =======================================================================================================================================
 */
 class bsphere_t: public bvolume_t
@@ -233,7 +233,7 @@ class bsphere_t: public bvolume_t
 
 /*
 =======================================================================================================================================
-axis aligned bounding box                                                                                                             =
+axis aligned bounding box                                                                                              =
 =======================================================================================================================================
 */
 class aabb_t: public bvolume_t
@@ -271,7 +271,7 @@ class aabb_t: public bvolume_t
 
 /*
 =======================================================================================================================================
-object oriented bounding box                                                                                                          =
+object oriented bounding box                                                                                           =
 =======================================================================================================================================
 */
 class obb_t: public bvolume_t
@@ -311,7 +311,7 @@ class obb_t: public bvolume_t
 
 /*
 =======================================================================================================================================
-collision triangle                                                                                                                    =
+collision triangle                                                                                                     =
 =======================================================================================================================================
 */
 /*class cTriangle: public bvolume_t

+ 11 - 11
src/Misc/map.cpp

@@ -9,7 +9,7 @@
 
 /*
 =======================================================================================================================================
-CreateRoot                                                                                                                            =
+CreateRoot                                                                                                             =
 =======================================================================================================================================
 */
 void octree_t::CreateRoot( const Vec<Mesh*>& meshes )
@@ -72,7 +72,7 @@ void octree_t::CreateRoot( const Vec<Mesh*>& meshes )
 
 /*
 =======================================================================================================================================
-GetFacesNum                                                                                                                           =
+GetFacesNum                                                                                                            =
 =======================================================================================================================================
 */
 uint octree_t::node_t::GetFacesNum() const
@@ -88,9 +88,9 @@ uint octree_t::node_t::GetFacesNum() const
 
 /*
 =======================================================================================================================================
-IsSubdivHeuristicMet                                                                                                                  =
+IsSubdivHeuristicMet                                                                                                   =
 returns true when the used difined heuristic is met that sais that we can subdivide the node. Long story short it returns true when   =
-we can subdivide the node further                                                                                                     =
+we can subdivide the node further                                                                                      =
 =======================================================================================================================================
 */
 bool octree_t::IsSubdivHeuristicMet( node_t* node ) const
@@ -104,8 +104,8 @@ bool octree_t::IsSubdivHeuristicMet( node_t* node ) const
 
 /*
 =======================================================================================================================================
-SubdivideNode                                                                                                                         =
-subdivides the node and creates max 8 children and then subdivides the children                                                       =
+SubdivideNode                                                                                                          =
+subdivides the node and creates max 8 children and then subdivides the children                                        =
 =======================================================================================================================================
 */
 void octree_t::SubdivideNode( node_t* node )
@@ -124,7 +124,7 @@ void octree_t::SubdivideNode( node_t* node )
 
 /*
 =======================================================================================================================================
-CreateTree                                                                                                                            =
+CreateTree                                                                                                             =
 =======================================================================================================================================
 */
 void octree_t::CreateTree( const Vec<Mesh*>& meshes )
@@ -136,9 +136,9 @@ void octree_t::CreateTree( const Vec<Mesh*>& meshes )
 
 /*
 =======================================================================================================================================
-CheckNodeAgainstFrustum                                                                                                               =
+CheckNodeAgainstFrustum                                                                                                =
 the func checks the node and returns if its inside the cameras fruntum. It returns 0 if the cube is not inside, 1 if partialy         =
-inside and 2 if totaly inside                                                                                                         =
+inside and 2 if totaly inside                                                                                          =
 =======================================================================================================================================
 */
 uint octree_t::CheckNodeAgainstFrustum( node_t* node, const Camera& cam ) const
@@ -171,14 +171,14 @@ uint octree_t::CheckNodeAgainstFrustum( node_t* node, const Camera& cam ) const
 
 /*
 =======================================================================================================================================
-map                                                                                                                                   =
+map                                                                                                                    =
 =======================================================================================================================================
 */
 
 
 /*
 =======================================================================================================================================
-load                                                                                                                                  =
+load                                                                                                                   =
 =======================================================================================================================================
 */
 bool map_t::load( const char* filename )

+ 2 - 2
src/Misc/map.h

@@ -10,7 +10,7 @@ class Camera;
 
 /*
 =======================================================================================================================================
-octree_t                                                                                                                              =
+octree_t                                                                                                               =
 =======================================================================================================================================
 */
 class octree_t
@@ -54,7 +54,7 @@ class octree_t
 
 /*
 =======================================================================================================================================
-map_t                                                                                                                                 =
+map_t                                                                                                                  =
 =======================================================================================================================================
 */
 class map_t

+ 34 - 34
src/Misc/memory.cpp

@@ -30,7 +30,7 @@ namespace mem {
 #endif
 
 
-#ifdef _DEBUG_
+#ifdef DEBUG
 	#define SANITY_CHECKS SanityChecks();
 	#define PRINT_CALL_INFO(x) { if(mem::print_call_info) INFO(x) }
 #else
@@ -42,7 +42,7 @@ namespace mem {
 
 /*
 =======================================================================================================================================
-variables and types                                                                                                                   =
+variables and types                                                                                                    =
 =======================================================================================================================================
 */
 
@@ -110,7 +110,7 @@ bool print_call_info = false; // works only in debug
 
 /*
 =======================================================================================================================================
-FreeBlocksNum                                                                                                                         =
+FreeBlocksNum                                                                                                          =
 =======================================================================================================================================
 */
 static int FreeBlocksNum()
@@ -128,8 +128,8 @@ static int FreeBlocksNum()
 
 /*
 =======================================================================================================================================
-SetOwner                                                                                                                              =
-set the file,func,line to the given block                                                                                             =
+SetOwner                                                                                                               =
+set the file,func,line to the given block                                                                              =
 =======================================================================================================================================
 */
 static inline void SetOwner( mem_block_t* mb, mblock_owner_t* owner )
@@ -143,7 +143,7 @@ static inline void SetOwner( mem_block_t* mb, mblock_owner_t* owner )
 
 /*
 =======================================================================================================================================
-SanityChecks                                                                                                                          =
+SanityChecks                                                                                                           =
 =======================================================================================================================================
 */
 static bool SanityChecks()
@@ -189,7 +189,7 @@ static bool SanityChecks()
 
 /*
 =======================================================================================================================================
-BytesStr                                                                                                                              =
+BytesStr                                                                                                               =
 =======================================================================================================================================
 */
 static char* BytesStr( size_t size )
@@ -208,7 +208,7 @@ static char* BytesStr( size_t size )
 
 /*
 =======================================================================================================================================
-printBlockInfo                                                                                                                        =
+printBlockInfo                                                                                                         =
 =======================================================================================================================================
 */
 static void printBlockInfo( const mem_block_t* mb )
@@ -225,7 +225,7 @@ static void printBlockInfo( const mem_block_t* mb )
 
 /*
 =======================================================================================================================================
-printInfo                                                                                                                             =
+printInfo                                                                                                              =
 =======================================================================================================================================
 */
 void printInfo( uint flags )
@@ -281,12 +281,12 @@ void printInfo( uint flags )
 
 /*
 =======================================================================================================================================
-init                                                                                                                                  =
+init                                                                                                                   =
 =======================================================================================================================================
 */
 static void init()
 {
-#ifdef _DEBUG_
+#ifdef DEBUG
 	memset( buffer, (char)0xCC, buffer_size );
 #endif
 
@@ -334,7 +334,7 @@ static void init()
 
 /*
 =======================================================================================================================================
-thread stuff                                                                                                                          =
+thread stuff                                                                                                           =
 =======================================================================================================================================
 */
 static void Lock()
@@ -352,7 +352,7 @@ static void Unlock()
 
 /*
 =======================================================================================================================================
-Enable                                                                                                                                =
+Enable                                                                                                                 =
 =======================================================================================================================================
 */
 void Enable( uint flags )
@@ -374,7 +374,7 @@ void Enable( uint flags )
 
 /*
 =======================================================================================================================================
-Disable                                                                                                                               =
+Disable                                                                                                                =
 =======================================================================================================================================
 */
 void Disable( uint flags )
@@ -395,8 +395,8 @@ void Disable( uint flags )
 
 /*
 =======================================================================================================================================
-GetBlock                                                                                                                              =
-find the active block who has for addr the given ptr param. Func used by free and realloc                                             =
+GetBlock                                                                                                               =
+find the active block who has for addr the given ptr param. Func used by free and realloc                              =
 =======================================================================================================================================
 */
 static mem_block_t* GetBlock( void* ptr )
@@ -447,8 +447,8 @@ static mem_block_t* GetBlock( void* ptr )
 
 /*
 =======================================================================================================================================
-GetInactiveBlock                                                                                                                      =
-get an inactive node/block                                                                                                            =
+GetInactiveBlock                                                                                                       =
+get an inactive node/block                                                                                             =
 =======================================================================================================================================
 */
 static mem_block_t* GetInactiveBlock()
@@ -466,8 +466,8 @@ static mem_block_t* GetInactiveBlock()
 
 /*
 =======================================================================================================================================
-WorstFit                                                                                                                              =
-"worst fit" algorithm. It returns the block with the biger free space                                                                 =
+WorstFit                                                                                                               =
+"worst fit" algorithm. It returns the block with the biger free space                                                  =
 =======================================================================================================================================
 */
 static mem_block_t* WorstFit( size_t size )
@@ -487,7 +487,7 @@ static mem_block_t* WorstFit( size_t size )
 
 /*
 =======================================================================================================================================
-BestFit                                                                                                                               =
+BestFit                                                                                                                =
 =======================================================================================================================================
 */
 static mem_block_t* BestFit( size_t size )
@@ -527,7 +527,7 @@ static mem_block_t* BestFit( size_t size )
 
 /*
 =======================================================================================================================================
-BadFit                                                                                                                                =
+BadFit                                                                                                                 =
 =======================================================================================================================================
 */
 static mem_block_t* BadFit( size_t size )
@@ -546,8 +546,8 @@ static mem_block_t* BadFit( size_t size )
 
 /*
 =======================================================================================================================================
-NewBlock                                                                                                                              =
-just free the given block                                                                                                             =
+NewBlock                                                                                                               =
+just free the given block                                                                                              =
 =======================================================================================================================================
 */
 static mem_block_t* NewBlock( size_t size )
@@ -613,7 +613,7 @@ static mem_block_t* NewBlock( size_t size )
 
 /*
 =======================================================================================================================================
-FreeBlock                                                                                                                             =
+FreeBlock                                                                                                              =
 =======================================================================================================================================
 */
 static void FreeBlock( mem_block_t* crnt )
@@ -622,7 +622,7 @@ static void FreeBlock( mem_block_t* crnt )
 
 	free_size += crnt->size;
 
-#ifdef _DEBUG_
+#ifdef DEBUG
 	memset( crnt->addr, (char)0xCC, crnt->size );
 #endif
 
@@ -664,8 +664,8 @@ static void FreeBlock( mem_block_t* crnt )
 
 /*
 =======================================================================================================================================
-ReallocBlock                                                                                                                          =
-it gets the block we want to realloc and returns the reallocated (either the same or a new)                                           =
+ReallocBlock                                                                                                           =
+it gets the block we want to realloc and returns the reallocated (either the same or a new)                            =
 =======================================================================================================================================
 */
 static mem_block_t* ReallocBlock( mem_block_t* crnt, size_t size )
@@ -758,7 +758,7 @@ static mem_block_t* ReallocBlock( mem_block_t* crnt, size_t size )
 
 /*
 =======================================================================================================================================
-Malloc                                                                                                                                =
+Malloc                                                                                                                 =
 =======================================================================================================================================
 */
 static void* Malloc( size_t size, mblock_owner_t* owner=&unknown_owner )
@@ -778,7 +778,7 @@ static void* Malloc( size_t size, mblock_owner_t* owner=&unknown_owner )
 
 /*
 =======================================================================================================================================
-Calloc                                                                                                                                =
+Calloc                                                                                                                 =
 =======================================================================================================================================
 */
 static void* Calloc( size_t num, size_t size, mblock_owner_t* owner=&unknown_owner )
@@ -800,7 +800,7 @@ static void* Calloc( size_t num, size_t size, mblock_owner_t* owner=&unknown_own
 
 /*
 =======================================================================================================================================
-Realloc                                                                                                                               =
+Realloc                                                                                                                =
 =======================================================================================================================================
 */
 static void* Realloc( void* ptr, size_t size, mblock_owner_t* owner=&unknown_owner )
@@ -844,7 +844,7 @@ static void* Realloc( void* ptr, size_t size, mblock_owner_t* owner=&unknown_own
 
 /*
 =======================================================================================================================================
-Free                                                                                                                                  =
+Free                                                                                                                   =
 =======================================================================================================================================
 */
 static void Free( void* ptr, mblock_owner_t* owner=&unknown_owner )
@@ -879,7 +879,7 @@ static void Free( void* ptr, mblock_owner_t* owner=&unknown_owner )
 
 /**
 =======================================================================================================================================
-overloaded stuff                                                                                                                      =
+overloaded stuff                                                                                                       =
 =======================================================================================================================================
 */
 
@@ -942,7 +942,7 @@ void operator delete[]( void* p ) throw()
 
 /**
 =======================================================================================================================================
-overloaded stuff with owner                                                                                                           =
+overloaded stuff with owner                                                                                            =
 =======================================================================================================================================
 */
 

+ 4 - 4
src/Misc/particles.cpp

@@ -12,7 +12,7 @@ using namespace std;
 
 
 =============================================================================================================================================================
-render @ particle_t                                                                                                                                         =
+render @ particle_t                                                                                                                          =
 =============================================================================================================================================================
 
 void particle_t::render()
@@ -95,7 +95,7 @@ void particle_t::render()
 
 
 =============================================================================================================================================================
-init @ particle_emitter_t                                                                                                                                   =
+init @ particle_emitter_t                                                                                                                    =
 =============================================================================================================================================================
 
 void particle_emitter_t::init()
@@ -125,7 +125,7 @@ void particle_emitter_t::init()
 
 
 ==============================================================================================================================================================
-ReInitParticle @ particle_emitter_t                                                                                                                          =
+ReInitParticle @ particle_emitter_t                                                                                                           =
 ==============================================================================================================================================================
 
 void particle_emitter_t::ReInitParticle( particle_t& particle )
@@ -171,7 +171,7 @@ void particle_emitter_t::ReInitParticle( particle_t& particle )
 
 
 =============================================================================================================================================================
-render @ particle_emitter_t                                                                                                                                 =
+render @ particle_emitter_t                                                                                                                  =
 =============================================================================================================================================================
 
 void particle_emitter_t::render()

+ 1 - 1
src/Misc/particles.h

@@ -11,7 +11,7 @@
 
 
 ===============================================================================================================================================================
-particle_t                                                                                                                                                    =
+particle_t                                                                                                                                     =
 ===============================================================================================================================================================
 
 class particle_t: public object_t

+ 3 - 3
src/Misc/skybox.cpp

@@ -28,7 +28,7 @@ static float coords [][4][3] =
 
 /*
 =======================================================================================================================================
-load                                                                                                                                  =
+load                                                                                                                   =
 =======================================================================================================================================
 */
 bool Skybox::load( const char* filenames[6] )
@@ -50,7 +50,7 @@ bool Skybox::load( const char* filenames[6] )
 
 /*
 =======================================================================================================================================
-render                                                                                                                                =
+render                                                                                                                 =
 =======================================================================================================================================
 */
 void Skybox::Render( const Mat3& rotation )
@@ -62,7 +62,7 @@ void Skybox::Render( const Mat3& rotation )
 
 	shader->bind();
 	glUniform1i( shader->findUniVar("colormap")->getLoc(), 0 );
-	shader->locTexUnit( shader->findUniVar("noisemap")->getLoc(), *noise, 1 );
+	shader->findUniVar("noisemap")->setTexture( *noise, 1 );
 	glUniform1f( shader->findUniVar("timer")->getLoc(), (rotation_ang/(2*PI))*100 );
 	glUniform3fv( shader->findUniVar("sceneAmbientCol")->getLoc(), 1, &(Vec3( 1.0, 1.0, 1.0 ) / app->getScene()->getAmbientCol())[0] );
 

+ 3 - 3
src/Physics/PhyWorld.cpp

@@ -1,9 +1,9 @@
 #include "PhyWorld.h"
 
 
-//=====================================================================================================================================
-// createNewRigidBody                                                                                                                 =
-//=====================================================================================================================================
+//======================================================================================================================
+// createNewRigidBody                                                                                                  =
+//======================================================================================================================
 btRigidBody* PhyWorld::createNewRigidBody( float mass, const Transform& startTransform, btCollisionShape* shape, SceneNode* node, int group,
                                            int mask )
 {

+ 18 - 18
src/Renderer/Dbg.cpp

@@ -4,9 +4,9 @@
 #include "SkelNode.h"
 
 
-//=====================================================================================================================================
-// Constructor                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// Constructor                                                                                                         =
+//======================================================================================================================
 Renderer::Dbg::Dbg( Renderer& r_ ):
 	RenderingStage( r_ ),
 	showAxisEnabled( false ),
@@ -17,9 +17,9 @@ Renderer::Dbg::Dbg( Renderer& r_ ):
 }
 
 
-//=====================================================================================================================================
-// renderGrid                                                                                                                         =
-//=====================================================================================================================================
+//======================================================================================================================
+// renderGrid                                                                                                          =
+//======================================================================================================================
 void Renderer::Dbg::renderGrid()
 {
 	float col0[] = { 0.5, 0.5, 0.5 };
@@ -60,9 +60,9 @@ void Renderer::Dbg::renderGrid()
 }
 
 
-//=====================================================================================================================================
-// renderSphere                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// renderSphere                                                                                                        =
+//======================================================================================================================
 void Renderer::Dbg::renderSphere( float radius, int complexity )
 {
 	const float twopi  = M::PI*2;
@@ -135,9 +135,9 @@ void Renderer::Dbg::renderSphere( float radius, int complexity )
 }
 
 
-//=====================================================================================================================================
-// renderCube                                                                                                                         =
-//=====================================================================================================================================
+//======================================================================================================================
+// renderCube                                                                                                          =
+//======================================================================================================================
 void Renderer::Dbg::renderCube( bool cols, float size )
 {
 	Vec3 maxPos( 0.5 * size );
@@ -206,9 +206,9 @@ void Renderer::Dbg::renderCube( bool cols, float size )
 }
 
 
-//=====================================================================================================================================
-// init                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// init                                                                                                                =
+//======================================================================================================================
 void Renderer::Dbg::init()
 {
 	// create FBO Captain Blood
@@ -234,9 +234,9 @@ void Renderer::Dbg::init()
 }
 
 
-//=====================================================================================================================================
-// runStage                                                                                                                           =
-//=====================================================================================================================================
+//======================================================================================================================
+// runStage                                                                                                            =
+//======================================================================================================================
 void Renderer::Dbg::run()
 {
 	if( !enabled ) return;

+ 6 - 6
src/Renderer/Ez.cpp

@@ -4,9 +4,9 @@
 #include "Scene.h"
 
 
-//=====================================================================================================================================
-// init                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// init                                                                                                                =
+//======================================================================================================================
 void Renderer::Ms::Ez::init()
 {
 	DEBUG_ERR( !enabled );
@@ -28,9 +28,9 @@ void Renderer::Ms::Ez::init()
 }
 
 
-//=====================================================================================================================================
-// run                                                                                                                                =
-//=====================================================================================================================================
+//======================================================================================================================
+// run                                                                                                                 =
+//======================================================================================================================
 void Renderer::Ms::Ez::run()
 {
 	DEBUG_ERR( !enabled );

+ 17 - 17
src/Renderer/Hdr.cpp

@@ -1,9 +1,9 @@
 #include "Renderer.h"
 
 
-//=====================================================================================================================================
-// initFbos                                                                                                                           =
-//=====================================================================================================================================
+//======================================================================================================================
+// initFbos                                                                                                            =
+//======================================================================================================================
 void Renderer::Pps::Hdr::initFbos( Fbo& fbo, Texture& fai, int internalFormat )
 {
 	int width = renderingQuality * r.width;
@@ -34,9 +34,9 @@ void Renderer::Pps::Hdr::initFbos( Fbo& fbo, Texture& fai, int internalFormat )
 }
 
 
-//=====================================================================================================================================
-// init                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// init                                                                                                                =
+//======================================================================================================================
 void Renderer::Pps::Hdr::init()
 {
 	//int width = renderingQuality * r.width;
@@ -49,11 +49,14 @@ void Renderer::Pps::Hdr::init()
 	fai.texParameter( GL_TEXTURE_MAG_FILTER, GL_LINEAR );
 
 	// init shaders
-	//
 	const char* shaderFname = "shaders/PpsHdr.glsl";
 
-	if( !pass0SProg.customLoad( shaderFname, ("#define _PPS_HDR_PASS_0_\n#define IS_FAI_WIDTH " + Util::floatToStr(r.width) + "\n").c_str() ) )
+	if( !pass0SProg.customLoad( shaderFname, ("#define _PPS_HDR_PASS_0_\n#define IS_FAI_WIDTH " +
+	    Util::floatToStr(r.width) + "\n").c_str() ) )
+	{
 		FATAL( "See prev error" );
+	}
+
 	pass0SProg.uniVars.fai = pass0SProg.findUniVar("fai");
 
 	if( !pass1SProg.customLoad( shaderFname, ("#define _PPS_HDR_PASS_1_\n#define PASS0_HEIGHT " + Util::floatToStr(height) + "\n").c_str() ) )
@@ -66,9 +69,9 @@ void Renderer::Pps::Hdr::init()
 }
 
 
-//=====================================================================================================================================
-// runPass                                                                                                                            =
-//=====================================================================================================================================
+//======================================================================================================================
+// runPass                                                                                                             =
+//======================================================================================================================
 void Renderer::Pps::Hdr::run()
 {
 	int w = renderingQuality * r.width;
@@ -78,26 +81,23 @@ void Renderer::Pps::Hdr::run()
 	glDisable( GL_BLEND );
 	glDisable( GL_DEPTH_TEST );
 
-
 	// pass 0
 	pass0Fbo.bind();
 	pass0SProg.bind();
 	pass0SProg.uniVars.fai->setTexture( r.is.fai, 0 );
-	r.drawQuad( 0 );
-
+	Renderer::drawQuad( 0 );
 
 	// pass 1
 	pass1Fbo.bind();
 	pass1SProg.bind();
 	pass1SProg.uniVars.fai->setTexture( pass0Fai, 0 );
-	r.drawQuad( 0 );
-
+	Renderer::drawQuad( 0 );
 
 	// pass 2
 	pass2Fbo.bind();
 	pass2SProg.bind();
 	pass2SProg.uniVars.fai->setTexture( pass1Fai, 0 );
-	r.drawQuad( 0 );
+	Renderer::drawQuad( 0 );
 
 	// end
 	Fbo::unbind();

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 3 - 3
src/Renderer/Is.cpp


+ 15 - 15
src/Renderer/MainRenderer.cpp

@@ -5,9 +5,9 @@
 #include "App.h"
 #include "RendererInitializer.h"
 
-//=====================================================================================================================================
-// init                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// init                                                                                                                =
+//======================================================================================================================
 void MainRenderer::init( const RendererInitializer& initializer_ )
 {
 	INFO( "Main renderer initializing..." );
@@ -75,9 +75,9 @@ void MainRenderer::init( const RendererInitializer& initializer_ )
 }
 
 
-//=====================================================================================================================================
-// render                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// render                                                                                                              =
+//======================================================================================================================
 void MainRenderer::render( Camera& cam_ )
 {
 	Renderer::render( cam_ );
@@ -94,9 +94,9 @@ void MainRenderer::render( Camera& cam_ )
 }
 
 
-//=====================================================================================================================================
-// takeScreenshotTga                                                                                                                  =
-//=====================================================================================================================================
+//======================================================================================================================
+// takeScreenshotTga                                                                                                   =
+//======================================================================================================================
 bool MainRenderer::takeScreenshotTga( const char* filename )
 {
 	// open file and check
@@ -135,9 +135,9 @@ bool MainRenderer::takeScreenshotTga( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// takeScreenshotJpeg                                                                                                                 =
-//=====================================================================================================================================
+//======================================================================================================================
+// takeScreenshotJpeg                                                                                                  =
+//======================================================================================================================
 bool MainRenderer::takeScreenshotJpeg( const char* filename )
 {
 	// open file
@@ -187,9 +187,9 @@ bool MainRenderer::takeScreenshotJpeg( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// takeScreenshot                                                                                                                     =
-//=====================================================================================================================================
+//======================================================================================================================
+// takeScreenshot                                                                                                      =
+//======================================================================================================================
 void MainRenderer::takeScreenshot( const char* filename )
 {
 	string ext = Util::getFileExtension( filename );

+ 6 - 6
src/Renderer/Ms.cpp

@@ -5,9 +5,9 @@
 #include "MeshNode.h"
 
 
-//=====================================================================================================================================
-// init                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// init                                                                                                                =
+//======================================================================================================================
 void Renderer::Ms::init()
 {
 	// create FBO
@@ -48,9 +48,9 @@ void Renderer::Ms::init()
 }
 
 
-//=====================================================================================================================================
-// run                                                                                                                                =
-//=====================================================================================================================================
+//======================================================================================================================
+// run                                                                                                                 =
+//======================================================================================================================
 void Renderer::Ms::run()
 {
 	const Camera& cam = *r.cam;

+ 6 - 6
src/Renderer/Pps.cpp

@@ -1,9 +1,9 @@
 #include "Renderer.h"
 
 
-//=====================================================================================================================================
-// init                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// init                                                                                                                =
+//======================================================================================================================
 void Renderer::Pps::init()
 {
 	// create FBO
@@ -65,9 +65,9 @@ void Renderer::Pps::init()
 }
 
 
-//=====================================================================================================================================
-// run                                                                                                                                =
-//=====================================================================================================================================
+//======================================================================================================================
+// run                                                                                                                 =
+//======================================================================================================================
 void Renderer::Pps::run()
 {
 	if( ssao.enabled )

+ 36 - 36
src/Renderer/Renderer.cpp

@@ -4,15 +4,15 @@
 #include "Material.h"
 
 
-//=====================================================================================================================================
-// Vars                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// Vars                                                                                                                =
+//======================================================================================================================
 float Renderer::quadVertCoords [][2] = { {1.0,1.0}, {0.0,1.0}, {0.0,0.0}, {1.0,0.0} };
 
 
-//=====================================================================================================================================
-// Constructor                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// Constructor                                                                                                         =
+//======================================================================================================================
 Renderer::Renderer():
 	width( 640 ),
 	height( 480 ),
@@ -23,9 +23,9 @@ Renderer::Renderer():
 {
 }
 
-//=====================================================================================================================================
-// init                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// init                                                                                                                =
+//======================================================================================================================
 void Renderer::init( const RendererInitializer& initializer )
 {
 	// set from the initializer
@@ -59,9 +59,9 @@ void Renderer::init( const RendererInitializer& initializer )
 }
 
 
-//=====================================================================================================================================
-// render                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// render                                                                                                              =
+//======================================================================================================================
 void Renderer::render( Camera& cam_ )
 {
 	cam = &cam_;
@@ -75,9 +75,9 @@ void Renderer::render( Camera& cam_ )
 }
 
 
-//=====================================================================================================================================
-// drawQuad                                                                                                                           =
-//=====================================================================================================================================
+//======================================================================================================================
+// drawQuad                                                                                                            =
+//======================================================================================================================
 void Renderer::drawQuad( int vertCoordsUniLoc )
 {
 	DEBUG_ERR( vertCoordsUniLoc == -1 );
@@ -88,9 +88,9 @@ void Renderer::drawQuad( int vertCoordsUniLoc )
 }
 
 
-//=====================================================================================================================================
-// setupMaterial                                                                                                                      =
-//=====================================================================================================================================
+//======================================================================================================================
+// setupMaterial                                                                                                       =
+//======================================================================================================================
 void Renderer::setupMaterial( const Material& mtl, const SceneNode& sceneNode, const Camera& cam )
 {
 	mtl.shaderProg->bind();
@@ -229,9 +229,9 @@ void Renderer::setupMaterial( const Material& mtl, const SceneNode& sceneNode, c
 }
 
 
-//=====================================================================================================================================
-// setProjectionMatrix                                                                                                                =
-//=====================================================================================================================================
+//======================================================================================================================
+// setProjectionMatrix                                                                                                 =
+//======================================================================================================================
 void Renderer::setProjectionMatrix( const Camera& cam )
 {
 	glMatrixMode( GL_PROJECTION );
@@ -239,9 +239,9 @@ void Renderer::setProjectionMatrix( const Camera& cam )
 }
 
 
-//=====================================================================================================================================
-// setViewMatrix                                                                                                                      =
-//=====================================================================================================================================
+//======================================================================================================================
+// setViewMatrix                                                                                                       =
+//======================================================================================================================
 void Renderer::setViewMatrix( const Camera& cam )
 {
 	glMatrixMode( GL_MODELVIEW );
@@ -249,9 +249,9 @@ void Renderer::setViewMatrix( const Camera& cam )
 }
 
 
-//=====================================================================================================================================
-// unproject                                                                                                                          =
-//=====================================================================================================================================
+//======================================================================================================================
+// unproject                                                                                                           =
+//======================================================================================================================
 Vec3 Renderer::unproject( const Vec3& windowCoords, const Mat4& modelViewMat, const Mat4& projectionMat, const int view[4] )
 {
 	Mat4 invPm = projectionMat * modelViewMat;
@@ -270,9 +270,9 @@ Vec3 Renderer::unproject( const Vec3& windowCoords, const Mat4& modelViewMat, co
 }
 
 
-//=====================================================================================================================================
-// ortho                                                                                                                              =
-//=====================================================================================================================================
+//======================================================================================================================
+// ortho                                                                                                               =
+//======================================================================================================================
 Mat4 Renderer::ortho( float left, float right, float bottom, float top, float near, float far )
 {
 	float difx = right-left;
@@ -304,18 +304,18 @@ Mat4 Renderer::ortho( float left, float right, float bottom, float top, float ne
 }
 
 
-//=====================================================================================================================================
-// getLastError                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// getLastError                                                                                                        =
+//======================================================================================================================
 const uchar* Renderer::getLastError()
 {
 	return gluErrorString( glGetError() );
 }
 
 
-//=====================================================================================================================================
-// printLastError                                                                                                                     =
-//=====================================================================================================================================
+//======================================================================================================================
+// printLastError                                                                                                      =
+//======================================================================================================================
 void Renderer::printLastError()
 {
 	GLenum errid = glGetError();

+ 9 - 9
src/Renderer/Renderer.h

@@ -21,9 +21,9 @@ class SceneNode;
  */
 class Renderer
 {
-	//===================================================================================================================================
-	// The rendering stages                                                                                                             =
-	//===================================================================================================================================
+	//====================================================================================================================
+	// The rendering stages                                                                                              =
+	//====================================================================================================================
 	public:
 		/**
 		 * Rendering stage
@@ -160,7 +160,7 @@ class Renderer
 				Vec3 viewVectors[4];
 				Vec2 planes;
 				static float sMOUvSCoords []; ///< Illumination stage stencil masking optimizations UV sphere vertex coords
-				static uint  sMOUvSVboId; ///< Illumination stage stencil masking optimizations UV sphere VBO id
+				static uint sMOUvSVboId; ///< Illumination stage stencil masking optimizations UV sphere VBO id
 
 				static void initSMOUvS(); ///< Init the illumination stage stencil masking optimizations uv sphere (eg create the @ref sMOUvSVboId VBO)
 				void renderSMOUvS( const PointLight& light ); ///< Render the illumination stage stencil masking optimizations uv sphere
@@ -341,16 +341,15 @@ class Renderer
 		}; // end Dbg
 
 
-	//===================================================================================================================================
-	//                                                                                                                                  =
-	//===================================================================================================================================
+	//====================================================================================================================
+	//                                                                                                                   =
+	//====================================================================================================================
 	PROPERTY_R( uint, width, getWidth ) ///< Width of the rendering. Dont confuse with the window width
 	PROPERTY_R( uint, height, getHeight ) ///< Height of the rendering. Dont confuse with the window width
 	PROPERTY_R( uint, framesNum, getFramesNum )
 	PROPERTY_R( float, aspectRatio, getAspectRatio ) ///< Just a precalculated value
 
 	protected:
-		// the rest
 		const Camera* cam; ///< Current camera
 		static float quadVertCoords [][2];
 
@@ -386,7 +385,8 @@ class Renderer
 		 * @param view The view vector
 		 * @return The unprojected coords coords
 		 */
-		static Vec3 unproject( const Vec3& windowCoords, const Mat4& modelViewMat, const Mat4& projectionMat, const int view[4] );
+		static Vec3 unproject( const Vec3& windowCoords, const Mat4& modelViewMat, const Mat4& projectionMat,
+		                       const int view[4] );
 
 		/**
 		 * It returns an orthographic projection matrix

+ 6 - 6
src/Renderer/Sm.cpp

@@ -4,9 +4,9 @@
 #include "MeshNode.h"
 
 
-//=====================================================================================================================================
-// init                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// init                                                                                                                =
+//======================================================================================================================
 void Renderer::Is::Sm::init()
 {
 	// create FBO
@@ -47,9 +47,9 @@ void Renderer::Is::Sm::init()
 }
 
 
-//=====================================================================================================================================
-// run                                                                                                                                =
-//=====================================================================================================================================
+//======================================================================================================================
+// run                                                                                                                 =
+//======================================================================================================================
 void Renderer::Is::Sm::run( const Camera& cam )
 {
 	// FBO

+ 16 - 14
src/Renderer/Ssao.cpp

@@ -2,9 +2,9 @@
 #include "Camera.h"
 
 
-//=====================================================================================================================================
-// initBlurFbos                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// initBlurFbos                                                                                                        =
+//======================================================================================================================
 void Renderer::Pps::Ssao::initBlurFbo( Fbo& fbo, Texture& fai )
 {
 	// create FBO
@@ -31,9 +31,9 @@ void Renderer::Pps::Ssao::initBlurFbo( Fbo& fbo, Texture& fai )
 }
 
 
-//=====================================================================================================================================
-// init                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// init                                                                                                                =
+//======================================================================================================================
 void Renderer::Pps::Ssao::init()
 {
 	width = renderingQuality * r.width;
@@ -77,8 +77,10 @@ void Renderer::Pps::Ssao::init()
 	//
 
 	ssaoSProg.customLoad( "shaders/PpsSsao.glsl" );
-	blurSProg.customLoad( "shaders/PpsSsaoBlur.glsl", ("#define _PPS_SSAO_PASS_0_\n#define PASS0_FAI_WIDTH " + Util::floatToStr(width) + "\n").c_str() );
-	blurSProg2.customLoad( "shaders/PpsSsaoBlur.glsl", ("#define _PPS_SSAO_PASS_1_\n#define PASS1_FAI_HEIGHT " + Util::floatToStr(bheight) + "\n").c_str() );
+	blurSProg.customLoad( "shaders/PpsSsaoBlur.glsl", ("#define _PPS_SSAO_PASS_0_\n#define PASS0_FAI_WIDTH " +
+	                      Util::floatToStr(width) + "\n").c_str() );
+	blurSProg2.customLoad( "shaders/PpsSsaoBlur.glsl", ("#define _PPS_SSAO_PASS_1_\n#define PASS1_FAI_HEIGHT " +
+	                       Util::floatToStr(bheight) + "\n").c_str() );
 
 	ssaoSProg.uniVars.camerarange = ssaoSProg.findUniVar("camerarange");
 	ssaoSProg.uniVars.msDepthFai = ssaoSProg.findUniVar("msDepthFai");
@@ -109,9 +111,9 @@ void Renderer::Pps::Ssao::init()
 }
 
 
-//=====================================================================================================================================
-// run                                                                                                                                =
-//=====================================================================================================================================
+//======================================================================================================================
+// run                                                                                                                 =
+//======================================================================================================================
 void Renderer::Pps::Ssao::run()
 {
 	const Camera& cam = *r.cam;
@@ -129,7 +131,7 @@ void Renderer::Pps::Ssao::run()
 	ssaoSProg.uniVars.msDepthFai->setTexture( r.ms.depthFai, 0 );
 	ssaoSProg.uniVars.noiseMap->setTexture( *noiseMap, 1 );
 	ssaoSProg.uniVars.msNormalFai->setTexture( r.ms.normalFai, 2 );
-	r.drawQuad( 0 );
+	Renderer::drawQuad( 0 );
 
 	// for 2nd and 3rd passes
 	Renderer::setViewport( 0, 0, bwidth, bheight );
@@ -138,13 +140,13 @@ void Renderer::Pps::Ssao::run()
 	pass1Fbo.bind();
 	blurSProg.bind();
 	blurSProg.uniVars.fai->setTexture( pass0Fai, 0 );
-	r.drawQuad( 0 );
+	Renderer::drawQuad( 0 );
 
 	// 3rd pass
 	pass2Fbo.bind();
 	blurSProg2.bind();
 	blurSProg2.uniVars.fai->setTexture( pass1Fai, 0 );
-	r.drawQuad( 0 );
+	Renderer::drawQuad( 0 );
 
 	// end
 	Fbo::unbind();

+ 15 - 15
src/Resources/Helpers/Image.cpp

@@ -7,9 +7,9 @@ unsigned char Image::tgaHeaderUncompressed[12] = {0,0,2,0,0,0,0,0,0,0,0,0};
 unsigned char Image::tgaHeaderCompressed[12]   = {0,0,10,0,0,0,0,0,0,0,0,0};
 
 
-//=====================================================================================================================================
-// loadUncompressedTGA                                                                                                                =
-//=====================================================================================================================================
+//======================================================================================================================
+// loadUncompressedTGA                                                                                                 =
+//======================================================================================================================
 bool Image::loadUncompressedTGA( const char* filename, fstream& fs )
 {
 	// read the info from header
@@ -55,9 +55,9 @@ bool Image::loadUncompressedTGA( const char* filename, fstream& fs )
 }
 
 
-//=====================================================================================================================================
-// loadCompressedTGA                                                                                                                  =
-//=====================================================================================================================================
+//======================================================================================================================
+// loadCompressedTGA                                                                                                   =
+//======================================================================================================================
 bool Image::loadCompressedTGA( const char* filename, fstream& fs )
 {
 	unsigned char header6[6];
@@ -167,9 +167,9 @@ bool Image::loadCompressedTGA( const char* filename, fstream& fs )
 }
 
 
-//=====================================================================================================================================
-// loadTGA                                                                                                                            =
-//=====================================================================================================================================
+//======================================================================================================================
+// loadTGA                                                                                                             =
+//======================================================================================================================
 bool Image::loadTGA( const char* filename )
 {
 	fstream fs;
@@ -210,9 +210,9 @@ bool Image::loadTGA( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// loadPNG                                                                                                                            =
-//=====================================================================================================================================
+//======================================================================================================================
+// loadPNG                                                                                                             =
+//======================================================================================================================
 bool Image::loadPNG( const char* filename )
 {
 	SDL_Surface *sdli;
@@ -255,9 +255,9 @@ bool Image::loadPNG( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// load                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// load                                                                                                                =
+//======================================================================================================================
 bool Image::load( const char* filename )
 {
 	// get the extension

+ 29 - 23
src/Resources/Helpers/ShaderPrePreprocessor.cpp

@@ -5,9 +5,9 @@
 #include "Util.h"
 
 
-//=====================================================================================================================================
-// printSourceLines                                                                                                                   =
-//=====================================================================================================================================
+//======================================================================================================================
+// printSourceLines                                                                                                    =
+//======================================================================================================================
 void ShaderPrePreprocessor::printSourceLines() const
 {
 	for( uint i=0; i<sourceLines.size(); ++i )
@@ -17,9 +17,9 @@ void ShaderPrePreprocessor::printSourceLines() const
 }
 
 
-//=====================================================================================================================================
-// printShaderVars                                                                                                                    =
-//=====================================================================================================================================
+//======================================================================================================================
+// printShaderVars                                                                                                     =
+//======================================================================================================================
 void ShaderPrePreprocessor::printShaderVars() const
 {
 	PRINT( "TYPE" << setw(20) << "NAME" << setw(4) << "LOC" );
@@ -30,10 +30,11 @@ void ShaderPrePreprocessor::printShaderVars() const
 }
 
 
-//=====================================================================================================================================
-// findShaderVar                                                                                                                      =
-//=====================================================================================================================================
-Vec<ShaderPrePreprocessor::ShaderVarPragma>::iterator ShaderPrePreprocessor::findShaderVar( Vec<ShaderVarPragma>& vec, const string& name ) const
+//======================================================================================================================
+// findShaderVar                                                                                                       =
+//======================================================================================================================
+Vec<ShaderPrePreprocessor::ShaderVarPragma>::iterator ShaderPrePreprocessor::findShaderVar( Vec<ShaderVarPragma>& vec,
+                                                                                            const string& name ) const
 {
 	Vec<ShaderVarPragma>::iterator it = vec.begin();
 	while( it != vec.end() && it->name != name )
@@ -44,9 +45,9 @@ Vec<ShaderPrePreprocessor::ShaderVarPragma>::iterator ShaderPrePreprocessor::fin
 }
 
 
-//=====================================================================================================================================
-// parseFileForPragmas                                                                                                                =
-//=====================================================================================================================================
+//======================================================================================================================
+// parseFileForPragmas                                                                                                 =
+//======================================================================================================================
 bool ShaderPrePreprocessor::parseFileForPragmas( const string& filename, int depth )
 {
 	// first check the depth
@@ -122,7 +123,8 @@ bool ShaderPrePreprocessor::parseFileForPragmas( const string& filename, int dep
 						vertShaderBegins.definedInFile = filename;
 						vertShaderBegins.definedInLine = scanner.getLineNumber();
 						vertShaderBegins.globalLine = sourceLines.size() + 1;
-						sourceLines.push_back( string("#line ") + Util::intToStr(scanner.getLineNumber()) + ' ' + Util::intToStr(depth) + " // " + lines[scanner.getLineNumber()-1] );
+						sourceLines.push_back( string("#line ") + Util::intToStr(scanner.getLineNumber()) + ' ' +
+						                       Util::intToStr(depth) + " // " + lines[scanner.getLineNumber()-1] );
 						// stop play
 					}
 /* geomShaderBegins */
@@ -163,7 +165,8 @@ bool ShaderPrePreprocessor::parseFileForPragmas( const string& filename, int dep
 						geomShaderBegins.definedInFile = filename;
 						geomShaderBegins.definedInLine = scanner.getLineNumber();
 						geomShaderBegins.globalLine = sourceLines.size() + 1;
-						sourceLines.push_back( string("#line ") + Util::intToStr(scanner.getLineNumber()) + ' ' + Util::intToStr(depth) + " // " + lines[scanner.getLineNumber()-1] );
+						sourceLines.push_back( string("#line ") + Util::intToStr(scanner.getLineNumber()) + ' ' +
+						                       Util::intToStr(depth) + " // " + lines[scanner.getLineNumber()-1] );
 						// stop play
 					}
 /* fragShaderBegins */
@@ -195,7 +198,8 @@ bool ShaderPrePreprocessor::parseFileForPragmas( const string& filename, int dep
 						fragShaderBegins.definedInFile = filename;
 						fragShaderBegins.definedInLine = scanner.getLineNumber();
 						fragShaderBegins.globalLine = sourceLines.size() + 1;
-						sourceLines.push_back( string("#line ") + Util::intToStr(scanner.getLineNumber()) + ' ' + Util::intToStr(depth) + " // " + lines[scanner.getLineNumber()-1] );
+						sourceLines.push_back( string("#line ") + Util::intToStr(scanner.getLineNumber()) + ' ' +
+						                       Util::intToStr(depth) + " // " + lines[scanner.getLineNumber()-1] );
 						// stop play
 					}
 /* include */
@@ -208,7 +212,8 @@ bool ShaderPrePreprocessor::parseFileForPragmas( const string& filename, int dep
 							//int line = sourceLines.size();
 							sourceLines.push_back( string("#line 0 ") + Util::intToStr(depth+1) + " // " + lines[scanner.getLineNumber()-1] );
 							if( !parseFileForPragmas( token->getValue().getString(), depth+1 ) ) return false;
-							sourceLines.push_back( string("#line ") + Util::intToStr(scanner.getLineNumber()) + ' ' + Util::intToStr(depth) +  " // end of " + lines[scanner.getLineNumber()-1] );
+							sourceLines.push_back( string("#line ") + Util::intToStr(scanner.getLineNumber()) + ' ' +
+							                       Util::intToStr(depth) +  " // end of " + lines[scanner.getLineNumber()-1] );
 							// stop play
 						}
 						else
@@ -239,7 +244,8 @@ bool ShaderPrePreprocessor::parseFileForPragmas( const string& filename, int dep
 									}
 									else
 									{
-										PARSE_ERR( "Attribute \"" << varName << "\" already defined at " << attrib->definedInFile << ":" << attrib->definedInLine );
+										PARSE_ERR( "Attribute \"" << varName << "\" already defined at " << attrib->definedInFile << ":" <<
+										           attrib->definedInLine );
 									}
 									return false;
 								}
@@ -248,8 +254,8 @@ bool ShaderPrePreprocessor::parseFileForPragmas( const string& filename, int dep
 								{
 									if( attrib->customLoc == loc )
 									{
-										PARSE_ERR( "The attributes \"" << attrib->name << "\" (" << attrib->definedInFile << ":" << attrib->definedInLine <<
-										           ") and \"" << varName << "\" share the same location" );
+										PARSE_ERR( "The attributes \"" << attrib->name << "\" (" << attrib->definedInFile << ":" <<
+										           attrib->definedInLine << ") and \"" << varName << "\" share the same location" );
 										return false;
 									}
 								}
@@ -313,9 +319,9 @@ bool ShaderPrePreprocessor::parseFileForPragmas( const string& filename, int dep
 }
 
 
-//=====================================================================================================================================
-// parseFile                                                                                                                          =
-//=====================================================================================================================================
+//======================================================================================================================
+// parseFile                                                                                                           =
+//======================================================================================================================
 bool ShaderPrePreprocessor::parseFile( const char* filename )
 {
 	// parse master file

+ 10 - 6
src/Resources/Helpers/ShaderPrePreprocessor.h

@@ -8,11 +8,12 @@
 /**
  * Helper class used for shader program loading
  *
- * The class fills some of the GLSL spec deficiencies. It adds the include preprocessor directive and the support to have all the
- * shaders in the same file. The file that includes all the shaders is called ShaderPrePreprocessor-compatible. The preprocessor pragmas are
- * four: include, vertShaderBegins, fragShaderBegins and attribute. The *ShaderBegins indicate where the shader code begins and must be
- * in certain order, first the vert shader then the optional geom and then the frag. The include is self-explanatory. The attribute is
- * used to bind custom locations to attributes.
+ * The class fills some of the GLSL spec deficiencies. It adds the include preprocessor directive and the support to
+ * have all the shaders in the same file. The file that includes all the shaders is called
+ * ShaderPrePreprocessor-compatible. The preprocessor pragmas are four: include, vertShaderBegins, fragShaderBegins and
+ * attribute. The *ShaderBegins indicate where the shader code begins and must be in certain order, first the vert
+ * shader then the optional geom and then the frag. The include is self-explanatory. The attribute is used to bind
+ * custom locations to attributes.
  */
 class ShaderPrePreprocessor
 {
@@ -40,8 +41,11 @@ class ShaderPrePreprocessor
 		{
 			string name;
 			uint   customLoc;
+
 			ShaderVarPragma( const string& definedInFile_, int definedInLine_, const string& name_, uint customLoc_ ):
-				Pragma( definedInFile_, definedInLine_ ), name(name_), customLoc(customLoc_)
+				Pragma( definedInFile_, definedInLine_ ),
+				name(name_),
+				customLoc(customLoc_)
 			{}
 		};
 	

+ 6 - 6
src/Resources/LightProps.cpp

@@ -3,9 +3,9 @@
 #include "Texture.h"
 
 
-//=====================================================================================================================================
-// load                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// load                                                                                                                =
+//======================================================================================================================
 bool LightProps::load( const char* filename )
 {
 Scanner scanner;
@@ -118,9 +118,9 @@ Scanner scanner;
 }
 
 
-//=====================================================================================================================================
-// unload                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// unload                                                                                                              =
+//======================================================================================================================
 void LightProps::unload()
 {
 	if( texture != NULL )

+ 18 - 18
src/Resources/Material.cpp

@@ -13,9 +13,9 @@
 #define MTL_ERROR( x ) ERROR( "Material (" << getRsrcPath() << getRsrcName() << "): " << x );
 
 
-//=====================================================================================================================================
-// Statics                                                                                                                            =
-//=====================================================================================================================================
+//======================================================================================================================
+// Statics                                                                                                             =
+//======================================================================================================================
 Material::StdVarInfo Material::stdAttribVarInfos[ SAV_NUM ] =
 {
 	{ "position", GL_FLOAT_VEC3 },
@@ -47,9 +47,9 @@ Material::StdVarInfo Material::stdUniVarInfos[ SUV_NUM ] =
 };
 
 
-//=====================================================================================================================================
-// Blending stuff                                                                                                                     =
-//=====================================================================================================================================
+//======================================================================================================================
+// Blending stuff                                                                                                      =
+//======================================================================================================================
 struct BlendParam
 {
 	int glEnum;
@@ -87,9 +87,9 @@ static bool searchBlendEnum( const char* str, int& gl_enum )
 }
 
 
-//=====================================================================================================================================
-// load                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// load                                                                                                                =
+//======================================================================================================================
 bool Material::load( const char* filename )
 {
 	Scanner scanner;
@@ -323,9 +323,9 @@ bool Material::load( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// initStdShaderVars                                                                                                                  =
-//=====================================================================================================================================
+//======================================================================================================================
+// initStdShaderVars                                                                                                   =
+//======================================================================================================================
 bool Material::initStdShaderVars()
 {
 	// sanity checks
@@ -384,9 +384,9 @@ bool Material::initStdShaderVars()
 }
 
 
-//=====================================================================================================================================
-// Constructor                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// Constructor                                                                                                         =
+//======================================================================================================================
 Material::Material()
 {
 	shaderProg = NULL;
@@ -400,9 +400,9 @@ Material::Material()
 	dpMtl = NULL;
 }
 
-//=====================================================================================================================================
-// unload                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// unload                                                                                                              =
+//======================================================================================================================
 void Material::unload()
 {
 	Rsrc::shaders.unload( shaderProg );

+ 8 - 7
src/Resources/Material.h

@@ -10,12 +10,12 @@
 /**
  * Mesh material @ref Resource
  *
- * Every material keeps info of how to render a @ref MeshNode. Among this info it keeps the locations of attribute and uniform
- * variables. The variables can be standard or user defined. The standard variables have standard names inside the shader program and
- * we dont have to mention them in the .mtl files. The material init func scoops the shader program for standard variables and keeps
- * a pointer to the variable. The standard variables are like the GL build-in variables (that we cannot longer use on GL >3) with a few
- * additions. The user defined variables are defined and values inside the .mtl file. The attribute variables cannot be user defined,
- * the uniform on the other hand can.
+ * Every material keeps info of how to render a @ref MeshNode. Among this info it keeps the locations of attribute and
+ * uniform variables. The variables can be standard or user defined. The standard variables have standard names inside
+ * the shader program and we dont have to mention them in the .mtl files. The material init func scoops the shader
+ * program for standard variables and keeps a pointer to the variable. The standard variables are like the GL build-in
+ * variables (that we cannot longer use on GL >3) with a few additions. The user defined variables are defined and
+ * values inside the .mtl file. The attribute variables cannot be user defined, the uniform on the other hand can.
  */
 class Material: public Resource
 {
@@ -120,7 +120,8 @@ class Material: public Resource
 
 
 		/**
-		 * The func sweeps all the variables of the shader program to find standard shader program variables. It updates the stdAttribVars
+		 * The func sweeps all the variables of the shader program to find standard shader program variables. It updates the
+		 * stdAttribVars
 		 * and stdUniVars arrays.
 		 * @return True on success
 		 */

+ 24 - 24
src/Resources/Mesh.cpp

@@ -5,9 +5,9 @@
 #include "Parser.h"
 
 
-//=====================================================================================================================================
-// load                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// load                                                                                                                =
+//======================================================================================================================
 bool Mesh::load( const char* filename )
 {
 	Scanner scanner;
@@ -163,18 +163,18 @@ bool Mesh::load( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// unload                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// unload                                                                                                              =
+//======================================================================================================================
 void Mesh::unload()
 {
 	// ToDo: add when finalized
 }
 
 
-//=====================================================================================================================================
-// createFaceNormals                                                                                                                  =
-//=====================================================================================================================================
+//======================================================================================================================
+// createFaceNormals                                                                                                   =
+//======================================================================================================================
 void Mesh::createVertIndeces()
 {
 	DEBUG_ERR( vertIndeces.size() > 0 );
@@ -189,9 +189,9 @@ void Mesh::createVertIndeces()
 }
 
 
-//=====================================================================================================================================
-// createFaceNormals                                                                                                                  =
-//=====================================================================================================================================
+//======================================================================================================================
+// createFaceNormals                                                                                                   =
+//======================================================================================================================
 void Mesh::createFaceNormals()
 {
 	for( uint i=0; i<tris.size(); i++ )
@@ -208,9 +208,9 @@ void Mesh::createFaceNormals()
 }
 
 
-//=====================================================================================================================================
-// createVertNormals                                                                                                                  =
-//=====================================================================================================================================
+//======================================================================================================================
+// createVertNormals                                                                                                   =
+//======================================================================================================================
 void Mesh::createVertNormals()
 {
 	vertNormals.resize( vertCoords.size() ); // alloc
@@ -231,9 +231,9 @@ void Mesh::createVertNormals()
 }
 
 
-//=====================================================================================================================================
-// createVertTangents                                                                                                                 =
-//=====================================================================================================================================
+//======================================================================================================================
+// createVertTangents                                                                                                  =
+//======================================================================================================================
 void Mesh::createVertTangents()
 {
 	vertTangents.resize( vertCoords.size() ); // alloc
@@ -299,9 +299,9 @@ void Mesh::createVertTangents()
 }
 
 
-//=====================================================================================================================================
-// createVBOs                                                                                                                         =
-//=====================================================================================================================================
+//======================================================================================================================
+// createVBOs                                                                                                          =
+//======================================================================================================================
 void Mesh::createVBOs()
 {
 	vbos.vertIndeces.create( GL_ELEMENT_ARRAY_BUFFER, vertIndeces.getSizeInBytes(), &vertIndeces[0], GL_STATIC_DRAW );
@@ -316,9 +316,9 @@ void Mesh::createVBOs()
 }
 
 
-//=====================================================================================================================================
-// calcBSphere                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// calcBSphere                                                                                                         =
+//======================================================================================================================
 void Mesh::calcBSphere()
 {
 	bsphere.Set( &vertCoords[0], 0, vertCoords.size() );

+ 1 - 1
src/Resources/Resource.cpp

@@ -12,7 +12,7 @@ namespace Rsrc {
 
 /*
 =======================================================================================================================================
-DATA OBJECTS                                                                                                                          =
+DATA OBJECTS                                                                                                           =
 =======================================================================================================================================
 */
 Container<Texture>    textures;

+ 2 - 2
src/Resources/Resource.h

@@ -20,8 +20,8 @@ template< typename Type > class Container;
 
 
 /**
- * Every class that it is considered a resource should be derived by this one. This step is not necessary because of the Container
- * template but ensures that loading will be made by the resource manager and not the class itself
+ * Every class that it is considered a resource should be derived by this one. This step is not necessary because of the
+ * Container template but ensures that loading will be made by the resource manager and not the class itself
  */
 class Resource
 {

+ 48 - 55
src/Resources/ShaderProg.cpp

@@ -7,6 +7,11 @@
 #define SHADER_ERROR( x ) ERROR( "Shader (" << getRsrcName() << "): " << x )
 #define SHADER_WARNING( x ) WARNING( "Shader (" << getRsrcName() << "): " << x )
 
+
+//======================================================================================================================
+// Statics                                                                                                             =
+//======================================================================================================================
+
 string ShaderProg::stdSourceCode(
 	"#version 150 compatibility\n \
 	precision lowp float;\n \
@@ -14,11 +19,14 @@ string ShaderProg::stdSourceCode(
 	#pragma debug(off)\n"
 );
 
-//=====================================================================================================================================
-// set uniforms                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// set uniforms                                                                                                        =
+//======================================================================================================================
 /**
- * Standard set uniform check
+ * Standard set uniform checks
+ * - Check if initialized
+ * - if the current shader program is the var's shader program
+ * - if the GL driver gives the same location as the one the var has
  */
 #define STD_SET_UNI_CHECK() DEBUG_ERR( getLoc() == -1 ); \
                             DEBUG_ERR( ShaderProg::getCurrentProgramGlId() != fatherSProg->getGlId() ); \
@@ -83,9 +91,9 @@ void ShaderProg::UniVar::setTexture( const Texture& tex, uint texUnit ) const
 }
 
 
-//=====================================================================================================================================
-// createAndCompileShader                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// createAndCompileShader                                                                                              =
+//======================================================================================================================
 uint ShaderProg::createAndCompileShader( const char* sourceCode, const char* preproc, int type ) const
 {
 	uint glId = 0;
@@ -138,9 +146,9 @@ uint ShaderProg::createAndCompileShader( const char* sourceCode, const char* pre
 }
 
 
-//=====================================================================================================================================
-// link                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// link                                                                                                                =
+//======================================================================================================================
 bool ShaderProg::link()
 {
 	// link
@@ -169,9 +177,9 @@ bool ShaderProg::link()
 }
 
 
-//=====================================================================================================================================
-// getUniAndAttribVars                                                                                                                =
-//=====================================================================================================================================
+//======================================================================================================================
+// getUniAndAttribVars                                                                                                 =
+//======================================================================================================================
 void ShaderProg::getUniAndAttribVars()
 {
 	int num;
@@ -224,9 +232,9 @@ void ShaderProg::getUniAndAttribVars()
 }
 
 
-//=====================================================================================================================================
-// bindCustomAttribLocs                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// bindCustomAttribLocs                                                                                                =
+//======================================================================================================================
 bool ShaderProg::bindCustomAttribLocs( const ShaderPrePreprocessor& pars ) const
 {
 	for( uint i=0; i<pars.getOutput().getAttribLocs().size(); ++i )
@@ -239,7 +247,8 @@ bool ShaderProg::bindCustomAttribLocs( const ShaderPrePreprocessor& pars ) const
 		GLenum errId = glGetError();
 		if( errId != GL_NO_ERROR )
 		{
-			SHADER_ERROR( "Something went wrong for attrib \"" << name << "\" and location " << loc << " (" << gluErrorString( errId ) << ")" );
+			SHADER_ERROR( "Something went wrong for attrib \"" << name << "\" and location " << loc << " (" <<
+			              gluErrorString( errId ) << ")" );
 			return false;
 		}
 	}
@@ -247,9 +256,9 @@ bool ShaderProg::bindCustomAttribLocs( const ShaderPrePreprocessor& pars ) const
 }
 
 
-//=====================================================================================================================================
-// load                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// load                                                                                                                =
+//======================================================================================================================
 bool ShaderProg::load( const char* filename )
 {
 	if( !customLoad( filename, "" ) ) return false;
@@ -257,9 +266,9 @@ bool ShaderProg::load( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// customLoad                                                                                                                         =
-//=====================================================================================================================================
+//======================================================================================================================
+// customLoad                                                                                                          =
+//======================================================================================================================
 bool ShaderProg::customLoad( const char* filename, const char* extraSource )
 {
 	if( getRsrcName().length() == 0 )
@@ -274,10 +283,12 @@ bool ShaderProg::customLoad( const char* filename, const char* extraSource )
 
 	// 1) create and compile the shaders
 	string preprocSource = stdSourceCode + extraSource;
-	uint vertGlId = createAndCompileShader( pars.getOutput().getVertShaderSource().c_str(), preprocSource.c_str(), GL_VERTEX_SHADER );
+	uint vertGlId = createAndCompileShader( pars.getOutput().getVertShaderSource().c_str(), preprocSource.c_str(),
+	                                        GL_VERTEX_SHADER );
 	if( vertGlId == 0 ) return false;
 
-	uint fragGlId = createAndCompileShader( pars.getOutput().getFragShaderSource().c_str(), preprocSource.c_str(), GL_FRAGMENT_SHADER );
+	uint fragGlId = createAndCompileShader( pars.getOutput().getFragShaderSource().c_str(), preprocSource.c_str(),
+	                                        GL_FRAGMENT_SHADER );
 	if( fragGlId == 0 ) return false;
 
 	// 2) create program and attach shaders
@@ -304,9 +315,9 @@ bool ShaderProg::customLoad( const char* filename, const char* extraSource )
 }
 
 
-//=====================================================================================================================================
-// findUniVar                                                                                                                          =
-//=====================================================================================================================================
+//======================================================================================================================
+// findUniVar                                                                                                          =
+//======================================================================================================================
 const ShaderProg::UniVar* ShaderProg::findUniVar( const char* name ) const
 {
 	NameToUniVarIterator it = uniNameToVar.find( name );
@@ -319,9 +330,9 @@ const ShaderProg::UniVar* ShaderProg::findUniVar( const char* name ) const
 }
 
 
-//=====================================================================================================================================
-// findAttribVar                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// findAttribVar                                                                                                       =
+//======================================================================================================================
 const ShaderProg::AttribVar* ShaderProg::findAttribVar( const char* name ) const
 {
 	NameToAttribVarIterator it = attribNameToVar.find( name );
@@ -334,9 +345,9 @@ const ShaderProg::AttribVar* ShaderProg::findAttribVar( const char* name ) const
 }
 
 
-//=====================================================================================================================================
-// uniVarExists                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// uniVarExists                                                                                                        =
+//======================================================================================================================
 bool ShaderProg::uniVarExists( const char* name ) const
 {
 	NameToUniVarIterator it = uniNameToVar.find( name );
@@ -344,30 +355,12 @@ bool ShaderProg::uniVarExists( const char* name ) const
 }
 
 
-//=====================================================================================================================================
-// attribVarExists                                                                                                                    =
-//=====================================================================================================================================
+//======================================================================================================================
+// attribVarExists                                                                                                     =
+//======================================================================================================================
 bool ShaderProg::attribVarExists( const char* name ) const
 {
 	NameToAttribVarIterator it = attribNameToVar.find( name );
 	return it != attribNameToVar.end();
 }
 
-
-//=====================================================================================================================================
-// locTexUnit                                                                                                                         =
-//=====================================================================================================================================
-void ShaderProg::locTexUnit( int loc, const Texture& tex, uint texUnit ) const
-{
-	DEBUG_ERR( loc == -1 );
-	DEBUG_ERR( getCurrentProgramGlId() != glId );
-	tex.bind( texUnit );
-	glUniform1i( loc, texUnit );
-}
-
-void ShaderProg::locTexUnit( const char* loc, const Texture& tex, uint tex_unit ) const
-{
-	DEBUG_ERR( getCurrentProgramGlId() != glId );
-	tex.bind( tex_unit );
-	glUniform1i( findUniVar(loc)->getLoc(), tex_unit );
-}

+ 3 - 16
src/Resources/ShaderProg.h

@@ -11,9 +11,9 @@
 /**
  * Shader program @ref Resource
  *
- * Shader program. Combines a fragment and a vertex shader. Every shader program consist of one OpenGL ID, a vector of uniform variables
- * and a vector of attribute variables. Every variable is a struct that contains the variable's name, location, OpenGL data type and
- * if it is a uniform or an attribute var.
+ * Shader program. Combines a fragment and a vertex shader. Every shader program consist of one OpenGL ID, a vector of
+ * uniform variables and a vector of attribute variables. Every variable is a struct that contains the variable's name,
+ * location, OpenGL data type and if it is a uniform or an attribute var.
  */
 class ShaderProg: public Resource
 {
@@ -170,19 +170,6 @@ class ShaderProg: public Resource
 
 		bool uniVarExists( const char* varName ) const;
 		bool attribVarExists( const char* varName ) const;
-
-		/**
-		 * The function's code is being used way to often so a function has to be made. It connects a location a texture and a texture unit
-		 * @param location Shader program variable location
-		 * @param tex The texture
-		 * @param texUnit The number of the texture unit
-		 */
-		void locTexUnit( int varLoc, const class Texture& tex, uint texUnit ) const;
-
-		/**
-		 * @see locTexUnit
-		 */
-		void locTexUnit( const char* varName, const class Texture& tex, uint texUnit ) const;
 }; 
 
 #endif

+ 3 - 3
src/Resources/SkelAnim.cpp

@@ -3,9 +3,9 @@
 #include "Parser.h"
 
 
-//=====================================================================================================================================
-// load                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// load                                                                                                                =
+//======================================================================================================================
 bool SkelAnim::load( const char* filename )
 {
 	Scanner scanner;

+ 3 - 3
src/Resources/Skeleton.cpp

@@ -3,9 +3,9 @@
 #include "Parser.h"
 
 
-//=====================================================================================================================================
-// load                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// load                                                                                                                =
+//======================================================================================================================
 bool Skeleton::load( const char* filename )
 {
 	Scanner scanner;

+ 21 - 21
src/Resources/Texture.cpp

@@ -3,27 +3,27 @@
 #include "Image.h"
 
 
-//=====================================================================================================================================
-// Statics                                                                                                                            =
-//=====================================================================================================================================
+//======================================================================================================================
+// Statics                                                                                                             =
+//======================================================================================================================
 int Texture::textureUnitsNum = -1;
 bool Texture::mipmappingEnabled = true;
 bool Texture::compressionEnabled = false;
 int Texture::anisotropyLevel = 8;
 
 
-//=====================================================================================================================================
-// Constructor                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// Constructor                                                                                                         =
+//======================================================================================================================
 Texture::Texture():
 	glId(numeric_limits<uint>::max()),
 	type(GL_TEXTURE_2D)
 {
 }
 
-//=====================================================================================================================================
-// load                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// load                                                                                                                =
+//======================================================================================================================
 bool Texture::load( const char* filename )
 {
 	type = GL_TEXTURE_2D;
@@ -81,9 +81,9 @@ bool Texture::load( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// createEmpty2D                                                                                                                      =
-//=====================================================================================================================================
+//======================================================================================================================
+// createEmpty2D                                                                                                       =
+//======================================================================================================================
 bool Texture::createEmpty2D( float width_, float height_, int internalFormat, int format_, GLenum type_ )
 {
 	DEBUG_ERR( glGetError() != GL_NO_ERROR ); // dont enter the func holding an error
@@ -121,9 +121,9 @@ bool Texture::createEmpty2D( float width_, float height_, int internalFormat, in
 }
 
 
-//=====================================================================================================================================
-// createEmpty2DMSAA                                                                                                                  =
-//=====================================================================================================================================
+//======================================================================================================================
+// createEmpty2DMSAA                                                                                                   =
+//======================================================================================================================
 bool Texture::createEmpty2DMSAA( float width, float height, int samples_num, int internal_format )
 {
 	/*type = GL_TEXTURE_2D_MULTISAMPLE;
@@ -139,18 +139,18 @@ bool Texture::createEmpty2DMSAA( float width, float height, int samples_num, int
 }
 
 
-//=====================================================================================================================================
-// unload                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// unload                                                                                                              =
+//======================================================================================================================
 void Texture::unload()
 {
 	glDeleteTextures( 1, &glId );
 }
 
 
-//=====================================================================================================================================
-// bind                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// bind                                                                                                                =
+//======================================================================================================================
 void Texture::bind( uint unit ) const
 {
 	if( unit >= static_cast<uint>(textureUnitsNum) )

+ 30 - 30
src/Scene/Camera.cpp

@@ -3,9 +3,9 @@
 #include "App.h"
 
 
-//=====================================================================================================================================
-// setAll                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// setAll                                                                                                              =
+//======================================================================================================================
 void Camera::setAll( float fovx_, float fovy_, float znear_, float zfar_ )
 {
 	fovX = fovx_;
@@ -17,9 +17,9 @@ void Camera::setAll( float fovx_, float fovy_, float znear_, float zfar_ )
 }
 
 
-//=====================================================================================================================================
-// render                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// render                                                                                                              =
+//======================================================================================================================
 void Camera::render()
 {
 	glPushMatrix();
@@ -68,9 +68,9 @@ void Camera::render()
 }
 
 
-//=====================================================================================================================================
-// lookAtPoint                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// lookAtPoint                                                                                                         =
+//======================================================================================================================
 void Camera::lookAtPoint( const Vec3& point )
 {
 	const Vec3& j = Vec3( 0.0, 1.0, 0.0 );
@@ -81,9 +81,9 @@ void Camera::lookAtPoint( const Vec3& point )
 }
 
 
-//=====================================================================================================================================
-// calcLSpaceFrustumPlanes                                                                                                            =
-//=====================================================================================================================================
+//======================================================================================================================
+// calcLSpaceFrustumPlanes                                                                                             =
+//======================================================================================================================
 void Camera::calcLSpaceFrustumPlanes()
 {
 	float c, s; // cos & sine
@@ -107,9 +107,9 @@ void Camera::calcLSpaceFrustumPlanes()
 }
 
 
-//=====================================================================================================================================
-// updateWSpaceFrustumPlanes                                                                                                          =
-//=====================================================================================================================================
+//======================================================================================================================
+// updateWSpaceFrustumPlanes                                                                                           =
+//======================================================================================================================
 void Camera::updateWSpaceFrustumPlanes()
 {
 	for( uint i=0; i<6; i++ )
@@ -119,9 +119,9 @@ void Camera::updateWSpaceFrustumPlanes()
 }
 
 
-//=====================================================================================================================================
-// insideFrustum                                                                                                                      =
-//=====================================================================================================================================
+//======================================================================================================================
+// insideFrustum                                                                                                       =
+//======================================================================================================================
 /// Check if the volume is inside the frustum cliping planes
 bool Camera::insideFrustum( const bvolume_t& bvol ) const
 {
@@ -133,9 +133,9 @@ bool Camera::insideFrustum( const bvolume_t& bvol ) const
 }
 
 
-//=====================================================================================================================================
-// insideFrustum                                                                                                                      =
-//=====================================================================================================================================
+//======================================================================================================================
+// insideFrustum                                                                                                       =
+//======================================================================================================================
 bool Camera::insideFrustum( const Camera& cam ) const
 {
 	//** get five points. These points are the tips of the given camera **
@@ -175,9 +175,9 @@ bool Camera::insideFrustum( const Camera& cam ) const
 }
 
 
-//=====================================================================================================================================
-// calcProjectionMatrix                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// calcProjectionMatrix                                                                                                =
+//======================================================================================================================
 void Camera::calcProjectionMatrix()
 {
 	float f = 1.0/tan( fovY*0.5f ); // f = cot(fovY/2)
@@ -203,9 +203,9 @@ void Camera::calcProjectionMatrix()
 }
 
 
-//=====================================================================================================================================
-// updateViewMatrix                                                                                                                   =
-//=====================================================================================================================================
+//======================================================================================================================
+// updateViewMatrix                                                                                                    =
+//======================================================================================================================
 void Camera::updateViewMatrix()
 {
 	/*
@@ -222,9 +222,9 @@ void Camera::updateViewMatrix()
 }
 
 
-//=====================================================================================================================================
-// updateWorldStuff                                                                                                                   =
-//=====================================================================================================================================
+//======================================================================================================================
+// updateWorldStuff                                                                                                    =
+//======================================================================================================================
 void Camera::updateWorldStuff()
 {
 	updateWorldTransform();

+ 15 - 15
src/Scene/Controllers/SkelAnimCtrl.cpp

@@ -6,9 +6,9 @@
 #include "MainRenderer.h"
 
 
-//=====================================================================================================================================
-// SkelAnimCtrl                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// SkelAnimCtrl                                                                                              =
+//======================================================================================================================
 SkelAnimCtrl::SkelAnimCtrl( SkelNode* skelNode_ ):
 	Controller(CT_SKEL_ANIM),
 	skelNode( skelNode_ )
@@ -20,9 +20,9 @@ SkelAnimCtrl::SkelAnimCtrl( SkelNode* skelNode_ ):
 }
 
 
-//=====================================================================================================================================
-// interpolate                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// interpolate                                                                                                         =
+//======================================================================================================================
 void SkelAnimCtrl::interpolate( SkelAnim* animation, float frame )
 {
 	DEBUG_ERR( frame >= animation->framesNum );
@@ -85,9 +85,9 @@ void SkelAnimCtrl::interpolate( SkelAnim* animation, float frame )
 }
 
 
-//=====================================================================================================================================
-// updateBoneTransforms                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// updateBoneTransforms                                                                                                =
+//======================================================================================================================
 void SkelAnimCtrl::updateBoneTransforms()
 {
 	uint queue[ 128 ];
@@ -130,9 +130,9 @@ void SkelAnimCtrl::updateBoneTransforms()
 }
 
 
-//=====================================================================================================================================
-// deform                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// deform                                                                                                              =
+//======================================================================================================================
 void SkelAnimCtrl::deform()
 {
 	Skeleton* skeleton = skelNode->skeleton;
@@ -148,9 +148,9 @@ void SkelAnimCtrl::deform()
 }
 
 
-//=====================================================================================================================================
-// update                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// update                                                                                                              =
+//======================================================================================================================
 void SkelAnimCtrl::update( float )
 {
 	frame += step;

+ 18 - 18
src/Scene/Light.cpp

@@ -5,9 +5,9 @@
 #include "MainRenderer.h"
 
 
-//=====================================================================================================================================
-// init [PointLight]                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// init [PointLight]                                                                                                =
+//======================================================================================================================
 void PointLight::init( const char* filename )
 {
 	lightProps = Rsrc::lightProps.load( filename );
@@ -15,9 +15,9 @@ void PointLight::init( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// init [SpotLight]                                                                                                                =
-//=====================================================================================================================================
+//======================================================================================================================
+// init [SpotLight]                                                                                                 =
+//======================================================================================================================
 void SpotLight::init( const char* filename )
 {
 	lightProps = Rsrc::lightProps.load( filename );
@@ -31,18 +31,18 @@ void SpotLight::init( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// deinit                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// deinit                                                                                                              =
+//======================================================================================================================
 void Light::deinit()
 {
 	Rsrc::lightProps.unload( lightProps );
 }
 
 
-//=====================================================================================================================================
-// renderSphere                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// renderSphere                                                                                                        =
+//======================================================================================================================
 static void RenderSphere( const Mat4& tsl, const Vec3& col )
 {
 	glPushMatrix();
@@ -56,18 +56,18 @@ static void RenderSphere( const Mat4& tsl, const Vec3& col )
 }
 
 
-//=====================================================================================================================================
-// render                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// render                                                                                                              =
+//======================================================================================================================
 void PointLight::render()
 {
 	RenderSphere( Mat4(getWorldTransform()), lightProps->getDiffuseColor() );
 }
 
 
-//=====================================================================================================================================
-// render                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// render                                                                                                              =
+//======================================================================================================================
 void SpotLight::render()
 {
 	RenderSphere( Mat4(getWorldTransform()), lightProps->getDiffuseColor() );

+ 9 - 9
src/Scene/MeshNode.cpp

@@ -10,9 +10,9 @@
 #include "MainRenderer.h"
 
 
-//=====================================================================================================================================
-// init                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// init                                                                                                                =
+//======================================================================================================================
 void MeshNode::init( const char* filename )
 {
 	mesh = Rsrc::meshes.load( filename );
@@ -28,9 +28,9 @@ void MeshNode::init( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// deinit                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// deinit                                                                                                              =
+//======================================================================================================================
 void MeshNode::deinit()
 {
 	Rsrc::meshes.unload( mesh );
@@ -38,9 +38,9 @@ void MeshNode::deinit()
 }
 
 
-//=====================================================================================================================================
-// render                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// render                                                                                                              =
+//======================================================================================================================
 void MeshNode::render( Material* mtl ) const
 {
 	GLint loc;

+ 12 - 12
src/Scene/ParticleEmitter.cpp

@@ -5,9 +5,9 @@
 #include "Scene.h"
 
 
-//=====================================================================================================================================
-// render                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// render                                                                                                              =
+//======================================================================================================================
 void ParticleEmitter::Particle::render()
 {
 	if( lifeTillDeath < 0 ) return;
@@ -23,9 +23,9 @@ void ParticleEmitter::Particle::render()
 }
 
 
-//=====================================================================================================================================
-// init                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// init                                                                                                                =
+//======================================================================================================================
 void ParticleEmitter::init( const char* filename )
 {
 	// dummy props init
@@ -63,9 +63,9 @@ void ParticleEmitter::init( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// update                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// update                                                                                                              =
+//======================================================================================================================
 void ParticleEmitter::update()
 {
 	uint crntTime = app->getTicks();
@@ -163,9 +163,9 @@ void ParticleEmitter::update()
 }
 
 
-//=====================================================================================================================================
-// render                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// render                                                                                                              =
+//======================================================================================================================
 void ParticleEmitter::render()
 {
 	glPushMatrix();

+ 18 - 18
src/Scene/Scene.cpp

@@ -8,9 +8,9 @@
 #include "Material.h"
 
 
-//=====================================================================================================================================
-// Constructor                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// Constructor                                                                                                         =
+//======================================================================================================================
 Scene::Scene()
 {
 	ambientCol = Vec3( 0.1, 0.05, 0.05 )*1;
@@ -20,9 +20,9 @@ Scene::Scene()
 }
 
 
-//=====================================================================================================================================
-// registerNode                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// registerNode                                                                                                        =
+//======================================================================================================================
 void Scene::registerNode( SceneNode* node )
 {
 	putBackNode( nodes, node );
@@ -48,9 +48,9 @@ void Scene::registerNode( SceneNode* node )
 }
 
 
-//=====================================================================================================================================
-// unregisterNode                                                                                                                     =
-//=====================================================================================================================================
+//======================================================================================================================
+// unregisterNode                                                                                                      =
+//======================================================================================================================
 void Scene::unregisterNode( SceneNode* node )
 {
 	eraseNode( nodes, node );
@@ -76,9 +76,9 @@ void Scene::unregisterNode( SceneNode* node )
 }
 
 
-//=====================================================================================================================================
-// Register and Unregister controllers                                                                                                =
-//=====================================================================================================================================
+//======================================================================================================================
+// Register and Unregister controllers                                                                                 =
+//======================================================================================================================
 void Scene::registerController( Controller* controller )
 {
 	DEBUG_ERR( std::find( controllers.begin(), controllers.end(), controller ) != controllers.end() );
@@ -93,9 +93,9 @@ void Scene::unregisterController( Controller* controller )
 }
 
 
-//=====================================================================================================================================
-// updateAllWorldStuff                                                                                                                =
-//=====================================================================================================================================
+//======================================================================================================================
+// updateAllWorldStuff                                                                                                 =
+//======================================================================================================================
 void Scene::updateAllWorldStuff()
 {
 	DEBUG_ERR( nodes.size() > 1024 );
@@ -125,9 +125,9 @@ void Scene::updateAllWorldStuff()
 }
 
 
-//=====================================================================================================================================
-// updateAllControllers                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// updateAllControllers                                                                                                =
+//======================================================================================================================
 void Scene::updateAllControllers()
 {
 	for( Vec<Controller*>::iterator it=controllers.begin(); it!=controllers.end(); it++ )

+ 19 - 19
src/Scene/SceneNode.cpp

@@ -7,9 +7,9 @@
 #include "App.h"
 
 
-//=====================================================================================================================================
-// commonConstructorCode                                                                                                              =
-//=====================================================================================================================================
+//======================================================================================================================
+// commonConstructorCode                                                                                               =
+//======================================================================================================================
 void SceneNode::commonConstructorCode()
 {
 	parent = NULL;
@@ -23,9 +23,9 @@ void SceneNode::commonConstructorCode()
 }
 
 
-//=====================================================================================================================================
-// Destructor                                                                                                                         =
-//=====================================================================================================================================
+//======================================================================================================================
+// Destructor                                                                                                          =
+//======================================================================================================================
 SceneNode::~SceneNode()
 {
 	DEBUG_ERR( app->getScene() == NULL );
@@ -33,9 +33,9 @@ SceneNode::~SceneNode()
 }
 
 
-//=====================================================================================================================================
-// updateWorldTransform                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// updateWorldTransform                                                                                                =
+//======================================================================================================================
 void SceneNode::updateWorldTransform()
 {
 	if( parent )
@@ -83,10 +83,10 @@ void SceneNode::updateWorldTransform()
 }
 
 
-//=====================================================================================================================================
-// Move(s)                                                                                                                            =
-// Move the object according to it's local axis                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// Move(s)                                                                                                             =
+// Move the object according to it's local axis                                                                        =
+//======================================================================================================================
 void SceneNode::moveLocalX( float distance )
 {
 	Vec3 x_axis = localTransform.getRotation().getColumn(0);
@@ -106,9 +106,9 @@ void SceneNode::moveLocalZ( float distance )
 }
 
 
-//=====================================================================================================================================
-// addChild                                                                                                                           =
-//=====================================================================================================================================
+//======================================================================================================================
+// addChild                                                                                                            =
+//======================================================================================================================
 void SceneNode::addChild( SceneNode* node )
 {
 	if( node->parent != NULL )
@@ -122,9 +122,9 @@ void SceneNode::addChild( SceneNode* node )
 }
 
 
-//=====================================================================================================================================
-// removeChild                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// removeChild                                                                                                         =
+//======================================================================================================================
 void SceneNode::removeChild( SceneNode* node )
 {
 	Vec<SceneNode*>::iterator it = find( childs.begin(), childs.end(), node );

+ 12 - 12
src/Scene/SkelNode.cpp

@@ -6,9 +6,9 @@
 #include "MainRenderer.h"
 
 
-//=====================================================================================================================================
-// SkelNode                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// SkelNode                                                                                                         =
+//======================================================================================================================
 SkelNode::SkelNode(): 
 	SceneNode( NT_SKELETON ),
 	skelAnimCtrl( NULL )
@@ -16,9 +16,9 @@ SkelNode::SkelNode():
 }
 
 
-//=====================================================================================================================================
-// init                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// init                                                                                                                =
+//======================================================================================================================
 void SkelNode::init( const char* filename )
 {
 	skeleton = Rsrc::skeletons.load( filename );
@@ -26,18 +26,18 @@ void SkelNode::init( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// deinit                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// deinit                                                                                                              =
+//======================================================================================================================
 void SkelNode::deinit()
 {
 	Rsrc::skeletons.unload( skeleton );
 }
 
 
-//=====================================================================================================================================
-// render                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// render                                                                                                              =
+//======================================================================================================================
 void SkelNode::render()
 {
 	glPushMatrix();

+ 17 - 17
src/Ui/Ui.cpp

@@ -11,7 +11,7 @@ namespace Ui {
 
 /*
 =======================================================================================================================================
-data members                                                                                                                          =
+data members                                                                                                           =
 =======================================================================================================================================
 */
 static Texture* fontMap;
@@ -30,7 +30,7 @@ static float  crntY;
 
 /*
 =======================================================================================================================================
-static funcs                                                                                                                          =
+static funcs                                                                                                           =
 =======================================================================================================================================
 */
 
@@ -39,7 +39,7 @@ static funcs
 static void SetGL()
 {
 	shader->bind();
-	shader->locTexUnit( shader->findUniVar("fontMap")->getLoc(), *fontMap, 0 );
+	shader->findUniVar( "fontMap" )->setTexture( *fontMap, 0 );
 
 	glEnable( GL_BLEND );
 	glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
@@ -80,7 +80,7 @@ static void drawChar( char c )
 	// first check for special chars
 	if( c=='\n' ) // new line
 	{
-		//glTranslatef( initial_x, -font_h, 0.0f );
+		//glTranslatef( initial_x, -font_h, 0.0 );
 		crntX = initialX;
 		crntY -= fontH;
 		return;
@@ -100,8 +100,8 @@ static void drawChar( char c )
 	const int linesNum     = 8; // the lines of chars in font_map.tga
 
 	// the uvs
-	float charWidth = 1.0f/float(charsPerLine);
-	float charHeight = 1.0f/float(linesNum);
+	float charWidth = 1.0/float(charsPerLine);
+	float charHeight = 1.0/float(linesNum);
 	float uvTop = float(linesNum - (c-' ')/charsPerLine) / float(linesNum);
 	float uvLeft = float( (c-' ')%charsPerLine ) / float(charsPerLine);
 	float uvRight = uvLeft + charWidth;
@@ -109,15 +109,15 @@ static void drawChar( char c )
 	float uvs[4][2] = { {uvLeft, uvTop}, {uvLeft, uvBottom}, {uvRight, uvBottom}, {uvRight, uvTop} };
 
 	// the coords
-	float fwh = fontW/2.0f;
-	float fhh = fontH/2.0f;
+	float fwh = fontW/2.0;
+	float fhh = fontH/2.0;
 	float coords[4][2] = { {-fwh, fhh}, {-fwh, -fhh}, {fwh, -fhh}, {fwh, fhh} }; // fron top left counterclockwise
 
 
 	if( italic )
 	{
-		coords[0][0] += fontW/5.0f;
-		coords[3][0] += fontW/5.0f;
+		coords[0][0] += fontW/5.0;
+		coords[3][0] += fontW/5.0;
 	}
 
 	glBegin(GL_QUADS);
@@ -144,14 +144,14 @@ static void drawChar( char c )
 	glEnable( GL_TEXTURE_2D );*/
 	// end draw outline
 
-	crntX += fontW*0.8f;
+	crntX += fontW*0.8;
 	//glTranslatef( font_w*0.8f, 0.0, 0.0 ); // font_w*(float) to remove the space
 }
 
 
 /*
 =======================================================================================================================================
-non static funcs                                                                                                                      =
+non static funcs                                                                                                       =
 =======================================================================================================================================
 */
 
@@ -164,9 +164,9 @@ void init()
 	fontMap->texParameter( GL_TEXTURE_MIN_FILTER, GL_LINEAR );
 	//font_map->texParameter( GL_TEXTURE_MAG_FILTER, GL_NEAREST );
 	shader = Rsrc::shaders.load( "shaders/txt.glsl" );
-	setPos( 0.0f, 0.0f );
-	setFontWidth( 0.05f );
-	setColor( Vec4(1.0f, 1.0f, 1.0f, 1.0f) );
+	setPos( 0.0, 0.0 );
+	setFontWidth( 0.05 );
+	setColor( Vec4(1.0, 1.0, 1.0, 1.0) );
 	italic = false;
 }
 
@@ -215,11 +215,11 @@ void printf( const char* format, ... )
 void print( const char* text )
 {
 	SetGL();
-	glTranslatef( crntX, crntY, 0.0f );
+	glTranslatef( crntX, crntY, 0.0 );
 	for( char* pc=const_cast<char*>(text); *pc!='\0'; pc++ )
 	{
 		glLoadIdentity();
-		glTranslatef( crntX, crntY, 0.0f );
+		glTranslatef( crntX, crntY, 0.0 );
 		drawChar( *pc );
 	}
 	RestoreGL();

+ 59 - 42
src/Util/App.cpp

@@ -7,9 +7,9 @@
 
 bool App::isCreated = false;
 
-//=====================================================================================================================================
-// parseCommandLineArgs                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// parseCommandLineArgs                                                                                                =
+//======================================================================================================================
 void App::parseCommandLineArgs( int argc, char* argv[] )
 {
 	for( int i=1; i<argc; i++ )
@@ -32,17 +32,29 @@ void App::parseCommandLineArgs( int argc, char* argv[] )
 }
 
 
-//=====================================================================================================================================
-// Constructor                                                                                                                        =
-//=====================================================================================================================================
-App::App( int argc, char* argv[] )
+//======================================================================================================================
+// Constructor                                                                                                         =
+//======================================================================================================================
+App::App():
+	windowW( 1280 ),
+	windowH( 720 ),
+	terminalColoringEnabled( true ),
+	fullScreenFlag( false )
+{
+}
+
+
+//======================================================================================================================
+// init                                                                                                                =
+//======================================================================================================================
+void App::init( int argc, char* argv[] )
 {
 	parseCommandLineArgs( argc, argv );
 
 	printAppInfo();
 
 	if( isCreated )
-		FATAL( "You cannot create a second App instance" )
+		FATAL( "You cannot init a second App instance" )
 
 	isCreated = true;
 
@@ -50,23 +62,20 @@ App::App( int argc, char* argv[] )
 	mainRenderer = new MainRenderer;
 	activeCam = NULL;
 
-	windowW = 1280;
-	windowH = 720;
+
 	/*windowW = 1440;
 	windowH = 900;*/
 
-	fullScreenFlag = false;
 
-	terminalColoringEnabled = false;
 
 	timerTick = 1000/40; // in ms. 1000/Hz
 	time = 0;
 }
 
 
-//=====================================================================================================================================
-// initWindow                                                                                                                         =
-//=====================================================================================================================================
+//======================================================================================================================
+// initWindow                                                                                                          =
+//======================================================================================================================
 void App::initWindow()
 {
 	INFO( "SDL window initializing..." );
@@ -93,8 +102,8 @@ void App::initWindow()
 	SDL_GL_SetAttribute( SDL_GL_ACCELERATED_VISUAL, 1 );
 
 	// OpenWindow
-	windowId = SDL_CreateWindow( "AnKi Engine", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, windowW, windowH, SDL_WINDOW_OPENGL |
-	                             SDL_WINDOW_SHOWN );
+	windowId = SDL_CreateWindow( "AnKi Engine", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, windowW, windowH,
+	                             SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN );
 
 	if( !windowId )
 		FATAL( "Cannot create main window" );
@@ -120,9 +129,9 @@ void App::initWindow()
 }
 
 
-//=====================================================================================================================================
-// togleFullScreen                                                                                                                    =
-//=====================================================================================================================================
+//======================================================================================================================
+// togleFullScreen                                                                                                     =
+//======================================================================================================================
 void App::togleFullScreen()
 {
 	//SDL_WM_ToggleFullScreen( mainSurf );
@@ -131,9 +140,9 @@ void App::togleFullScreen()
 }
 
 
-//=====================================================================================================================================
-// swapBuffers                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// swapBuffers                                                                                                         =
+//======================================================================================================================
 void App::swapBuffers()
 {
 	//SDL_GL_SwapBuffers();
@@ -141,9 +150,9 @@ void App::swapBuffers()
 }
 
 
-//=====================================================================================================================================
-// quitApp                                                                                                                            =
-//=====================================================================================================================================
+//======================================================================================================================
+// quitApp                                                                                                             =
+//======================================================================================================================
 void App::quitApp( int code )
 {
 	SDL_FreeSurface( iconImage );
@@ -154,9 +163,9 @@ void App::quitApp( int code )
 }
 
 
-//=====================================================================================================================================
-// waitForNextFrame                                                                                                                   =
-//=====================================================================================================================================
+//======================================================================================================================
+// waitForNextFrame                                                                                                    =
+//======================================================================================================================
 void App::waitForNextFrame()
 {
 	uint now = SDL_GetTicks();
@@ -174,9 +183,9 @@ void App::waitForNextFrame()
 }
 
 
-//=====================================================================================================================================
-// printAppInfo                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// printAppInfo                                                                                                        =
+//======================================================================================================================
 #if !defined( REVISION )
 	#define REVISION "unknown"
 #endif
@@ -185,11 +194,19 @@ void App::printAppInfo()
 {
 	stringstream msg;
 	msg << "App info: debugging ";
-	#if defined( _DEBUG_ )
+	#if defined( DEBUG )
 		msg << "on, ";
 	#else
 		msg << "off, ";
 	#endif
+	msg << "platform ";
+	#if defined( PLATFORM_LINUX )
+		msg << "Linux, ";
+	#elif defined( PLATFORM_WIN )
+		msg << "Windows, ";
+	#else
+		#error "See file"
+	#endif
 	msg << "GLEW " << glewGetString(GLEW_VERSION) << ", ";
 	const SDL_version* v = SDL_Linked_Version();
 	msg << "SDL " << int(v->major) << '.' << int(v->minor) << '.' << int(v->patch) << ", ";
@@ -200,9 +217,9 @@ void App::printAppInfo()
 }
 
 
-//=====================================================================================================================================
-// getDesktopWidth                                                                                                                    =
-//=====================================================================================================================================
+//======================================================================================================================
+// getDesktopWidth                                                                                                     =
+//======================================================================================================================
 uint App::getDesktopWidth() const
 {
 	SDL_DisplayMode mode;
@@ -211,9 +228,9 @@ uint App::getDesktopWidth() const
 }
 
 
-//=====================================================================================================================================
-// getDesktopHeight                                                                                                                   =
-//=====================================================================================================================================
+//======================================================================================================================
+// getDesktopHeight                                                                                                    =
+//======================================================================================================================
 uint App::getDesktopHeight() const
 {
 	SDL_DisplayMode mode;
@@ -222,9 +239,9 @@ uint App::getDesktopHeight() const
 }
 
 
-//=====================================================================================================================================
-// getTicks                                                                                                                           =
-//=====================================================================================================================================
+//======================================================================================================================
+// getTicks                                                                                                            =
+//======================================================================================================================
 uint App::getTicks()
 {
 	return SDL_GetTicks();

+ 2 - 1
src/Util/App.h

@@ -32,8 +32,9 @@ class App
 	public:
 		uint timerTick;
 
-		App( int argc, char* argv[] );
+		App();
 		~App() {}
+		void init( int argc, char* argv[] );
 		void initWindow();
 		void quitApp( int code );
 		void waitForNextFrame();

+ 105 - 0
src/Util/Common.cpp

@@ -1,2 +1,107 @@
+#include "Common.h"
+#include "App.h"
+#include "Util.h"
 
 
+// for the colors and formating see http://www.dreamincode.net/forums/showtopic75171.htm
+static const char* terminalColors [ MT_NUM + 1 ] =
+{
+	"\033[1;31;6m", // error
+	"\033[1;33;6m", // warning
+	"\033[1;31;6m", // fatal
+	"\033[1;31;6m", // dbg error
+	"\033[1;32;6m", // info
+	"\033[0;;m" // default color
+};
+
+
+//======================================================================================================================
+// msgPrefix                                                                                                           =
+//======================================================================================================================
+ostream& msgPrefix( MsgType msgType, const char* file, int line, const char* func )
+{
+	if( app == NULL )
+		exit( 1 );
+
+	//
+	// select c stream
+	//
+	ostream* cs;
+
+	switch( msgType )
+	{
+		case MT_ERROR:
+		case MT_WARNING:
+		case MT_FATAL:
+		case MT_DEBUG_ERR:
+			cs = &cerr;
+			break;
+
+		case MT_INFO:
+			cs = &cout;
+			break;
+
+		default:
+			break;
+	}
+
+
+	//
+	// print terminal color
+	//
+	if( app->isTerminalColoringEnabled() )
+	{
+		(*cs) << terminalColors[ msgType ];
+	}
+
+
+	//
+	// print message info
+	//
+	switch( msgType )
+	{
+		case MT_ERROR:
+			(*cs) << "Error";
+			break;
+
+		case MT_WARNING:
+			(*cs) << "Warning";
+			break;
+
+		case MT_FATAL:
+			(*cs) << "Fatal";
+			break;
+
+		case MT_DEBUG_ERR:
+			(*cs) << "Debug Err";
+			break;
+
+		case MT_INFO:
+			(*cs) << "Info";
+			break;
+
+		default:
+			break;
+	}
+
+	//
+	// print caller info
+	//
+	(*cs) << " (" << Util::cutPath( file ) << ":" << line << " " << Util::getFunctionFromPrettyFunction( func ) << "): ";
+
+	return (*cs);
+}
+
+
+//======================================================================================================================
+// msgSuffix                                                                                                           =
+//======================================================================================================================
+ostream& msgSuffix( ostream& cs )
+{
+	if( app->isTerminalColoringEnabled() )
+		cs << terminalColors[ MT_NUM ];
+
+	cs << endl;
+	return cs;
+}
+

+ 43 - 62
src/Util/Common.h

@@ -14,9 +14,9 @@
 using namespace std;
 
 
-//=====================================================================================================================================
-// misc types                                                                                                                         =
-//=====================================================================================================================================
+//======================================================================================================================
+// misc types                                                                                                          =
+//======================================================================================================================
 #ifndef uchar
 typedef unsigned char uchar;
 #endif
@@ -35,75 +35,56 @@ typedef unsigned long int ulong;
 
 
 
-//=====================================================================================================================================
-// MACROS                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// MACROS                                                                                                              =
+//======================================================================================================================
 
-namespace Util {
-extern char*  cutPath( const char* path );
-extern string getFunctionFromPrettyFunction( const char* pretty_function );
-}
+enum MsgType
+{
+	MT_ERROR,
+	MT_WARNING,
+	MT_FATAL,
+	MT_DEBUG_ERR,
+	MT_INFO,
+	MT_NUM
+};
 
-#define __FILENAME__ Util::cutPath( __FILE__ )
+extern ostream& msgPrefix( MsgType msgType, const char* file, int line, const char* func );
+extern ostream& msgSuffix( ostream& cs );
 
 #ifdef __GNUG__
-	#define __G_FUNCTION__ Util::getFunctionFromPrettyFunction( __PRETTY_FUNCTION__ )
-#else
-	#define __G_FUNCTION__ __func__
-#endif
-
-#if defined( _TERMINAL_COLORING_ ) && defined( _PLATFORM_LINUX_ )
-		// for the colors and formating see http://www.dreamincode.net/forums/showtopic75171.htm
-    #define COL_ERROR "\033[6;31;6m"
-    #define COL_WARNING "\033[6;33;6m"
-    #define COL_INFO "\033[6;32;6m"
-    #define COL_FATAL "\033[1;31;6m"
-    #define COL_DEBUG_ERR "\033[6;31;6m"
-    #define COL_DEFAULT "\033[0;;m"
+	#define FUNCTION __PRETTY_FUNCTION__
 #else
-    #define COL_ERROR ""
-    #define COL_WARNING ""
-    #define COL_INFO ""
-    #define COL_FATAL ""
-    #define COL_DEBUG_ERR ""
-    #define COL_DEFAULT ""
+	#define FUNCTION __func__
 #endif
 
-/// For internal use
-#define GENERAL_ERR( x, y, col ) \
-	cerr << col << x << " (" << __FILENAME__ << ":" << __LINE__ << " " << __G_FUNCTION__ << "): " << y << COL_DEFAULT << endl;
-
-/// For internal use
-#define GENERAL_MSG( x, y, col ) \
-	cout << col << x << " (" << __FILENAME__ << ":" << __LINE__ << " " << __G_FUNCTION__ << "): " << y << COL_DEFAULT << endl;
-
 /// Use it like this: ERROR( "tralala" << 10 << ' ' )
-#define ERROR( x ) GENERAL_ERR( "Error", x, COL_ERROR )
+#define ERROR( x ) msgPrefix( MT_ERROR, __FILE__, __LINE__, FUNCTION ) << x << msgSuffix;
 
 /// Show a warning
-#define WARNING( x ) GENERAL_ERR( "Warning", x, COL_WARNING )
+#define WARNING( x ) msgPrefix( MT_WARNING, __FILE__, __LINE__, FUNCTION ) << x << msgSuffix;
 
 /// Show an error and exit application
-#define FATAL( x ) { GENERAL_ERR( "Fatal", x << ". Bye!", COL_FATAL ); ::exit( EXIT_FAILURE ); }
+#define FATAL( x ) { msgPrefix( MT_FATAL, __FILE__, __LINE__, FUNCTION ) << x << ". Bye!" << msgSuffix; ::exit( 1 ); }
 
 /// Show an info message
-#define INFO( x ) GENERAL_MSG( "Info", x, COL_INFO )
+#define INFO( x ) msgPrefix( MT_INFO, __FILE__, __LINE__, FUNCTION ) << x << msgSuffix;
 
 /// Reverse assertion
-#ifdef _DEBUG_
+#ifdef DEBUG
 	#define DEBUG_ERR( x ) \
 		if( x ) \
-			GENERAL_ERR( "Debug Err", #x, COL_DEBUG_ERR )
+			msgPrefix( MT_DEBUG_ERR, __FILE__, __LINE__, FUNCTION ) << #x << msgSuffix;
 #else
-    #define DEBUG_ERR( x )
+	#define DEBUG_ERR( x )
 #endif
 
 
 /// code that executes on debug
-#ifdef _DEBUG_
-	#define DEBUG_CODE( x ) {x}
+#ifdef DEBUG
+	#define DEBUG_CODE if( true )
 #else
-	#define DEBUG_CODE( x ) {}
+	#define DEBUG_CODE if( false )
 #endif
 
 
@@ -115,8 +96,8 @@ extern string getFunctionFromPrettyFunction( const char* pretty_function );
  * Read write property
  *
  * - It creates a unique type so it can work with pointers
- * - The get funcs are coming into two flavors, one const and one non-const. The property is read-write after all so the non-const is
- *   acceptable
+ * - The get funcs are coming into two flavors, one const and one non-const. The property is read-write after all so the
+ *   non-const is acceptable
  * - Dont use it with semicolon at the end (eg PROPERTY_RW( .... );) because of a doxygen bug
  */
 #define PROPERTY_RW( __Type__, __varName__, __setFunc__, __getFunc__ ) \
@@ -158,9 +139,9 @@ extern string getFunctionFromPrettyFunction( const char* pretty_function );
 #define BUFFER_OFFSET( i ) ((char *)NULL + (i))
 
 
-//=====================================================================================================================================
-// memZero                                                                                                                            =
-//=====================================================================================================================================
+//======================================================================================================================
+// memZero                                                                                                             =
+//======================================================================================================================
 /// sets memory to zero
 template <typename Type> inline void memZero( Type& t )
 {
@@ -168,9 +149,9 @@ template <typename Type> inline void memZero( Type& t )
 }
 
 
-//=====================================================================================================================================
-// Vec                                                                                                                                =
-//=====================================================================================================================================
+//======================================================================================================================
+// Vec                                                                                                                 =
+//======================================================================================================================
 /**
  * This is a wrapper of std::vector that adds new functionality
  */
@@ -200,9 +181,9 @@ template<typename Type> class Vec: public vector<Type>
 };
 
 
-//=====================================================================================================================================
-// Memory allocation information for Linux                                                                                            =
-//=====================================================================================================================================
+//======================================================================================================================
+// Memory allocation information for Linux                                                                             =
+//======================================================================================================================
 #if defined( _PLATFORM_LINUX_ )
 
 #include <malloc.h>
@@ -235,9 +216,9 @@ inline void printMallInfoDiff( const Mallinfo& prev, const Mallinfo& now )
 #endif
 
 
-//=====================================================================================================================================
-// Application                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// Application                                                                                                         =
+//======================================================================================================================
 /**
  * The only public variable @see App
  */

+ 7 - 7
src/Util/Input.cpp

@@ -7,9 +7,9 @@ namespace I {
 
 
 
-//=====================================================================================================================================
-// VARS                                                                                                                               =
-//=====================================================================================================================================
+//======================================================================================================================
+// VARS                                                                                                                =
+//======================================================================================================================
 Vec<short> keys( SDL_NUM_SCANCODES, 0 );
 Vec<short> mouseBtns( 8, 0 );
 Vec2 mousePosNdc;
@@ -20,9 +20,9 @@ bool warpMouse = false;
 bool hideCursor = true;
 
 
-//=====================================================================================================================================
-// reset                                                                                                                              =
-//=====================================================================================================================================
+//======================================================================================================================
+// reset                                                                                                               =
+//======================================================================================================================
 void reset( void )
 {
 	DEBUG_ERR( keys.size() < 1 );
@@ -36,7 +36,7 @@ void reset( void )
 
 /*
 =======================================================================================================================================
-handleEvents                                                                                                                          =
+handleEvents                                                                                                           =
 =======================================================================================================================================
 */
 void handleEvents()

+ 6 - 6
src/Util/Tokenizer/Parser.h

@@ -10,9 +10,9 @@
 namespace Parser {
 
 
-//=====================================================================================================================================
-// Parser macros                                                                                                                      =
-//=====================================================================================================================================
+//======================================================================================================================
+// Parser macros                                                                                                       =
+//======================================================================================================================
 #define PARSE_ERR(x) ERROR( "Parse Error (" << scanner.getScriptName() << ':' << scanner.getLineNumber() << "): " << x )
 #define PARSE_WARN(x) WARNING( "Parse Warning (" << scanner.getScriptName() << ':' << scanner.getLineNumber() << "): " << x )
 
@@ -21,9 +21,9 @@ namespace Parser {
 #define PARSE_ERR_UNEXPECTED() PARSE_ERR( "Unexpected token " << Scanner::getTokenInfo(scanner.getCrntToken()) );
 
 
-//=====================================================================================================================================
-// parseArrOfNumbers                                                                                                                  =
-//=====================================================================================================================================
+//======================================================================================================================
+// parseArrOfNumbers                                                                                                   =
+//======================================================================================================================
 /**
  * This template func is used for a common operation of parsing arrays of numbers
  *

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

@@ -10,9 +10,9 @@
 #define SERROR(x) ERROR( "Scanning Error (" << scriptName << ':' << lineNmbr << "): " << x )
 
 
-//=====================================================================================================================================
-// Constructor                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// Constructor                                                                                                         =
+//======================================================================================================================
 Scanner::Token::Token( const Token& b ): code(b.code), dataType(b.dataType)
 {
 	switch( b.dataType )
@@ -34,15 +34,15 @@ Scanner::Token::Token( const Token& b ): code(b.code), dataType(b.dataType)
 }
 
 
-//=====================================================================================================================================
-// data vars                                                                                                                          =
-//=====================================================================================================================================
+//======================================================================================================================
+// data vars                                                                                                           =
+//======================================================================================================================
 char Scanner::eofChar = 0x7F;
 
 
-//=====================================================================================================================================
-// reserved words grouped by length                                                                                                   =
-//=====================================================================================================================================
+//======================================================================================================================
+// reserved words grouped by length                                                                                    =
+//======================================================================================================================
 Scanner::ResWord Scanner::rw2 [] =
 {
 	{"ke", TC_KE}, {NULL, TC_ERROR}
@@ -79,9 +79,9 @@ Scanner::ResWord* Scanner::rwTable [] =  // reserved word table
 };
 
 
-//=====================================================================================================================================
-// ascii map                                                                                                                          =
-//=====================================================================================================================================
+//======================================================================================================================
+// ascii map                                                                                                           =
+//======================================================================================================================
 Scanner::AsciiFlag Scanner::asciiLookupTable [128] = {AC_ERROR};
 
 void Scanner::initAsciiMap()
@@ -109,9 +109,9 @@ void Scanner::initAsciiMap()
 }
 
 
-//=====================================================================================================================================
-// Constructor                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// Constructor                                                                                                         =
+//======================================================================================================================
 Scanner::Scanner( bool newlinesAsWhitespace_ ):
 	newlinesAsWhitespace(newlinesAsWhitespace_), commentedLines(0), inStream(NULL)
 {
@@ -123,9 +123,9 @@ Scanner::Scanner( bool newlinesAsWhitespace_ ):
 }
 
 
-//=====================================================================================================================================
-// getLine                                                                                                                            =
-//=====================================================================================================================================
+//======================================================================================================================
+// getLine                                                                                                             =
+//======================================================================================================================
 void Scanner::getLine()
 {
 	if( !inStream->getline( line, MAX_SCRIPT_LINE_LEN - 1, '\n' ) )
@@ -140,9 +140,9 @@ void Scanner::getLine()
 }
 
 
-//=====================================================================================================================================
-// getNextChar                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// getNextChar                                                                                                         =
+//======================================================================================================================
 char Scanner::getNextChar()
 {
 	if( *pchar=='\0' )
@@ -154,9 +154,9 @@ char Scanner::getNextChar()
 }
 
 
-//=====================================================================================================================================
-// putBackChar                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// putBackChar                                                                                                         =
+//======================================================================================================================
 char Scanner::putBackChar()
 {
 	if( pchar != line && *pchar != eofChar )
@@ -166,9 +166,9 @@ char Scanner::putBackChar()
 }
 
 
-//=====================================================================================================================================
-// getTokenInfo                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// getTokenInfo                                                                                                        =
+//======================================================================================================================
 string Scanner::getTokenInfo( const Token& token )
 {
 	char tokenInfoStr[256];
@@ -209,18 +209,18 @@ string Scanner::getTokenInfo( const Token& token )
 }
 
 
-//=====================================================================================================================================
-// printTokenInfo                                                                                                                     =
-//=====================================================================================================================================
+//======================================================================================================================
+// printTokenInfo                                                                                                      =
+//======================================================================================================================
 void Scanner::printTokenInfo( const Token& token )
 {
 	cout << "Token: " << getTokenInfo(token) << endl;
 }
 
 
-//=====================================================================================================================================
-// getAllPrintAll                                                                                                                     =
-//=====================================================================================================================================
+//======================================================================================================================
+// getAllPrintAll                                                                                                      =
+//======================================================================================================================
 void Scanner::getAllPrintAll()
 {
 	do
@@ -231,9 +231,9 @@ void Scanner::getAllPrintAll()
 }
 
 
-//=====================================================================================================================================
-// loadFile                                                                                                                           =
-//=====================================================================================================================================
+//======================================================================================================================
+// loadFile                                                                                                            =
+//======================================================================================================================
 bool Scanner::loadFile( const char* filename_ )
 {	
 	inFstream.open( filename_ );
@@ -247,9 +247,9 @@ bool Scanner::loadFile( const char* filename_ )
 }
 
 
-//=====================================================================================================================================
-// loadIstream                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// loadIstream                                                                                                        =
+//======================================================================================================================
 bool Scanner::loadIstream( istream& istream_, const char* scriptName_ )
 {
 	if( inStream != NULL )
@@ -272,18 +272,18 @@ bool Scanner::loadIstream( istream& istream_, const char* scriptName_ )
 }
 
 
-//=====================================================================================================================================
-// unload                                                                                                                             =
-//=====================================================================================================================================
+//======================================================================================================================
+// unload                                                                                                              =
+//======================================================================================================================
 void Scanner::unload()
 {
 	inFstream.close();
 }
 
 
-//=====================================================================================================================================
-// getNextToken                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// getNextToken                                                                                                        =
+//======================================================================================================================
 const Scanner::Token& Scanner::getNextToken()
 {
 	start:
@@ -362,13 +362,13 @@ const Scanner::Token& Scanner::getNextToken()
 
 /*
 =======================================================================================================================================
-CHECKERS (bellow only checkers)                                                                                                       =
+CHECKERS (bellow only checkers)                                                                                        =
 =======================================================================================================================================
 */
 
-//=====================================================================================================================================
-// checkWord                                                                                                                          =
-//=====================================================================================================================================
+//======================================================================================================================
+// checkWord                                                                                                           =
+//======================================================================================================================
 bool Scanner::checkWord()
 {
 	char* tmpStr = crntToken.asString;
@@ -409,9 +409,9 @@ bool Scanner::checkWord()
 }
 
 
-//=====================================================================================================================================
-// checkComment                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// checkComment                                                                                                        =
+//======================================================================================================================
 bool Scanner::checkComment()
 {
 	// begining
@@ -455,9 +455,9 @@ bool Scanner::checkComment()
 }
 
 
-//=====================================================================================================================================
-// checkNumber                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// checkNumber                                                                                                         =
+//======================================================================================================================
 bool Scanner::checkNumber()
 {
 	//DEBUG_ERR( sizeof(long) != 8 ); // ulong must be 64bit
@@ -703,9 +703,9 @@ bool Scanner::checkNumber()
 }
 
 
-//=====================================================================================================================================
-// checkString                                                                                                                        =
-//=====================================================================================================================================
+//======================================================================================================================
+// checkString                                                                                                         =
+//======================================================================================================================
 bool Scanner::checkString()
 {
 	char* tmpStr = crntToken.asString;
@@ -772,9 +772,9 @@ bool Scanner::checkString()
 }
 
 
-//=====================================================================================================================================
-// checkChar                                                                                                                          =
-//=====================================================================================================================================
+//======================================================================================================================
+// checkChar                                                                                                           =
+//======================================================================================================================
 bool Scanner::checkChar()
 {
 	char ch = getNextChar();
@@ -842,9 +842,9 @@ bool Scanner::checkChar()
 }
 
 
-//=====================================================================================================================================
-// checkSpecial                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// checkSpecial                                                                                                        =
+//======================================================================================================================
 bool Scanner::checkSpecial()
 {
 	char ch = *pchar;

+ 6 - 6
src/Util/Tokenizer/Scanner.h

@@ -14,7 +14,7 @@
 class Scanner
 {
 	//===================================================================================================================================
-	// private stuff                                                                                                                    =
+	// private stuff                                                                                                     =
 	//===================================================================================================================================
 	protected:
 		static const int MAX_SCRIPT_LINE_LEN = 1024; ///< The max allowed length of a script line
@@ -34,7 +34,7 @@ class Scanner
 		char putBackChar(); ///< Put the char that Scanner::GetNextChar got back to the current line
 
 	//===================================================================================================================================
-	// ascii stuff                                                                                                                      =
+	// ascii stuff                                                                                                       =
 	//===================================================================================================================================
 	protected:
 		/**
@@ -64,7 +64,7 @@ class Scanner
 
 		
 	//===================================================================================================================================
-	// Token and token info                                                                                                             =
+	// Token and token info                                                                                              =
 	//===================================================================================================================================
 	public:
 		/// The TokenCode is an enum that defines the Token type
@@ -146,7 +146,7 @@ class Scanner
 		}; // end class Token
 
 	//===================================================================================================================================
-	// reserved words                                                                                                                   =
+	// reserved words                                                                                                    =
 	//===================================================================================================================================
 	protected:
 		/// Reserved words like "int" "const" etc. Currently the reserved words list is being populated with dummy data
@@ -160,7 +160,7 @@ class Scanner
 		static ResWord* rwTable []; ///< The array contains all the groups of ResWord
 
 	//===================================================================================================================================
-	// vars                                                                                                                            =
+	// vars                                                                                                             =
 	//===================================================================================================================================
 	protected:
 		Token crntToken; ///< The current token
@@ -180,7 +180,7 @@ class Scanner
 		char      scriptName[512]; ///< The name of the input stream. Mostly used for the error messages inside the @ref Scanner
 
 	//===================================================================================================================================
-	// public funcs                                                                                                                     =
+	// public funcs                                                                                                      =
 	//===================================================================================================================================
 	public:
 		/**

+ 27 - 27
src/Util/Util.cpp

@@ -4,9 +4,9 @@
 
 namespace Util {
 
-//=====================================================================================================================================
-// randRange                                                                                                                          =
-//=====================================================================================================================================
+//======================================================================================================================
+// randRange                                                                                                           =
+//======================================================================================================================
 int randRange( int min, int max )
 {
 	return (rand() % (max-min+1)) + min ;
@@ -30,9 +30,9 @@ double randRange( double min, double max )
 }
 
 
-//=====================================================================================================================================
-// readFile                                                                                                                           =
-//=====================================================================================================================================
+//======================================================================================================================
+// readFile                                                                                                            =
+//======================================================================================================================
 string readFile( const char* filename )
 {
 	ifstream file( filename );
@@ -46,9 +46,9 @@ string readFile( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// getFileLines                                                                                                                       =
-//=====================================================================================================================================
+//======================================================================================================================
+// getFileLines                                                                                                        =
+//======================================================================================================================
 Vec<string> getFileLines( const char* filename )
 {
 	Vec<string> lines;
@@ -68,9 +68,9 @@ Vec<string> getFileLines( const char* filename )
 }
 
 
-//=====================================================================================================================================
-// cutPath                                                                                                                            =
-//=====================================================================================================================================
+//======================================================================================================================
+// cutPath                                                                                                             =
+//======================================================================================================================
 char* cutPath( const char* path )
 {
 	char* str = (char*)path + strlen(path) - 1;
@@ -83,9 +83,9 @@ char* cutPath( const char* path )
 }
 
 
-//=====================================================================================================================================
-// getPath                                                                                                                            =
-//=====================================================================================================================================
+//======================================================================================================================
+// getPath                                                                                                             =
+//======================================================================================================================
 string getPath( const char* path )
 {
 	char* str = (char*)path + strlen(path) - 1;
@@ -103,9 +103,9 @@ string getPath( const char* path )
 }
 
 
-//=====================================================================================================================================
-// getFunctionFromPrettyFunction                                                                                                      =
-//=====================================================================================================================================
+//======================================================================================================================
+// getFunctionFromPrettyFunction                                                                                       =
+//======================================================================================================================
 string getFunctionFromPrettyFunction( const char* prettyFunction )
 {
 	string ret( prettyFunction );
@@ -123,9 +123,9 @@ string getFunctionFromPrettyFunction( const char* prettyFunction )
 }
 
 
-//=====================================================================================================================================
-// getFileExtension                                                                                                                   =
-//=====================================================================================================================================
+//======================================================================================================================
+// getFileExtension                                                                                                    =
+//======================================================================================================================
 string getFileExtension( const char* path )
 {
 	char* str = (char*)path + strlen(path) - 1;
@@ -142,9 +142,9 @@ string getFileExtension( const char* path )
 }
 
 
-//=====================================================================================================================================
-// intToStr                                                                                                                           =
-//=====================================================================================================================================
+//======================================================================================================================
+// intToStr                                                                                                            =
+//======================================================================================================================
 string intToStr( int i )
 {
 	char str [256];
@@ -177,9 +177,9 @@ string intToStr( int i )
 }
 
 
-//=====================================================================================================================================
-// floatToStr                                                                                                                         =
-//=====================================================================================================================================
+//======================================================================================================================
+// floatToStr                                                                                                          =
+//======================================================================================================================
 string floatToStr( float f )
 {
 	char tmp [128];

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.