Procházet zdrojové kódy

Removing namespaces

Panagiotis Christopoulos Charitos před 14 roky
rodič
revize
a3f20deb83
100 změnil soubory, kde provedl 298 přidání a 698 odebrání
  1. 1 1
      build/genmakefiledbg
  2. 16 16
      src/Main.cpp
  3. 2 2
      src/cln/Collision.h
  4. 2 9
      src/cln/CollisionShape.h
  5. 0 6
      src/cln/LineSegment.cpp
  6. 2 8
      src/cln/LineSegment.h
  7. 0 6
      src/cln/Obb.cpp
  8. 2 8
      src/cln/Obb.h
  9. 0 6
      src/cln/Obb.inl.h
  10. 0 6
      src/cln/Plane.cpp
  11. 2 8
      src/cln/Plane.h
  12. 0 6
      src/cln/Ray.cpp
  13. 2 8
      src/cln/Ray.h
  14. 0 5
      src/cln/Sphere.cpp
  15. 2 8
      src/cln/Sphere.h
  16. 0 6
      src/cln/Sphere.inl.h
  17. 1 7
      src/core/Globals.h
  18. 0 6
      src/event/Event.cpp
  19. 2 9
      src/event/Event.h
  20. 4 9
      src/event/EventManager.cpp
  21. 4 10
      src/event/EventManager.h
  22. 2 8
      src/event/EventManager.inl.h
  23. 16 16
      src/event/MainRendererPpsHdrEvent.cpp
  24. 6 12
      src/event/MainRendererPpsHdrEvent.h
  25. 5 11
      src/event/SceneColorEvent.cpp
  26. 7 12
      src/event/SceneColorEvent.h
  27. 0 6
      src/gl/BufferObject.cpp
  28. 2 9
      src/gl/BufferObject.h
  29. 0 6
      src/gl/Fbo.cpp
  30. 2 8
      src/gl/Fbo.h
  31. 0 6
      src/gl/TimeQuery.cpp
  32. 2 8
      src/gl/TimeQuery.h
  33. 0 6
      src/gl/Vao.cpp
  34. 2 10
      src/gl/Vao.h
  35. 2 8
      src/gl/Vbo.h
  36. 0 6
      src/r/Bl.cpp
  37. 5 11
      src/r/Bl.h
  38. 0 6
      src/r/Bs.cpp
  39. 4 10
      src/r/Bs.h
  40. 3 9
      src/r/CollisionDbgDrawer.cpp
  41. 5 13
      src/r/CollisionDbgDrawer.h
  42. 0 6
      src/r/Dbg.cpp
  43. 6 12
      src/r/Dbg.h
  44. 0 6
      src/r/Deformer.cpp
  45. 0 6
      src/r/Deformer.h
  46. 0 6
      src/r/Ez.cpp
  47. 3 9
      src/r/Ez.h
  48. 1 7
      src/r/Hdr.cpp
  49. 6 12
      src/r/Hdr.h
  50. 2 8
      src/r/Is.cpp
  51. 5 11
      src/r/Is.h
  52. 1 7
      src/r/MainRenderer.cpp
  53. 3 9
      src/r/MainRenderer.h
  54. 0 6
      src/r/Ms.cpp
  55. 3 9
      src/r/Ms.h
  56. 0 6
      src/r/PhysDbgDrawer.cpp
  57. 2 8
      src/r/PhysDbgDrawer.h
  58. 0 6
      src/r/Pps.cpp
  59. 4 10
      src/r/Pps.h
  60. 4 10
      src/r/Renderer.cpp
  61. 6 12
      src/r/Renderer.h
  62. 2 8
      src/r/RendererInitializer.h
  63. 2 8
      src/r/RenderingPass.h
  64. 0 6
      src/r/SceneDbgDrawer.cpp
  65. 2 8
      src/r/SceneDbgDrawer.h
  66. 0 6
      src/r/SceneDrawer.cpp
  67. 2 8
      src/r/SceneDrawer.h
  68. 0 6
      src/r/Sm.cpp
  69. 3 9
      src/r/Sm.h
  70. 1 7
      src/r/Smo.cpp
  71. 3 9
      src/r/Smo.h
  72. 1 7
      src/r/Ssao.cpp
  73. 6 12
      src/r/Ssao.h
  74. 4 4
      src/rsrc/Mesh.h
  75. 2 2
      src/rsrc/Model.h
  76. 28 3
      src/rsrc/ShaderProgramPrePreprocessor.cpp
  77. 1 0
      src/rsrc/ShaderProgramPrePreprocessor.h
  78. 2 2
      src/scene/Camera.cpp
  79. 5 5
      src/scene/Camera.h
  80. 2 2
      src/scene/ModelNode.h
  81. 2 2
      src/scene/ModelPatchNode.h
  82. 6 6
      src/scene/OrthographicCamera.cpp
  83. 1 1
      src/scene/PatchNode.cpp
  84. 4 4
      src/scene/PatchNode.h
  85. 6 6
      src/scene/PerspectiveCamera.cpp
  86. 1 3
      src/scene/RenderableNode.h
  87. 1 1
      src/scene/SceneNode.h
  88. 2 2
      src/scene/SkinNode.h
  89. 4 4
      src/scene/SkinPatchNode.h
  90. 1 1
      src/scene/VisibilityTester.cpp
  91. 2 2
      src/script/Engine.cpp
  92. 5 10
      src/script/core/Globals.cpp
  93. 7 0
      src/script/core/Logger.cpp
  94. 17 0
      src/script/event/EventManager.cpp
  95. 0 13
      src/script/event/MainRendererPpsHdr.cpp
  96. 11 0
      src/script/event/MainRendererPpsHdrEvent.cpp
  97. 0 19
      src/script/event/Manager.cpp
  98. 0 13
      src/script/event/SceneColor.cpp
  99. 11 0
      src/script/event/SceneColorEvent.cpp
  100. 0 2
      src/script/r/Bl.cpp

+ 1 - 1
build/genmakefiledbg

@@ -1,2 +1,2 @@
 #!/bin/sh
-cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=clang++ -DBUILD_SHARED_LIBS=ON ..
+cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=`which clang++` -DBUILD_SHARED_LIBS=ON ..

+ 16 - 16
src/Main.cpp

@@ -39,9 +39,9 @@
 #include "core/Globals.h"
 #include "ui/FtFontLoader.h"
 #include "ui/Font.h"
-#include "event/Manager.h"
-#include "event/SceneColor.h"
-#include "event/MainRendererPpsHdr.h"
+#include "event/EventManager.h"
+#include "event/SceneColorEvent.h"
+#include "event/MainRendererPpsHdrEvent.h"
 #include "rsrc/ShaderProgramPrePreprocessor.h"
 #include "rsrc/Material.h"
 #include "core/parallel/Manager.h"
@@ -139,7 +139,7 @@ void init()
 	// camera
 	PerspectiveCamera* cam = new PerspectiveCamera(false, NULL);
 	//cam->setAll(toRad(100.0), toRad(100.0) / r::MainRendererSingleton::get().getAspectRatio(), 0.5, 200.0);
-	cam->setAll(r::MainRendererSingleton::get().getAspectRatio()*toRad(60.0), toRad(60.0), 0.5, 200.0);
+	cam->setAll(MainRendererSingleton::get().getAspectRatio()*toRad(60.0), toRad(60.0), 0.5, 200.0);
 	cam->moveLocalY(3.0);
 	cam->moveLocalZ(5.7);
 	cam->moveLocalX(-0.3);
@@ -384,13 +384,13 @@ void mainLoop()
 		SceneSingleton::get().updateAllWorldStuff(prevUpdateTime, crntTime);
 		SceneSingleton::get().doVisibilityTests(*AppSingleton::get().getActiveCam());
 		SceneSingleton::get().updateAllControllers();
-		event::ManagerSingleton::get().updateAllEvents(prevUpdateTime, crntTime);
-		r::MainRendererSingleton::get().render(*AppSingleton::get().getActiveCam());
+		EventManagerSingleton::get().updateAllEvents(prevUpdateTime, crntTime);
+		MainRendererSingleton::get().render(*AppSingleton::get().getActiveCam());
 
 		painter->setPosition(Vec2(0.0, 0.1));
 		painter->setColor(Vec4(1.0));
 		//painter->drawText("A");
-		const r::MainRenderer& r = r::MainRendererSingleton::get();
+		const MainRenderer& r = MainRendererSingleton::get();
 		std::stringstream ss;
 		ss << "MS: " << r.getMsTime() * 1000000 << " IS: " <<
 			r.getIsTime() * 1000000 << " BS: " << r.getBsTime() * 1000000 <<
@@ -413,7 +413,7 @@ void mainLoop()
 
 		if(InputSingleton::get().getKey(SDL_SCANCODE_F12) == 1)
 		{
-			r::MainRendererSingleton::get().takeScreenshot("gfx/screenshot.jpg");
+			MainRendererSingleton::get().takeScreenshot("gfx/screenshot.jpg");
 		}
 
 		AppSingleton::get().swapBuffers();
@@ -466,7 +466,7 @@ void initSubsystems(int argc, char* argv[])
 	AppSingleton::get().init(argc, argv);
 
 	// Main renderer
-	r::RendererInitializer initializer;
+	RendererInitializer initializer;
 	initializer.ms.ez.enabled = true;
 	initializer.dbg.enabled = true;
 	initializer.is.sm.bilinearEnabled = true;
@@ -487,7 +487,7 @@ void initSubsystems(int argc, char* argv[])
 	initializer.pps.bl.sideBlurFactor = 1.0;
 	initializer.mainRendererQuality = 1.0;
 
-	r::MainRendererSingleton::get().init(initializer);
+	MainRendererSingleton::get().init(initializer);
 
 	// Scripting engine
 	const char* commonPythonCode =
@@ -501,14 +501,15 @@ void initSubsystems(int argc, char* argv[])
 		"        file = sys._getframe(1).f_code.co_filename\n"
 		"        func = sys._getframe(1).f_code.co_name\n"
 		"        LoggerSingleton.get().write(file, line, "
-		"func, str_ + \"\\n\")\n"
+		"func, Logger.MessageType.MT_NORMAL, str_ + \"\\n\")\n"
 		"\n"
 		"class StderrCatcher:\n"
 		"    def write(self, str_):\n"
 		"        line = sys._getframe(1).f_lineno\n"
 		"        file = sys._getframe(1).f_code.co_filename\n"
 		"        func = sys._getframe(1).f_code.co_name\n"
-		"        LoggerSingleton.get().write(file, line, func, str_)\n"
+		"        LoggerSingleton.get().write(file, line, "
+		"func, Logger.MessageType.MT_ERROR, str_)\n"
 		"\n"
 		"sys.stdout = StdoutCatcher()\n"
 		"sys.stderr = StderrCatcher()\n";
@@ -523,7 +524,7 @@ void initSubsystems(int argc, char* argv[])
 
 	// Add drawer to physics
 	SceneSingleton::get().getPhysMasterContainer().setDebugDrawer(
-		new r::PhysDbgDrawer(r::MainRendererSingleton::get().getDbg()));
+		new PhysDbgDrawer(MainRendererSingleton::get().getDbg()));
 }
 
 
@@ -564,14 +565,13 @@ int main(int argc, char* argv[])
 
 	try
 	{
-		ShaderProgramPrePreprocessor p("lala.glsl");
+		/*ShaderProgramPrePreprocessor p("lala.glsl");
 		std::cout << "VERT\n" << p.getShaderSource(ST_VERTEX) << std::endl;
 		std::cout << "TC\n" << p.getShaderSource(ST_TC) << std::endl;
 		std::cout << "TE\n" << p.getShaderSource(ST_TE) << std::endl;
 		std::cout << "GEOM\n" << p.getShaderSource(ST_GEOMETRY) << std::endl;
 		std::cout << "FRAG\n" << p.getShaderSource(ST_FRAGMENT) << std::endl;
-		return 0;
-
+		return 0;*/
 		initSubsystems(argc, argv);
 		init();
 

+ 2 - 2
src/cln/Collision.h

@@ -1,5 +1,5 @@
-#ifndef CLN_COLLISION_H
-#define CLN_COLLISION_H
+#ifndef COLLISION_H
+#define COLLISION_H
 
 #include "Plane.h"
 #include "Sphere.h"

+ 2 - 9
src/cln/CollisionShape.h

@@ -1,9 +1,5 @@
-#ifndef CLN_COLLISION_SHAPE
-#define CLN_COLLISION_SHAPE
-
-
-/// Contains collision detection classes
-namespace cln {
+#ifndef COLLISION_SHAPE
+#define COLLISION_SHAPE
 
 
 class Plane;
@@ -40,7 +36,4 @@ class CollisionShape
 };
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/cln/LineSegment.cpp

@@ -3,9 +3,6 @@
 #include <algorithm>
 
 
-namespace cln {
-
-
 //==============================================================================
 // getTransformed                                                              =
 //==============================================================================
@@ -52,6 +49,3 @@ float LineSegment::testPlane(const Plane& plane) const
 		}
 	}
 }
-
-
-} // end namespace

+ 2 - 8
src/cln/LineSegment.h

@@ -1,14 +1,11 @@
-#ifndef CLN_LINE_SEGMENT_H
-#define CLN_LINE_SEGMENT_H
+#ifndef LINE_SEGMENT_H
+#define LINE_SEGMENT_H
 
 #include "CollisionShape.h"
 #include "m/Math.h"
 #include "util/Accessors.h"
 
 
-namespace cln {
-
-
 class LineSegment: public CollisionShape
 {
 	public:
@@ -53,7 +50,4 @@ inline LineSegment::LineSegment(const LineSegment& b)
 {}
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/cln/Obb.cpp

@@ -2,9 +2,6 @@
 #include "Plane.h"
 
 
-namespace cln {
-
-
 //==============================================================================
 // getTransformed                                                              =
 //==============================================================================
@@ -114,6 +111,3 @@ void Obb::getExtremePoints(boost::array<Vec3, 8>& points) const
 		point += center;
 	}
 }
-
-
-} // end namespace

+ 2 - 8
src/cln/Obb.h

@@ -1,5 +1,5 @@
-#ifndef CLN_OBB_H
-#define CLN_OBB_H
+#ifndef OBB_H
+#define OBB_H
 
 #include "CollisionShape.h"
 #include "m/Math.h"
@@ -7,9 +7,6 @@
 #include <boost/array.hpp>
 
 
-namespace cln {
-
-
 /// Object oriented bounding box
 class Obb: public CollisionShape
 {
@@ -73,9 +70,6 @@ inline Obb::Obb(const Vec3& center_, const Mat3& rotation_,
 {}
 
 
-} // end namespace
-
-
 #include "Obb.inl.h"
 
 

+ 0 - 6
src/cln/Obb.inl.h

@@ -2,9 +2,6 @@
 #include <boost/range/iterator_range.hpp>
 
 
-namespace cln {
-
-
 //==============================================================================
 // set                                                                         =
 //==============================================================================
@@ -38,6 +35,3 @@ void Obb::set(const Container& container)
 	rotation = Mat3::getIdentity();
 	extends = max - center;
 }
-
-
-} // end namespace

+ 0 - 6
src/cln/Plane.cpp

@@ -2,9 +2,6 @@
 #include "util/Assert.h"
 
 
-namespace cln {
-
-
 //==============================================================================
 // setFrom3Points                                                              =
 //==============================================================================
@@ -65,6 +62,3 @@ Plane Plane::getTransformed(const Transform& trf) const
 
 	return plane;
 }
-
-
-} // end namespace

+ 2 - 8
src/cln/Plane.h

@@ -1,14 +1,11 @@
-#ifndef CLN_PLANE_H
-#define CLN_PLANE_H
+#ifndef PLANE_H
+#define PLANE_H
 
 #include "CollisionShape.h"
 #include "m/Math.h"
 #include "util/Accessors.h"
 
 
-namespace cln {
-
-
 /// Plane collision shape
 class Plane: public CollisionShape
 {
@@ -101,7 +98,4 @@ inline Vec3 Plane::getClosestPoint(const Vec3& point) const
 }
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/cln/Ray.cpp

@@ -2,9 +2,6 @@
 #include "Plane.h"
 
 
-namespace cln {
-
-
 //==============================================================================
 // getTransformed                                                              =
 //==============================================================================
@@ -48,6 +45,3 @@ float Ray::testPlane(const Plane& plane) const
 		}
 	}
 }
-
-
-} // end namespace

+ 2 - 8
src/cln/Ray.h

@@ -1,14 +1,11 @@
-#ifndef CLN_RAY_H
-#define CLN_RAY_H
+#ifndef RAY_H
+#define RAY_H
 
 #include "CollisionShape.h"
 #include "m/Math.h"
 #include "util/Accessors.h"
 
 
-namespace cln {
-
-
 class Plane;
 
 
@@ -57,7 +54,4 @@ inline Ray::Ray(const Vec3& origin_, const Vec3& direction_)
 {}
 
 
-} // end namespace
-
-
 #endif

+ 0 - 5
src/cln/Sphere.cpp

@@ -2,9 +2,6 @@
 #include "Plane.h"
 
 
-namespace cln {
-
-
 //==============================================================================
 // getTransformed                                                              =
 //==============================================================================
@@ -95,5 +92,3 @@ float Sphere::testPlane(const Plane& plane) const
 	}
 }
 
-
-} // end namespace

+ 2 - 8
src/cln/Sphere.h

@@ -1,14 +1,11 @@
-#ifndef CLN_SPHERE_H
-#define CLN_SPHERE_H
+#ifndef SPHERE_H
+#define SPHERE_H
 
 #include "CollisionShape.h"
 #include "m/Math.h"
 #include "util/Accessors.h"
 
 
-namespace cln {
-
-
 class Plane;
 
 
@@ -64,9 +61,6 @@ inline Sphere::Sphere(const Vec3& center_, float radius_)
 {}
 
 
-} // end namespace
-
-
 #include "Sphere.inl.h"
 
 

+ 0 - 6
src/cln/Sphere.inl.h

@@ -3,9 +3,6 @@
 #include "util/Assert.h"
 
 
-namespace cln {
-
-
 //==============================================================================
 // set                                                                         =
 //==============================================================================
@@ -51,6 +48,3 @@ void Sphere::set(const Container& container)
 
 	radius = m::sqrt(maxDist);
 }
-
-
-} // end namespace

+ 1 - 7
src/core/Globals.h

@@ -5,11 +5,7 @@
 
 
 typedef Singleton<class Logger> LoggerSingleton;
-
-namespace r {
 typedef Singleton<class MainRenderer> MainRendererSingleton;
-}
-
 typedef Singleton<class Input> InputSingleton;
 typedef Singleton<class ResourceManager> ResourceManagerSingleton;
 typedef Singleton<class Scene> SceneSingleton;
@@ -21,9 +17,7 @@ namespace script {
 typedef Singleton<class Engine> EngineSingleton;
 }
 
-namespace event {
-typedef Singleton<class Manager> ManagerSingleton;
-}
+typedef Singleton<class EventManager> EventManagerSingleton;
 
 namespace parallel {
 typedef Singleton<class Manager> ManagerSingleton;

+ 0 - 6
src/event/Event.cpp

@@ -2,9 +2,6 @@
 #include "util/Assert.h"
 
 
-namespace event {
-
-
 //==============================================================================
 // Constructor                                                                 =
 //==============================================================================
@@ -40,6 +37,3 @@ void Event::update(float prevUpdateTime, float crntTime)
 		updateSp(prevUpdateTime, crntTime);
 	}
 }
-
-
-} // end namespace

+ 2 - 9
src/event/Event.h

@@ -1,14 +1,10 @@
-#ifndef EVENT_EVENT_H
-#define EVENT_EVENT_H
+#ifndef EVENT_H
+#define EVENT_H
 
 #include "util/StdTypes.h"
 #include "util/Accessors.h"
 
 
-/// Events namespace
-namespace event {
-
-
 /// The event type enum
 enum EventType
 {
@@ -75,7 +71,4 @@ Type Event::interpolate(const Type& from, const Type& to, float delta)
 }
 
 
-} // end namespace
-
-
 #endif

+ 4 - 9
src/event/Manager.cpp → src/event/EventManager.cpp

@@ -1,14 +1,11 @@
-#include "Manager.h"
+#include "EventManager.h"
 #include <boost/foreach.hpp>
 
 
-namespace event {
-
-
 //==============================================================================
 // updateAllEvents                                                             =
 //==============================================================================
-void Manager::updateAllEvents(float prevUpdateTime_, float crntTime_)
+void EventManager::updateAllEvents(float prevUpdateTime_, float crntTime_)
 {
 	prevUpdateTime = prevUpdateTime_;
 	crntTime = crntTime_;
@@ -26,7 +23,8 @@ void Manager::updateAllEvents(float prevUpdateTime_, float crntTime_)
 //==============================================================================
 // findADeadEvent                                                              =
 //==============================================================================
-Manager::EventsContainer::iterator Manager::findADeadEvent(EventType type)
+EventManager::EventsContainer::iterator EventManager::findADeadEvent(
+	EventType type)
 {
 	EventsContainer::iterator it = events.begin();
 
@@ -41,6 +39,3 @@ Manager::EventsContainer::iterator Manager::findADeadEvent(EventType type)
 
 	return it;
 }
-
-
-} // end namespace

+ 4 - 10
src/event/Manager.h → src/event/EventManager.h

@@ -1,15 +1,12 @@
-#ifndef EVENT_MANAGER_H
-#define EVENT_MANAGER_H
+#ifndef MANAGER_H
+#define MANAGER_H
 
 #include "Event.h"
 #include <boost/ptr_container/ptr_deque.hpp>
 
 
-namespace event {
-
-
 /// This manager creates the events ands keeps tracks of them
-class Manager
+class EventManager
 {
 	public:
 		typedef boost::ptr_deque<Event> EventsContainer;
@@ -36,10 +33,7 @@ class Manager
 };
 
 
-} // end namespace
-
-
-#include "Manager.inl.h"
+#include "EventManager.inl.h"
 
 
 #endif

+ 2 - 8
src/event/Manager.inl.h → src/event/EventManager.inl.h

@@ -1,14 +1,11 @@
-#include "Manager.h"
-
-
-namespace event {
+#include "EventManager.h"
 
 
 //==============================================================================
 //  createEvent                                                                =
 //==============================================================================
 template<typename EventType>
-EventType& Manager::createEvent(const EventType& event)
+EventType& EventManager::createEvent(const EventType& event)
 {
 	EventsContainer::iterator it = findADeadEvent(event.getEventType());
 	EventType* ev;
@@ -26,6 +23,3 @@ EventType& Manager::createEvent(const EventType& event)
 
 	return *ev;
 }
-
-
-} // end namespace

+ 16 - 16
src/event/MainRendererPpsHdr.cpp → src/event/MainRendererPpsHdrEvent.cpp

@@ -1,24 +1,24 @@
-#include "MainRendererPpsHdr.h"
+#include "MainRendererPpsHdrEvent.h"
 #include "r/MainRenderer.h"
 #include "core/Globals.h"
 
 
-namespace event {
-
-
 //==============================================================================
 // Constructor                                                                 =
 //==============================================================================
-MainRendererPpsHdr::MainRendererPpsHdr(float startTime, float duration,
-	float exposure_, uint blurringIterationsNum_, float blurringDist_)
+MainRendererPpsHdrEvent::MainRendererPpsHdrEvent(float startTime,
+	float duration,
+	float exposure_,
+	uint blurringIterationsNum_,
+	float blurringDist_)
 :	Event(MAIN_RENDERER_PPS_HDR, startTime, duration)
 {
 	finalData.exposure = exposure_;
 	finalData.blurringIterationsNum = blurringIterationsNum_;
 	finalData.blurringDist = blurringDist_;
 
-	const r::Hdr& hdr =
-		r::MainRendererSingleton::get().getPps().getHdr();
+	const Hdr& hdr =
+		MainRendererSingleton::get().getPps().getHdr();
 	originalData.exposure = hdr.getExposure();
 	originalData.blurringIterationsNum = hdr.getBlurringIterationsNum();
 	originalData.blurringDist = hdr.getBlurringDist();
@@ -28,7 +28,8 @@ MainRendererPpsHdr::MainRendererPpsHdr(float startTime, float duration,
 //==============================================================================
 // Copy constructor                                                            =
 //==============================================================================
-MainRendererPpsHdr::MainRendererPpsHdr(const MainRendererPpsHdr& b)
+MainRendererPpsHdrEvent::MainRendererPpsHdrEvent(
+	const MainRendererPpsHdrEvent& b)
 :	Event(MAIN_RENDERER_PPS_HDR, 0.0, 0.0)
 {
 	*this = b;
@@ -38,7 +39,8 @@ MainRendererPpsHdr::MainRendererPpsHdr(const MainRendererPpsHdr& b)
 //==============================================================================
 // operator=                                                                   =
 //==============================================================================
-MainRendererPpsHdr& MainRendererPpsHdr::operator=(const MainRendererPpsHdr& b)
+MainRendererPpsHdrEvent& MainRendererPpsHdrEvent::operator=(
+	const MainRendererPpsHdrEvent& b)
 {
 	Event::operator=(b);
 	finalData = b.finalData;
@@ -50,21 +52,19 @@ MainRendererPpsHdr& MainRendererPpsHdr::operator=(const MainRendererPpsHdr& b)
 //==============================================================================
 // updateSp                                                                    =
 //==============================================================================
-void MainRendererPpsHdr::updateSp(float /*prevUpdateTime*/, float crntTime)
+void MainRendererPpsHdrEvent::updateSp(float /*prevUpdateTime*/, float crntTime)
 {
 	float d = crntTime - getStartTime(); // delta
 	float dp = d / getDuration(); // delta as percentage
 
-	r::Hdr& hdr = r::MainRendererSingleton::get().getPps().getHdr();
+	Hdr& hdr = MainRendererSingleton::get().getPps().getHdr();
 
 	hdr.setExposure(interpolate(originalData.exposure, finalData.exposure, dp));
 
-	hdr.setBlurringIterationsNum(interpolate(originalData.blurringIterationsNum,
+	hdr.setBlurringIterationsNum(
+		interpolate(originalData.blurringIterationsNum,
 		finalData.blurringIterationsNum, dp));
 
 	hdr.setBlurringDist(interpolate(originalData.blurringDist,
 		finalData.blurringDist, dp));
 }
-
-
-} // end namespace

+ 6 - 12
src/event/MainRendererPpsHdr.h → src/event/MainRendererPpsHdrEvent.h

@@ -1,25 +1,22 @@
-#ifndef EVENT_MAIN_RENDERER_PPS_HDR_H
-#define EVENT_MAIN_RENDERER_PPS_HDR_H
+#ifndef MAIN_RENDERER_PPS_HDR_EVENT_H
+#define MAIN_RENDERER_PPS_HDR_EVENT_H
 
 #include "Event.h"
 
 
-namespace event {
-
-
 /// Change the HDR properties
-class MainRendererPpsHdr: public Event
+class MainRendererPpsHdrEvent: public Event
 {
 	public:
 		/// Constructor
-		MainRendererPpsHdr(float startTime, float duration,
+		MainRendererPpsHdrEvent(float startTime, float duration,
 			float exposure, uint blurringIterationsNum, float blurringDist);
 
 		/// Copy constructor
-		MainRendererPpsHdr(const MainRendererPpsHdr& b);
+		MainRendererPpsHdrEvent(const MainRendererPpsHdrEvent& b);
 
 		/// Copy
-		MainRendererPpsHdr& operator=(const MainRendererPpsHdr& b);
+		MainRendererPpsHdrEvent& operator=(const MainRendererPpsHdrEvent& b);
 
 	private:
 		struct Data
@@ -37,7 +34,4 @@ class MainRendererPpsHdr: public Event
 };
 
 
-} // end namespace
-
-
 #endif

+ 5 - 11
src/event/SceneColor.cpp → src/event/SceneColorEvent.cpp

@@ -1,16 +1,13 @@
-#include "SceneColor.h"
+#include "SceneColorEvent.h"
 #include "scene/Scene.h"
 #include "core/Globals.h"
 #include "core/Logger.h"
 
 
-namespace event {
-
-
 //==============================================================================
 // Constructor                                                                 =
 //==============================================================================
-SceneColor::SceneColor(float startTime, float duration,
+SceneColorEvent::SceneColorEvent(float startTime, float duration,
 	const Vec3& finalColor_)
 :	Event(SCENE_COLOR, startTime, duration),
 	finalColor(finalColor_)
@@ -22,7 +19,7 @@ SceneColor::SceneColor(float startTime, float duration,
 //==============================================================================
 // Constructor copy                                                            =
 //==============================================================================
-SceneColor::SceneColor(const SceneColor& b)
+SceneColorEvent::SceneColorEvent(const SceneColorEvent& b)
 :	Event(SCENE_COLOR, 0.0, 0.0)
 {
 	*this = b;
@@ -32,7 +29,7 @@ SceneColor::SceneColor(const SceneColor& b)
 //==============================================================================
 // operator=                                                                   =
 //==============================================================================
-SceneColor& SceneColor::operator=(const SceneColor& b)
+SceneColorEvent& SceneColorEvent::operator=(const SceneColorEvent& b)
 {
 	Event::operator=(b);
 	originalColor = b.originalColor;
@@ -44,7 +41,7 @@ SceneColor& SceneColor::operator=(const SceneColor& b)
 //==============================================================================
 // updateSp                                                                    =
 //==============================================================================
-void SceneColor::updateSp(float /*prevUpdateTime*/, float crntTime)
+void SceneColorEvent::updateSp(float /*prevUpdateTime*/, float crntTime)
 {
 	float d = crntTime - getStartTime(); // delta
 	float dp = d / float(getDuration()); // delta as persentage
@@ -52,6 +49,3 @@ void SceneColor::updateSp(float /*prevUpdateTime*/, float crntTime)
 	SceneSingleton::get().setAmbientColor(
 		interpolate(originalColor, finalColor, dp));
 }
-
-
-} // end namespace

+ 7 - 12
src/event/SceneColor.h → src/event/SceneColorEvent.h

@@ -1,25 +1,23 @@
-#ifndef EVENT_SCENE_COLOR_H
-#define EVENT_SCENE_COLOR_H
+#ifndef SCENE_COLOR_EVENT_H
+#define SCENE_COLOR_EVENT_H
 
 #include "Event.h"
 #include "m/Math.h"
 
 
-namespace event {
-
-
 /// Change the scene color
-class SceneColor: public Event
+class SceneColorEvent: public Event
 {
 	public:
 		/// Constructor
-		SceneColor(float startTime, float duration, const Vec3& finalColor);
+		SceneColorEvent(float startTime, float duration,
+			const Vec3& finalColor);
 
 		/// Copy constructor
-		SceneColor(const SceneColor& b);
+		SceneColorEvent(const SceneColorEvent& b);
 
 		/// Copy
-		SceneColor& operator=(const SceneColor& b);
+		SceneColorEvent& operator=(const SceneColorEvent& b);
 
 	private:
 		Vec3 originalColor; ///< Original scene color. The constructor sets it
@@ -30,7 +28,4 @@ class SceneColor: public Event
 };
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/gl/BufferObject.cpp

@@ -4,9 +4,6 @@
 #include "util/Exception.h"
 
 
-namespace gl {
-
-
 //==============================================================================
 // Destructor                                                                  =
 //==============================================================================
@@ -85,6 +82,3 @@ void BufferObject::write(void* buff, size_t offset, size_t size)
 	glUnmapBuffer(target);
 	unbind();
 }
-
-
-} // end namespace

+ 2 - 9
src/gl/BufferObject.h

@@ -1,15 +1,11 @@
-#ifndef GL_BUFFER_OBJECT_H
-#define GL_BUFFER_OBJECT_H
+#ifndef BUFFER_OBJECT_H
+#define BUFFER_OBJECT_H
 
 #include <GL/glew.h>
 #include "util/Assert.h"
 #include "util/StdTypes.h"
 
 
-/// Contains OpenGL wrappers
-namespace gl {
-
-
 /// A wrapper for OpenGL buffer objects (vertex arrays, texture buffers etc)
 /// to prevent us from making idiotic errors
 class BufferObject
@@ -145,7 +141,4 @@ inline void BufferObject::deleteBuff()
 }
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/gl/Fbo.cpp

@@ -2,9 +2,6 @@
 #include <boost/lexical_cast.hpp>
 
 
-namespace gl {
-
-
 //==============================================================================
 // Destructor                                                                  =
 //==============================================================================
@@ -70,6 +67,3 @@ uint Fbo::getCurrentFbo()
 	glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fboGlId);
 	return (uint)fboGlId;
 }
-
-
-} // end namespace

+ 2 - 8
src/gl/Fbo.h

@@ -1,5 +1,5 @@
-#ifndef GL_FBO_H
-#define GL_FBO_H
+#ifndef FBO_H
+#define FBO_H
 
 #include <GL/glew.h>
 #include "util/Assert.h"
@@ -7,9 +7,6 @@
 #include "util/Exception.h"
 
 
-namespace gl {
-
-
 /// The class is actually a wrapper to avoid common mistakes
 class Fbo
 {
@@ -95,7 +92,4 @@ inline void Fbo::destroy()
 }
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/gl/TimeQuery.cpp

@@ -3,9 +3,6 @@
 #include "GlException.h"
 
 
-namespace gl {
-
-
 //==============================================================================
 // Constructor                                                                 =
 //==============================================================================
@@ -64,6 +61,3 @@ double TimeQuery::end()
 
 	return (timerEnd - timerStart) / 1000000000.0;
 }
-
-
-} // end namespace

+ 2 - 8
src/gl/TimeQuery.h

@@ -1,13 +1,10 @@
-#ifndef GL_TIME_QUERY_H
-#define GL_TIME_QUERY_H
+#ifndef TIME_QUERY_H
+#define TIME_QUERY_H
 
 #include <GL/glew.h>
 #include <boost/array.hpp>
 
 
-namespace gl {
-
-
 /// Used to profile the GPU. It gets the time elapsed from when the begin() is
 /// called until the endAndGetTimeElapsed() method. The query causes
 /// synchronization issues because it waits for the GL commands to finish. For
@@ -39,7 +36,4 @@ class TimeQuery
 };
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/gl/Vao.cpp

@@ -4,9 +4,6 @@
 #include "rsrc/ShaderProgramAttributeVariable.h"
 
 
-namespace gl {
-
-
 //==============================================================================
 // Destructor                                                                  =
 //==============================================================================
@@ -75,6 +72,3 @@ void Vao::attachElementArrayBufferVbo(const Vbo& vbo)
 	unbind();
 	ON_GL_FAIL_THROW_EXCEPTION();
 }
-
-
-} // end namespace

+ 2 - 10
src/gl/Vao.h

@@ -1,5 +1,5 @@
-#ifndef GL_VAO_H
-#define GL_VAO_H
+#ifndef VAO_H
+#define VAO_H
 
 #include <GL/glew.h>
 #include "util/StdTypes.h"
@@ -8,11 +8,6 @@
 
 
 class ShaderProgramAttributeVariable;
-
-
-namespace gl {
-
-
 class Vbo;
 
 
@@ -119,7 +114,4 @@ inline uint Vao::getGlId() const
 }
 
 
-} // end namespace
-
-
 #endif

+ 2 - 8
src/gl/Vbo.h

@@ -1,12 +1,9 @@
-#ifndef GL_VBO_H
-#define GL_VBO_H
+#ifndef VBO_H
+#define VBO_H
 
 #include "BufferObject.h"
 
 
-namespace gl {
-
-
 /// This is a wrapper for Vertex Buffer Objects to prevent us from making
 /// idiotic errors
 class Vbo: public BufferObject
@@ -53,7 +50,4 @@ inline void Vbo::unbindAllTargets()
 }
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/r/Bl.cpp

@@ -4,9 +4,6 @@
 #include "rsrc/ShaderProgram.h"
 
 
-namespace r {
-
-
 //==============================================================================
 // Constructor                                                                 =
 //==============================================================================
@@ -161,6 +158,3 @@ void Bl::run()
 	runSideBlur();
 	runBlur();
 }
-
-
-} // end namespace

+ 5 - 11
src/r/Bl.h

@@ -1,5 +1,5 @@
-#ifndef R_BL_H
-#define R_BL_H
+#ifndef BL_H
+#define BL_H
 
 #include "RenderingPass.h"
 #include "util/Accessors.h"
@@ -11,9 +11,6 @@
 class ShaderProgram;
 
 
-namespace r {
-
-
 class Bl: private RenderingPass
 {
 	public:
@@ -31,9 +28,9 @@ class Bl: private RenderingPass
 		/// @}
 
 	private:
-		gl::Fbo hBlurFbo; ///< Fbo that writes to blurFai
-		gl::Fbo vBlurFbo; ///< Fbo that writes to postPassSProg
-		gl::Fbo sideBlurFbo;
+		Fbo hBlurFbo; ///< Fbo that writes to blurFai
+		Fbo vBlurFbo; ///< Fbo that writes to postPassSProg
+		Fbo sideBlurFbo;
 
 		RsrcPtr<ShaderProgram> hBlurSProg;
 		RsrcPtr<ShaderProgram> vBlurSProg;
@@ -51,7 +48,4 @@ class Bl: private RenderingPass
 };
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/r/Bs.cpp

@@ -9,9 +9,6 @@
 #include "rsrc/Mesh.h"
 
 
-namespace r {
-
-
 //==============================================================================
 // Destructor                                                                  =
 //==============================================================================
@@ -95,6 +92,3 @@ void Bs::run()
 {
 	/// @todo
 }
-
-
-} // end namesapce

+ 4 - 10
src/r/Bs.h

@@ -1,5 +1,5 @@
-#ifndef R_BS_H
-#define R_BS_H
+#ifndef BS_H
+#define BS_H
 
 #include "RenderingPass.h"
 #include "gl/Fbo.h"
@@ -10,9 +10,6 @@
 class ShaderProgram;
 
 
-namespace r {
-
-
 /// Blending stage.
 /// The objects that blend must be handled differently
 class Bs: public RenderingPass
@@ -25,8 +22,8 @@ class Bs: public RenderingPass
 		void run();
 
 	private:
-		gl::Fbo fbo; ///< Writes to Pps::prePassFai
-		gl::Fbo refractFbo; ///< Writes to refractFai
+		Fbo fbo; ///< Writes to Pps::prePassFai
+		Fbo refractFbo; ///< Writes to refractFai
 		RsrcPtr<ShaderProgram> refractSProg;
 		Texture refractFai;
 
@@ -35,7 +32,4 @@ class Bs: public RenderingPass
 };
 
 
-} // end namespace
-
-
 #endif

+ 3 - 9
src/r/CollisionDbgDrawer.cpp

@@ -2,13 +2,10 @@
 #include "Dbg.h"
 #include "cln/Collision.h"
 
-namespace r {
-
-
 //==============================================================================
 // draw (Sphere)                                                               =
 //==============================================================================
-void CollisionDbgDrawer::draw(const cln::Sphere& sphere)
+void CollisionDbgDrawer::draw(const Sphere& sphere)
 {
 	dbg.setModelMat(Mat4(sphere.getCenter(), Mat3::getIdentity(), 1.0));
 	dbg.drawSphere(sphere.getRadius());
@@ -18,7 +15,7 @@ void CollisionDbgDrawer::draw(const cln::Sphere& sphere)
 //==============================================================================
 // draw (Obb)                                                                  =
 //==============================================================================
-void CollisionDbgDrawer::draw(const cln::Obb& obb)
+void CollisionDbgDrawer::draw(const Obb& obb)
 {
 	Mat4 scale(Mat4::getIdentity());
 	scale(0, 0) = obb.getExtend().x();
@@ -50,7 +47,7 @@ void CollisionDbgDrawer::draw(const cln::Obb& obb)
 //==============================================================================
 // draw (Plane)                                                                =
 //==============================================================================
-void CollisionDbgDrawer::draw(const cln::Plane& plane)
+void CollisionDbgDrawer::draw(const Plane& plane)
 {
 	const Vec3& n = plane.getNormal();
 	const float& o = plane.getOffset();
@@ -63,6 +60,3 @@ void CollisionDbgDrawer::draw(const cln::Plane& plane)
 	dbg.setModelMat(trf);
 	dbg.renderGrid();
 }
-
-
-} // end namespace

+ 5 - 13
src/r/CollisionDbgDrawer.h

@@ -1,15 +1,10 @@
-#ifndef R_COLLISION_DBG_DRAWER_H
-#define R_COLLISION_DBG_DRAWER_H
+#ifndef COLLISION_DBG_DRAWER_H
+#define COLLISION_DBG_DRAWER_H
 
 
-namespace cln {
 class Sphere;
 class Obb;
 class Plane;
-}
-
-
-namespace r {
 
 
 class Dbg;
@@ -23,20 +18,17 @@ class CollisionDbgDrawer
 		CollisionDbgDrawer(Dbg& dbg_): dbg(dbg_) {}
 
 		/// Draw Sphere
-		virtual void draw(const cln::Sphere& sphere);
+		virtual void draw(const Sphere& sphere);
 
 		/// Draw Obb
-		virtual void draw(const cln::Obb& obb);
+		virtual void draw(const Obb& obb);
 
 		/// Draw Plane
-		virtual void draw(const cln::Plane& plane);
+		virtual void draw(const Plane& plane);
 
 	private:
 		Dbg& dbg; ///< The debug stage
 };
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/r/Dbg.cpp

@@ -12,9 +12,6 @@
 #include <boost/foreach.hpp>
 
 
-namespace r {
-
-
 //==============================================================================
 // Constructor                                                                 =
 //==============================================================================
@@ -423,6 +420,3 @@ void Dbg::pushBackVertex(const Vec3& pos)
 	colors[pointIndex] = crntCol;
 	++pointIndex;
 }
-
-
-} // end namespace

+ 6 - 12
src/r/Dbg.h

@@ -1,5 +1,5 @@
-#ifndef R_DBG_H
-#define R_DBG_H
+#ifndef DBG_H
+#define DBG_H
 
 #include <boost/array.hpp>
 #include <map>
@@ -15,9 +15,6 @@
 #include "util/Accessors.h"
 
 
-namespace r {
-
-
 /// Debugging stage
 class Dbg: public RenderingPass
 {
@@ -58,7 +55,7 @@ class Dbg: public RenderingPass
 		bool showSkeletonsEnabled;
 		bool showCamerasEnabled;
 		bool showVisibilityBoundingShapesFlag;
-		gl::Fbo fbo;
+		Fbo fbo;
 		RsrcPtr<ShaderProgram> sProg;
 		static const uint MAX_POINTS_PER_DRAW = 256;
 		boost::array<Vec3, MAX_POINTS_PER_DRAW> positions;
@@ -66,9 +63,9 @@ class Dbg: public RenderingPass
 		Mat4 modelMat;
 		uint pointIndex;
 		Vec3 crntCol;
-		gl::Vbo positionsVbo;
-		gl::Vbo colorsVbo;
-		gl::Vao vao;
+		Vbo positionsVbo;
+		Vbo colorsVbo;
+		Vao vao;
 		SceneDbgDrawer sceneDbgDrawer;
 		CollisionDbgDrawer collisionDbgDrawer;
 
@@ -80,7 +77,4 @@ class Dbg: public RenderingPass
 };
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/r/Deformer.cpp

@@ -6,9 +6,6 @@
 #include "MainRenderer.h"
 
 
-namespace r {
-
-
 //==============================================================================
 // Constructors & destructor                                                   =
 //==============================================================================
@@ -99,6 +96,3 @@ void Deformer::deform(SkinPatchNode& node) const
 
 	GlStateMachineSingleton::get().disable(GL_RASTERIZER_DISCARD);
 }
-
-
-} // end namespace

+ 0 - 6
src/r/Deformer.h

@@ -8,9 +8,6 @@ class ShaderProgram;
 class SkinPatchNode;
 
 
-namespace r {
-
-
 class MainRenderer;
 
 
@@ -33,7 +30,4 @@ class Deformer
 };
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/r/Ez.cpp

@@ -5,9 +5,6 @@
 #include "RendererInitializer.h"
 
 
-namespace r {
-
-
 //==============================================================================
 // init                                                                        =
 //==============================================================================
@@ -74,6 +71,3 @@ void Ez::run()
 
 	glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
 }
-
-
-} // end namespace

+ 3 - 9
src/r/Ez.h

@@ -1,14 +1,11 @@
-#ifndef R_EZ_H
-#define R_EZ_H
+#ifndef EZ_H
+#define EZ_H
 
 #include "RenderingPass.h"
 #include "gl/Fbo.h"
 #include "util/Accessors.h"
 
 
-namespace r {
-
-
 /// Material stage EarlyZ pass
 class Ez: public RenderingPass
 {
@@ -21,12 +18,9 @@ class Ez: public RenderingPass
 		void run();
 
 	private:
-		gl::Fbo fbo; ///< Writes to MS depth FAI
+		Fbo fbo; ///< Writes to MS depth FAI
 		bool enabled;
 };
 
 
-} // end namespace
-
-
 #endif

+ 1 - 7
src/r/Hdr.cpp

@@ -4,9 +4,6 @@
 #include "RendererInitializer.h"
 
 
-namespace r {
-
-
 //==============================================================================
 // Constructor                                                                 =
 //==============================================================================
@@ -25,7 +22,7 @@ Hdr::~Hdr()
 //==============================================================================
 // initFbo                                                                    =
 //==============================================================================
-void Hdr::initFbo(gl::Fbo& fbo, Texture& fai)
+void Hdr::initFbo(Fbo& fbo, Texture& fai)
 {
 	try
 	{
@@ -160,6 +157,3 @@ void Hdr::run()
 	// end
 	glBindFramebuffer(GL_FRAMEBUFFER, 0); // Bind the window framebuffer
 }
-
-
-} // end namespace

+ 6 - 12
src/r/Hdr.h

@@ -1,5 +1,5 @@
-#ifndef R_HDR_H
-#define R_HDR_H
+#ifndef HDR_H
+#define HDR_H
 
 #include "RenderingPass.h"
 #include "gl/Fbo.h"
@@ -11,9 +11,6 @@
 class ShaderProgram;
 
 
-namespace r {
-
-
 /// High dynamic range lighting pass
 class Hdr: private RenderingPass
 {
@@ -44,9 +41,9 @@ class Hdr: private RenderingPass
 		uint blurringIterationsNum; ///< The blurring iterations of the tone map
 		float blurringDist; ///< Distance in blurring
 		float renderingQuality;
-		gl::Fbo toneFbo;
-		gl::Fbo hblurFbo;
-		gl::Fbo vblurFbo;
+		Fbo toneFbo;
+		Fbo hblurFbo;
+		Fbo vblurFbo;
 		RsrcPtr<ShaderProgram> toneSProg;
 		RsrcPtr<ShaderProgram> hblurSProg;
 		RsrcPtr<ShaderProgram> vblurSProg;
@@ -54,11 +51,8 @@ class Hdr: private RenderingPass
 		Texture hblurFai; ///< pass0Fai with the horizontal blur FAI
 		Texture fai; ///< The final FAI
 
-		void initFbo(gl::Fbo& fbo, Texture& fai);
+		void initFbo(Fbo& fbo, Texture& fai);
 };
 
 
-} // end namespace
-
-
 #endif

+ 2 - 8
src/r/Is.cpp

@@ -16,9 +16,6 @@
 #include <boost/array.hpp>
 
 
-namespace r {
-
-
 #define BLEND_ENABLE true
 
 
@@ -215,10 +212,10 @@ void Is::spotLightPass(const SpotLight& light)
 	if(light.castsShadow() && sm.isEnabled())
 	{
 		Vec3 zAxis = light.getWorldTransform().getRotation().getColumn(2);
-		cln::LineSegment seg(light.getWorldTransform().getOrigin(),
+		LineSegment seg(light.getWorldTransform().getOrigin(),
 			-zAxis * light.getCamera().getZFar());
 
-		const cln::Plane& plane = cam.getWSpaceFrustumPlane(Camera::FP_NEAR);
+		const Plane& plane = cam.getWSpaceFrustumPlane(Camera::FP_NEAR);
 
 		float dist = seg.testPlane(plane);
 
@@ -369,6 +366,3 @@ void Is::run()
 
 	ON_GL_FAIL_THROW_EXCEPTION();
 }
-
-
-} // end namespace

+ 5 - 11
src/r/Is.h

@@ -1,5 +1,5 @@
-#ifndef R_IS_H
-#define R_IS_H
+#ifndef IS_H
+#define IS_H
 
 #include "RenderingPass.h"
 #include "gl/Fbo.h"
@@ -17,9 +17,6 @@ class PointLight;
 class SpotLight;
 
 
-namespace r {
-
-
 /// Illumination stage
 class Is: private RenderingPass
 {
@@ -36,12 +33,12 @@ class Is: private RenderingPass
 	private:
 		Sm sm; ///< Shadowmapping pass
 		Smo smo; /// Stencil masking optimizations pass
-		gl::Fbo fbo; ///< This FBO writes to the Is::fai
+		Fbo fbo; ///< This FBO writes to the Is::fai
 		Texture fai; ///< The one and only FAI
 		uint stencilRb; ///< Illumination stage stencil buffer
 		Texture copyMsDepthFai;
-		gl::Fbo readFbo;
-		gl::Fbo writeFbo;
+		Fbo readFbo;
+		Fbo writeFbo;
 		/// Illumination stage ambient pass shader program
 		RsrcPtr<ShaderProgram> ambientPassSProg;
 		/// Illumination stage point light shader program
@@ -71,7 +68,4 @@ class Is: private RenderingPass
 };
 
 
-} // end namespace
-
-
 #endif

+ 1 - 7
src/r/MainRenderer.cpp

@@ -17,9 +17,6 @@
 #define glewGetContext() (&glContext)
 
 
-namespace r {
-
-
 //==============================================================================
 // Constructors & destructor                                                   =
 //==============================================================================
@@ -43,7 +40,7 @@ void MainRenderer::init(const RendererInitializer& initializer_)
 
 	sProg.loadRsrc("shaders/Final.glsl");
 
-	dbgTq.reset(new gl::TimeQuery);
+	dbgTq.reset(new TimeQuery);
 
 	//
 	// init the offscreen Renderer
@@ -268,6 +265,3 @@ void MainRenderer::takeScreenshot(const char* filename)
 	//INFO("Screenshot \"" << filename << "\" saved");
 }
 
-
-} // end namespace
-

+ 3 - 9
src/r/MainRenderer.h

@@ -1,14 +1,11 @@
-#ifndef R_MAIN_RENDERER_H
-#define R_MAIN_RENDERER_H
+#ifndef MAIN_RENDERER_H
+#define MAIN_RENDERER_H
 
 #include "Renderer.h"
 #include <boost/scoped_ptr.hpp>
 #include <GL/glew.h>
 
 
-namespace r {
-
-
 class Deformer;
 
 
@@ -52,7 +49,7 @@ class MainRenderer: public Renderer
 		/// @name Profiling stuff
 		/// @{
 		double dbgTime;
-		boost::scoped_ptr<gl::TimeQuery> dbgTq;
+		boost::scoped_ptr<TimeQuery> dbgTq;
 		/// @}
 
 		RsrcPtr<ShaderProgram> sProg; ///< Final pass' shader program
@@ -73,7 +70,4 @@ class MainRenderer: public Renderer
 };
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/r/Ms.cpp

@@ -6,9 +6,6 @@
 #include "scene/RenderableNode.h"
 
 
-namespace r {
-
-
 //==============================================================================
 // Constructor                                                                 =
 //==============================================================================
@@ -133,6 +130,3 @@ void Ms::run()
 	fbo.unbind();
 	ON_GL_FAIL_THROW_EXCEPTION();
 }
-
-
-} // end namespace

+ 3 - 9
src/r/Ms.h

@@ -1,5 +1,5 @@
-#ifndef R_MS_H
-#define R_MS_H
+#ifndef MS_H
+#define MS_H
 
 #include "RenderingPass.h"
 #include "rsrc/Texture.h"
@@ -8,9 +8,6 @@
 #include "Ez.h"
 
 
-namespace r {
-
-
 /// Material stage
 class Ms: public RenderingPass
 {
@@ -31,7 +28,7 @@ class Ms: public RenderingPass
 
 	private:
 		Ez ez; /// EarlyZ pass
-		gl::Fbo fbo;
+		Fbo fbo;
 		Texture normalFai; ///< The FAI for normals
 		Texture diffuseFai; ///< The FAI for diffuse color
 		Texture specularFai; ///< The FAI for specular color and shininess
@@ -39,7 +36,4 @@ class Ms: public RenderingPass
 };
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/r/PhysDbgDrawer.cpp

@@ -4,9 +4,6 @@
 #include "core/Logger.h"
 
 
-namespace r {
-
-
 //==============================================================================
 // drawLine                                                                    =
 //==============================================================================
@@ -97,6 +94,3 @@ void PhysDbgDrawer::draw3dText(const btVector3& /*location*/,
 	//WARNING("Unimplemented");
 }
 
-
-} // end namespace
-

+ 2 - 8
src/r/PhysDbgDrawer.h

@@ -1,12 +1,9 @@
-#ifndef R_PHY_DBG_DRAWER_H
-#define R_PHY_DBG_DRAWER_H
+#ifndef PHY_DBG_DRAWER_H
+#define PHY_DBG_DRAWER_H
 
 #include <LinearMath/btIDebugDraw.h>
 
 
-namespace r {
-
-
 class Dbg;
 
 
@@ -44,7 +41,4 @@ class PhysDbgDrawer: public btIDebugDraw
 };
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/r/Pps.cpp

@@ -5,9 +5,6 @@
 #include "RendererInitializer.h"
 
 
-namespace r {
-
-
 //==============================================================================
 // Constructor                                                                 =
 //==============================================================================
@@ -174,6 +171,3 @@ void Pps::runPostPass()
 	//
 	bl.run();
 }
-
-
-} // end namespace

+ 4 - 10
src/r/Pps.h

@@ -1,5 +1,5 @@
-#ifndef R_PPS_H
-#define R_PPS_H
+#ifndef PPS_H
+#define PPS_H
 
 #include "RenderingPass.h"
 #include "gl/Fbo.h"
@@ -13,9 +13,6 @@
 class ShaderProgram;
 
 
-namespace r {
-
-
 /// Post-processing stage.
 ///
 /// This stage is divided into 2 two parts. The first happens before blending
@@ -46,8 +43,8 @@ class Pps: private RenderingPass
 		Bl bl;
 		/// @}
 
-		gl::Fbo prePassFbo;
-		gl::Fbo postPassFbo;
+		Fbo prePassFbo;
+		Fbo postPassFbo;
 
 		RsrcPtr<ShaderProgram> prePassSProg;
 		RsrcPtr<ShaderProgram> postPassSProg;
@@ -57,7 +54,4 @@ class Pps: private RenderingPass
 };
 
 
-} // end namespace
-
-
 #endif

+ 4 - 10
src/r/Renderer.cpp

@@ -4,9 +4,6 @@
 #include "scene/PerspectiveCamera.h"
 
 
-namespace r {
-
-
 //==============================================================================
 // Constructor                                                                 =
 //==============================================================================
@@ -70,10 +67,10 @@ void Renderer::init(const RendererInitializer& initializer)
 	quadVao.attachElementArrayBufferVbo(quadVertIndecesVbo);
 
 	// Other
-	msTq.reset(new gl::TimeQuery);
-	isTq.reset(new gl::TimeQuery);
-	ppsTq.reset(new gl::TimeQuery);
-	bsTq.reset(new gl::TimeQuery);
+	msTq.reset(new TimeQuery);
+	isTq.reset(new TimeQuery);
+	ppsTq.reset(new TimeQuery);
+	bsTq.reset(new TimeQuery);
 }
 
 
@@ -210,6 +207,3 @@ void Renderer::calcLimitsOfNearPlane(const PerspectiveCamera& pcam,
 	limitsOfNearPlane.x() = limitsOfNearPlane.y() *
 		(pcam.getFovX() / pcam.getFovY());
 }
-
-
-} // end namespace

+ 6 - 12
src/r/Renderer.h

@@ -1,5 +1,5 @@
-#ifndef R_RENDERER_H
-#define R_RENDERER_H
+#ifndef RENDERER_H
+#define RENDERER_H
 
 #include "m/Math.h"
 #include "gl/Fbo.h"
@@ -26,9 +26,6 @@ class ModelNode;
 
 
 /// Renderer namespace
-namespace r {
-
-
 
 /// Offscreen renderer
 /// It is a class and not a namespace because we may need external renderers
@@ -127,7 +124,7 @@ class Renderer
 		/// @name Profiling stuff
 		/// @{
 		double msTime, isTime, ppsTime, bsTime;
-		boost::scoped_ptr<gl::TimeQuery> msTq, isTq, ppsTq, bsTq;
+		boost::scoped_ptr<TimeQuery> msTq, isTq, ppsTq, bsTq;
 		bool enableStagesProfilingFlag;
 		/// @}
 
@@ -162,14 +159,11 @@ class Renderer
 
 		/// @name For drawing a quad into the active framebuffer
 		/// @{
-		gl::Vbo quadPositionsVbo; ///< The VBO for quad positions
-		gl::Vbo quadVertIndecesVbo; ///< The VBO for quad array buffer elements
-		gl::Vao quadVao; ///< This VAO is used everywhere except material stage
+		Vbo quadPositionsVbo; ///< The VBO for quad positions
+		Vbo quadVertIndecesVbo; ///< The VBO for quad array buffer elements
+		Vao quadVao; ///< This VAO is used everywhere except material stage
 		/// @}
 };
 
 
-} // end namespace
-
-
 #endif

+ 2 - 8
src/r/RendererInitializer.h

@@ -1,12 +1,9 @@
-#ifndef R_RENDERER_INITIALIZER_H
-#define R_RENDERER_INITIALIZER_H
+#ifndef RENDERER_INITIALIZER_H
+#define RENDERER_INITIALIZER_H
 
 #include <cstring>
 
 
-namespace r {
-
-
 /// A struct to initialize the renderer. It contains a few extra params for
 /// the MainRenderer
 struct RendererInitializer
@@ -85,7 +82,4 @@ struct RendererInitializer
 };
 
 
-} // end namespace
-
-
 #endif

+ 2 - 8
src/r/RenderingPass.h

@@ -1,8 +1,5 @@
-#ifndef R_RENDERING_PASS_H
-#define R_RENDERING_PASS_H
-
-
-namespace r {
+#ifndef RENDERING_PASS_H
+#define RENDERING_PASS_H
 
 
 class Renderer;
@@ -23,7 +20,4 @@ class RenderingPass
 };
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/r/SceneDbgDrawer.cpp

@@ -8,9 +8,6 @@
 #include "scene/OrthographicCamera.h"
 
 
-namespace r {
-
-
 //==============================================================================
 // drawCamera                                                                  =
 //==============================================================================
@@ -152,6 +149,3 @@ void SceneDbgDrawer::drawSkinNodeSkeleton(const SkinNode& sn) const
 	}
 	dbg.end();
 }
-
-
-} // end namespace

+ 2 - 8
src/r/SceneDbgDrawer.h

@@ -1,5 +1,5 @@
-#ifndef R_SCENE_DBG_DRAWER_H
-#define R_SCENE_DBG_DRAWER_H
+#ifndef SCENE_DBG_DRAWER_H
+#define SCENE_DBG_DRAWER_H
 
 
 class Camera;
@@ -10,9 +10,6 @@ class PerspectiveCamera;
 class OrthographicCamera;
 
 
-namespace r {
-
-
 class Dbg;
 
 
@@ -45,7 +42,4 @@ class SceneDbgDrawer
 };
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/r/SceneDrawer.cpp

@@ -11,9 +11,6 @@
 #include "gl/GlStateMachine.h"
 
 
-namespace r {
-
-
 //==============================================================================
 // Constructor                                                                 =
 //==============================================================================
@@ -282,6 +279,3 @@ void SceneDrawer::renderRenderableNode(const RenderableNode& node,
 	node.getVao(pt).unbind();
 }
 
-
-} // end namespace
-

+ 2 - 8
src/r/SceneDrawer.h

@@ -1,5 +1,5 @@
-#ifndef R_SCENE_DRAWER_H
-#define R_SCENE_DRAWER_H
+#ifndef SCENE_DRAWER_H
+#define SCENE_DRAWER_H
 
 #include "m/Math.h"
 #include "rsrc/MaterialCommon.h"
@@ -14,9 +14,6 @@ class MaterialRuntime;
 class MaterialRuntimeVariable;
 
 
-namespace r {
-
-
 class Renderer;
 
 
@@ -73,7 +70,4 @@ class SceneDrawer
 };
 
 
-} // end namespace
-
-
 #endif

+ 0 - 6
src/r/Sm.cpp

@@ -10,9 +10,6 @@
 #include "RendererInitializer.h"
 
 
-namespace r {
-
-
 //==============================================================================
 // init                                                                        =
 //==============================================================================
@@ -168,6 +165,3 @@ void Sm::run(const Light& light, float distance)
 	// FBO
 	crntLevel->fbo.unbind();
 }
-
-
-} // end namespace

+ 3 - 9
src/r/Sm.h

@@ -1,5 +1,5 @@
-#ifndef R_SM_H
-#define R_SM_H
+#ifndef SM_H
+#define SM_H
 
 #include "RenderingPass.h"
 #include "gl/Fbo.h"
@@ -11,9 +11,6 @@
 class Light;
 
 
-namespace r {
-
-
 /// Shadowmapping pass
 class Sm: private RenderingPass
 {
@@ -46,7 +43,7 @@ class Sm: private RenderingPass
 		/// used
 		struct Level
 		{
-			gl::Fbo fbo; ///< Illumination stage shadowmapping FBO
+			Fbo fbo; ///< Illumination stage shadowmapping FBO
 			Texture shadowMap; ///< The shadowmap for that level
 			uint resolution; ///< The shadowmap's resolution
 			bool bilinear; ///< Enable bilinar filtering in shadowmap
@@ -76,7 +73,4 @@ class Sm: private RenderingPass
 };
 
 
-} // end namespace
-
-
 #endif

+ 1 - 7
src/r/Smo.cpp

@@ -12,9 +12,6 @@
 #include "rsrc/Mesh.h"
 
 
-namespace r {
-
-
 const float THRESHOLD = 0.2;
 
 
@@ -169,7 +166,7 @@ void Smo::run(const SpotLight& light)
 
 	const Vec3& origin = r.getCamera().getWorldTransform().getOrigin();
 	float radius = r.getCamera().getZNear() + THRESHOLD;
-	bool inside =  lcam.insideFrustum(cln::Sphere(origin, radius));
+	bool inside =  lcam.insideFrustum(Sphere(origin, radius));
 
 	// set GL state
 	setUpGl(inside);
@@ -242,6 +239,3 @@ void Smo::run(const SpotLight& light)
 	// restore GL state
 	restoreGl(inside);
 }
-
-
-} // end namespace

+ 3 - 9
src/r/Smo.h

@@ -1,5 +1,5 @@
-#ifndef R_SMO_H
-#define R_SMO_H
+#ifndef SMO_H
+#define SMO_H
 
 #include "RenderingPass.h"
 #include "gl/Fbo.h"
@@ -14,9 +14,6 @@ class PointLight;
 class SpotLight;
 
 
-namespace r {
-
-
 /// Stencil masking optimizations
 class Smo: public RenderingPass
 {
@@ -35,7 +32,7 @@ class Smo: public RenderingPass
 			~Geom();
 
 			RsrcPtr<Mesh> mesh;
-			gl::Vao vao;
+			Vao vao;
 		};
 
 		Geom sphereGeom;
@@ -53,7 +50,4 @@ class Smo: public RenderingPass
 };
 
 
-} // end namespace
-
-
 #endif

+ 1 - 7
src/r/Ssao.cpp

@@ -6,13 +6,10 @@
 #include "scene/PerspectiveCamera.h"
 
 
-namespace r {
-
-
 //==============================================================================
 // createFbo                                                                   =
 //==============================================================================
-void Ssao::createFbo(gl::Fbo& fbo, Texture& fai)
+void Ssao::createFbo(Fbo& fbo, Texture& fai)
 {
 	try
 	{
@@ -194,6 +191,3 @@ void Ssao::run()
 	// end
 	glBindFramebuffer(GL_FRAMEBUFFER, 0); // Bind the window framebuffer
 }
-
-
-} // end namespace

+ 6 - 12
src/r/Ssao.h

@@ -1,5 +1,5 @@
-#ifndef R_SSAO_H
-#define R_SSAO_H
+#ifndef SSAO_H
+#define SSAO_H
 
 #include "RenderingPass.h"
 #include "gl/Fbo.h"
@@ -10,9 +10,6 @@
 #include "gl/Vao.h"
 
 
-namespace r {
-
-
 /// Screen space ambient occlusion pass
 ///
 /// Three passes:
@@ -40,19 +37,16 @@ class Ssao: private RenderingPass
 		bool enabled;
 		float renderingQuality;
 		float blurringIterationsNum;
-		gl::Fbo ssaoFbo;
-		gl::Fbo hblurFbo;
-		gl::Fbo vblurFbo;
+		Fbo ssaoFbo;
+		Fbo hblurFbo;
+		Fbo vblurFbo;
 		RsrcPtr<Texture> noiseMap;
 		RsrcPtr<ShaderProgram> ssaoSProg;
 		RsrcPtr<ShaderProgram> hblurSProg;
 		RsrcPtr<ShaderProgram> vblurSProg;
 
-		void createFbo(gl::Fbo& fbo, Texture& fai);
+		void createFbo(Fbo& fbo, Texture& fai);
 };
 
 
-} // end namespace
-
-
 #endif

+ 4 - 4
src/rsrc/Mesh.h

@@ -36,9 +36,9 @@ class Mesh
 
 		/// @name Accessors
 		/// @{
-		const gl::Vbo& getVbo(Vbos id) const {return vbos[id];}
+		const Vbo& getVbo(Vbos id) const {return vbos[id];}
 		GETTER_R_BY_VAL(uint, vertIdsNum, getVertIdsNum)
-		GETTER_R(cln::Obb, visibilityShape, getVisibilityShape)
+		GETTER_R(Obb, visibilityShape, getVisibilityShape)
 		GETTER_R_BY_VAL(uint, vertsNum, getVertsNum)
 		/// @}
 
@@ -53,9 +53,9 @@ class Mesh
 		/// @}
 
 	private:
-		boost::array<gl::Vbo, VBOS_NUM> vbos; ///< The vertex buffer objects
+		boost::array<Vbo, VBOS_NUM> vbos; ///< The vertex buffer objects
 		uint vertIdsNum; ///< The number of vertex IDs
-		cln::Obb visibilityShape;
+		Obb visibilityShape;
 		uint vertsNum;
 
 		/// Create the VBOs

+ 2 - 2
src/rsrc/Model.h

@@ -37,13 +37,13 @@ class Model
 		/// @name Accessors
 		/// @{
 		GETTER_R(boost::ptr_vector<ModelPatch>, modelPatches, getModelPatches)
-		GETTER_R(cln::Obb, visibilityShape, getVisibilityShape)
+		GETTER_R(Obb, visibilityShape, getVisibilityShape)
 		/// @}
 
 	private:
 		/// The vector of ModelPatch
 		boost::ptr_vector<ModelPatch> modelPatches;
-		cln::Obb visibilityShape;
+		Obb visibilityShape;
 };
 
 

+ 28 - 3
src/rsrc/ShaderProgramPrePreprocessor.cpp

@@ -152,13 +152,13 @@ void ShaderProgramPrePreprocessor::parseFile(const char* filename)
 		parseFileForPragmas(filename);
 	
 		// sanity checks
-		if(shaderStarts[ST_VERTEX].globalLine == -1)
+		if(!shaderStarts[ST_VERTEX].isDefined())
 		{
 			throw EXCEPTION("Entry point \""+ startTokens[ST_VERTEX] +
 				"\" is not defined");
 		}
 
-		if(shaderStarts[ST_FRAGMENT].globalLine == -1)
+		if(!shaderStarts[ST_FRAGMENT].isDefined())
 		{
 			throw EXCEPTION("Entry point \""+ startTokens[ST_FRAGMENT] +
 				"\" is not defined");
@@ -172,11 +172,36 @@ void ShaderProgramPrePreprocessor::parseFile(const char* filename)
 			src = "";
 
 			// If not defined bb
-			if(shaderStarts[i].definedInLine == -1)
+			if(!shaderStarts[i].isDefined())
 			{
 				continue;
 			}
 
+			// Sanity check: Check the correct order of i
+			int k = (int)i - 1;
+			while(k > -1)
+			{
+				if(shaderStarts[k].isDefined() &&
+					shaderStarts[k].globalLine >= shaderStarts[i].globalLine)
+				{
+					throw EXCEPTION(startTokens[i] + " must be after " +
+						startTokens[k]);
+				}
+				--k;
+			}
+
+			k = (int)i + 1;
+			while(k < ST_NUM)
+			{
+				if(shaderStarts[k].isDefined() &&
+					shaderStarts[k].globalLine <= shaderStarts[i].globalLine)
+				{
+					throw EXCEPTION(startTokens[k] + " must be after " +
+						startTokens[i]);
+				}
+				++k;
+			}
+
 			// put global source code
 			for(int j = 0; j < shaderStarts[ST_VERTEX].globalLine - 1; ++j)
 			{

+ 1 - 0
src/rsrc/ShaderProgramPrePreprocessor.h

@@ -56,6 +56,7 @@ class ShaderProgramPrePreprocessor
 			int definedInLine;
 			Pragma(): definedInLine(-1) {}
 			Pragma(const std::string& definedInFile_, int definedInLine_);
+			bool isDefined() const {return definedInLine != -1;}
 		};
 		
 		struct IncludePragma: Pragma

+ 2 - 2
src/scene/Camera.cpp

@@ -31,9 +31,9 @@ void Camera::updateWSpaceFrustumPlanes()
 //==============================================================================
 // insideFrustum                                                               =
 //==============================================================================
-bool Camera::insideFrustum(const cln::CollisionShape& bvol) const
+bool Camera::insideFrustum(const CollisionShape& bvol) const
 {
-	BOOST_FOREACH(const cln::Plane& plane, wspaceFrustumPlanes)
+	BOOST_FOREACH(const Plane& plane, wspaceFrustumPlanes)
 	{
 		if(bvol.testPlane(plane) < 0.0)
 		{

+ 5 - 5
src/scene/Camera.h

@@ -55,7 +55,7 @@ class Camera: public SceneNode, public VisibilityInfo
 		/// See the declaration of invProjectionMat for info
 		const Mat4& getInvProjectionMatrix() const {return invProjectionMat;}
 
-		const cln::Plane& getWSpaceFrustumPlane(FrustrumPlanes id) const;
+		const Plane& getWSpaceFrustumPlane(FrustrumPlanes id) const;
 		/// @}
 
 		void lookAtPoint(const Vec3& point);
@@ -73,7 +73,7 @@ class Camera: public SceneNode, public VisibilityInfo
 
 		/// Check if the given camera is inside the frustum clipping planes.
 		/// This is used mainly to test if the projected lights are visible
-		bool insideFrustum(const cln::CollisionShape& vol) const;
+		bool insideFrustum(const CollisionShape& vol) const;
 
 		/// Check if another camera is inside our view (used for projected
 		/// lights)
@@ -87,8 +87,8 @@ class Camera: public SceneNode, public VisibilityInfo
 
 		/// @name The frustum planes in local and world space
 		/// @{
-		boost::array<cln::Plane, FP_NUM> lspaceFrustumPlanes;
-		boost::array<cln::Plane, FP_NUM> wspaceFrustumPlanes;
+		boost::array<Plane, FP_NUM> lspaceFrustumPlanes;
+		boost::array<Plane, FP_NUM> wspaceFrustumPlanes;
 		/// @}
 
 		/// @name Matrices
@@ -127,7 +127,7 @@ inline Camera::Camera(CameraType camType, bool inheritParentTrfFlag,
 }
 
 
-inline const cln::Plane& Camera::getWSpaceFrustumPlane(FrustrumPlanes id) const
+inline const Plane& Camera::getWSpaceFrustumPlane(FrustrumPlanes id) const
 {
 	return wspaceFrustumPlanes[id];
 }

+ 2 - 2
src/scene/ModelNode.h

@@ -24,7 +24,7 @@ class ModelNode: public SceneNode
 		/// @{
 		GETTER_RW(Vec<ModelPatchNode*>, patches, getModelPatchNodes)
 		const Model& getModel() const {return *model;}
-		GETTER_R(cln::Obb, visibilityShapeWSpace, getVisibilityShapeWSpace)
+		GETTER_R(Obb, visibilityShapeWSpace, getVisibilityShapeWSpace)
 		/// @}
 
 		/// Initialize the node
@@ -37,7 +37,7 @@ class ModelNode: public SceneNode
 	private:
 		RsrcPtr<Model> model;
 		Vec<ModelPatchNode*> patches;
-		cln::Obb visibilityShapeWSpace;
+		Obb visibilityShapeWSpace;
 };
 
 

+ 2 - 2
src/scene/ModelPatchNode.h

@@ -14,12 +14,12 @@ class ModelPatchNode: public PatchNode
 	public:
 		ModelPatchNode(const ModelPatch& modelPatch, ModelNode* parent);
 
-		GETTER_R(cln::Obb, visibilityShapeWSpace, getVisibilityShapeWSpace)
+		GETTER_R(Obb, visibilityShapeWSpace, getVisibilityShapeWSpace)
 
 		virtual void moveUpdate(); ///< Update the visibility shape
 
 	private:
-		cln::Obb visibilityShapeWSpace;
+		Obb visibilityShapeWSpace;
 };
 
 

+ 6 - 6
src/scene/OrthographicCamera.cpp

@@ -23,12 +23,12 @@ void OrthographicCamera::setAll(float left_, float right_, float top_,
 //==============================================================================
 void OrthographicCamera::calcLSpaceFrustumPlanes()
 {
-	lspaceFrustumPlanes[FP_LEFT] = cln::Plane(Vec3(1.0, 0.0, 0.0), left);
-	lspaceFrustumPlanes[FP_RIGHT] = cln::Plane(Vec3(-1.0, 0.0, 0.0), -right);
-	lspaceFrustumPlanes[FP_NEAR] = cln::Plane(Vec3(0.0, 0.0, -1.0), zNear);
-	lspaceFrustumPlanes[FP_FAR] = cln::Plane(Vec3(0.0, 0.0, 1.0), -zFar);
-	lspaceFrustumPlanes[FP_TOP] = cln::Plane(Vec3(0.0, -1.0, 0.0), -top);
-	lspaceFrustumPlanes[FP_BOTTOM] = cln::Plane(Vec3(0.0, 1.0, 0.0), bottom);
+	lspaceFrustumPlanes[FP_LEFT] = Plane(Vec3(1.0, 0.0, 0.0), left);
+	lspaceFrustumPlanes[FP_RIGHT] = Plane(Vec3(-1.0, 0.0, 0.0), -right);
+	lspaceFrustumPlanes[FP_NEAR] = Plane(Vec3(0.0, 0.0, -1.0), zNear);
+	lspaceFrustumPlanes[FP_FAR] = Plane(Vec3(0.0, 0.0, 1.0), -zFar);
+	lspaceFrustumPlanes[FP_TOP] = Plane(Vec3(0.0, -1.0, 0.0), -top);
+	lspaceFrustumPlanes[FP_BOTTOM] = Plane(Vec3(0.0, 1.0, 0.0), bottom);
 }
 
 

+ 1 - 1
src/scene/PatchNode.cpp

@@ -17,7 +17,7 @@ PatchNode::PatchNode(const ModelPatch& modelPatch, SceneNode* parent)
 // createVao                                                                   =
 //==============================================================================
 void PatchNode::createVao(const Material& mtl, const VboArray& vbos,
-	gl::Vao& vao)
+	Vao& vao)
 {
 	vao.create();
 

+ 4 - 4
src/scene/PatchNode.h

@@ -20,7 +20,7 @@ class Material;
 class PatchNode: public RenderableNode
 {
 	public:
-		typedef boost::array<const gl::Vbo*, Mesh::VBOS_NUM> VboArray;
+		typedef boost::array<const Vbo*, Mesh::VBOS_NUM> VboArray;
 
 		PatchNode(const ModelPatch& modelPatch, SceneNode* parent);
 
@@ -31,7 +31,7 @@ class PatchNode: public RenderableNode
 		/// @{
 
 		/// Implements RenderableNode::getVao
-		const gl::Vao& getVao(PassType p) const {return vaos[p];}
+		const Vao& getVao(PassType p) const {return vaos[p];}
 
 		/// Implements RenderableNode::getVertIdsNum
 		uint getVertIdsNum() const {return rsrc.getMesh().getVertIdsNum();}
@@ -53,7 +53,7 @@ class PatchNode: public RenderableNode
 		const ModelPatch& rsrc;
 
 		/// The VAOs. All VBOs could be attached except for the vertex weights
-		boost::array<gl::Vao, PASS_TYPES_NUM> vaos;
+		boost::array<Vao, PASS_TYPES_NUM> vaos;
 
 		boost::scoped_ptr<MaterialRuntime> mtlRun; ///< Material runtime
 
@@ -62,7 +62,7 @@ class PatchNode: public RenderableNode
 		/// MaterialVertex.glsl
 		static void createVao(const Material& material,
 			const VboArray& vbos,
-			gl::Vao& vao);
+			Vao& vao);
 };
 
 

+ 6 - 6
src/scene/PerspectiveCamera.cpp

@@ -53,20 +53,20 @@ void PerspectiveCamera::calcLSpaceFrustumPlanes()
 
 	sinCos(PI + fovX / 2, s, c);
 	// right
-	lspaceFrustumPlanes[FP_RIGHT] = cln::Plane(Vec3(c, 0.0, s), 0.0);
+	lspaceFrustumPlanes[FP_RIGHT] = Plane(Vec3(c, 0.0, s), 0.0);
 	// left
-	lspaceFrustumPlanes[FP_LEFT] = cln::Plane(Vec3(-c, 0.0, s), 0.0);
+	lspaceFrustumPlanes[FP_LEFT] = Plane(Vec3(-c, 0.0, s), 0.0);
 
 	sinCos((3 * PI - fovY) * 0.5, s, c);
 	// top
-	lspaceFrustumPlanes[FP_TOP] = cln::Plane(Vec3(0.0, s, c), 0.0);
+	lspaceFrustumPlanes[FP_TOP] = Plane(Vec3(0.0, s, c), 0.0);
 	// bottom
-	lspaceFrustumPlanes[FP_BOTTOM] = cln::Plane(Vec3(0.0, -s, c), 0.0);
+	lspaceFrustumPlanes[FP_BOTTOM] = Plane(Vec3(0.0, -s, c), 0.0);
 
 	// near
-	lspaceFrustumPlanes[FP_NEAR] = cln::Plane(Vec3(0.0, 0.0, -1.0), zNear);
+	lspaceFrustumPlanes[FP_NEAR] = Plane(Vec3(0.0, 0.0, -1.0), zNear);
 	// far
-	lspaceFrustumPlanes[FP_FAR] = cln::Plane(Vec3(0.0, 0.0, 1.0), -zFar);
+	lspaceFrustumPlanes[FP_FAR] = Plane(Vec3(0.0, 0.0, 1.0), -zFar);
 }
 
 

+ 1 - 3
src/scene/RenderableNode.h

@@ -5,9 +5,7 @@
 #include "rsrc/MaterialCommon.h"
 
 
-namespace gl {
 class Vao;
-}
 class Material;
 class MaterialRuntime;
 
@@ -21,7 +19,7 @@ class RenderableNode: public SceneNode
 		virtual ~RenderableNode();
 
 		/// Get VAO depending the rendering pass
-		virtual const gl::Vao& getVao(PassType p) const = 0;
+		virtual const Vao& getVao(PassType p) const = 0;
 
 		/// Get vert ids number for rendering
 		virtual uint getVertIdsNum() const = 0;

+ 1 - 1
src/scene/SceneNode.h

@@ -17,7 +17,7 @@ class Controller;
 class SceneNode: public Object
 {
 	public:
-		typedef cln::Obb VisibilityCollisionShape;
+		typedef Obb VisibilityCollisionShape;
 
 		enum SceneNodeType
 		{

+ 2 - 2
src/scene/SkinNode.h

@@ -28,7 +28,7 @@ class SkinNode: public SceneNode
 		GETTER_RW(Vec<Mat3>, boneRotations, getBoneRotations)
 		GETTER_RW(Vec<Vec3>, boneTranslations, getBoneTranslations)
 		GETTER_R(Skin, *skin, getSkin)
-		GETTER_R(cln::Obb, visibilityShapeWSpace, getVisibilityShapeWSpace)
+		GETTER_R(Obb, visibilityShapeWSpace, getVisibilityShapeWSpace)
 		GETTER_R(Vec<SkinPatchNode*>, patches, getPatchNodes)
 
 		GETTER_SETTER_BY_VAL(float, step, getStep, setStep)
@@ -49,7 +49,7 @@ class SkinNode: public SceneNode
 	private:
 		RsrcPtr<Skin> skin; ///< The resource
 		Vec<SkinPatchNode*> patches;
-		cln::Obb visibilityShapeWSpace;
+		Obb visibilityShapeWSpace;
 
 		/// @name Animation stuff
 		/// @{

+ 4 - 4
src/scene/SkinPatchNode.h

@@ -37,14 +37,14 @@ class SkinPatchNode: public PatchNode
 
 		/// @name Accessors
 		/// @{
-		GETTER_R(gl::Vao, tfVao, getTfVao)
-		const gl::Vbo& getTfVbo(uint i) const {return tfVbos[i];}
+		GETTER_R(Vao, tfVao, getTfVao)
+		const Vbo& getTfVbo(uint i) const {return tfVbos[i];}
 		/// @}
 
 	private:
 		/// VBOs that contain the deformed vertex attributes
-		boost::array<gl::Vbo, TFV_NUM> tfVbos;
-		gl::Vao tfVao; ///< For TF passes
+		boost::array<Vbo, TFV_NUM> tfVbos;
+		Vao tfVao; ///< For TF passes
 };
 
 

+ 1 - 1
src/scene/VisibilityTester.cpp

@@ -71,7 +71,7 @@ void VisibilityTester::test(Camera& cam)
 			{
 				PointLight* pointl = static_cast<PointLight*>(light);
 
-				cln::Sphere sphere(pointl->getWorldTransform().getOrigin(),
+				Sphere sphere(pointl->getWorldTransform().getOrigin(),
 					pointl->getRadius());
 				if(cam.insideFrustum(sphere))
 				{

+ 2 - 2
src/script/Engine.cpp

@@ -33,8 +33,8 @@ BOOST_PYTHON_MODULE(Anki)
 	CALL_WRAP(Dbg);
 	CALL_WRAP(MainRenderer);
 
-	CALL_WRAP(EventSceneColor);
-	CALL_WRAP(EventMainRendererPpsHdr);
+	CALL_WRAP(SceneColorEvent);
+	CALL_WRAP(MainRendererPpsHdrEvent);
 	CALL_WRAP(EventManager);
 
 	CALL_WRAP(App);

+ 5 - 10
src/script/core/Globals.cpp

@@ -5,28 +5,23 @@
 #include "i/Input.h"
 #include "scene/Scene.h"
 #include "core/App.h"
-#include "event/Manager.h"
+#include "event/EventManager.h"
 
 
 WRAP_SINGLETON(LoggerSingleton)
-
-typedef r::MainRendererSingleton r_MainRendererSingleton;
-WRAP_SINGLETON(r_MainRendererSingleton)
-
+WRAP_SINGLETON(MainRendererSingleton)
 WRAP_SINGLETON(InputSingleton)
 WRAP_SINGLETON(SceneSingleton)
 WRAP_SINGLETON(AppSingleton)
-
-typedef event::ManagerSingleton event_ManagerSingleton;
-WRAP_SINGLETON(event_ManagerSingleton)
+WRAP_SINGLETON(EventManagerSingleton)
 
 
 void boostPythonWrapAllGlobals()
 {
 	CALL_WRAP(LoggerSingleton);
-	CALL_WRAP(r_MainRendererSingleton);
+	CALL_WRAP(MainRendererSingleton);
 	CALL_WRAP(InputSingleton);
 	CALL_WRAP(SceneSingleton);
 	CALL_WRAP(AppSingleton);
-	CALL_WRAP(event_ManagerSingleton);
+	CALL_WRAP(EventManagerSingleton);
 }

+ 7 - 0
src/script/core/Logger.cpp

@@ -4,7 +4,14 @@
 
 WRAP(Logger)
 {
+	scope loggerScope(
 	class_<Logger, noncopyable>("Logger", no_init)
 		.def("write", &Logger::write)
+	);
+
+	enum_<Logger::MessageType>("MessageType")
+		.value("MT_NORMAL", Logger::MT_NORMAL)
+		.value("MT_ERROR", Logger::MT_ERROR)
+		.value("MT_WARNING", Logger::MT_WARNING)
 	;
 }

+ 17 - 0
src/script/event/EventManager.cpp

@@ -0,0 +1,17 @@
+#include "Common.h"
+#include "event/EventManager.h"
+
+#include "event/SceneColorEvent.h"
+#include "event/MainRendererPpsHdrEvent.h"
+
+
+WRAP(EventManager)
+{
+	class_<EventManager, noncopyable>("EventManager", no_init)
+		.def("createEvent", &EventManager::createEvent<SceneColorEvent>,
+			return_value_policy<reference_existing_object>())
+		.def("createEvent",
+			&EventManager::createEvent<MainRendererPpsHdrEvent>,
+			return_value_policy<reference_existing_object>())
+	;
+}

+ 0 - 13
src/script/event/MainRendererPpsHdr.cpp

@@ -1,13 +0,0 @@
-#include "Common.h"
-#include "event/MainRendererPpsHdr.h"
-
-
-WRAP(EventMainRendererPpsHdr)
-{
-	using namespace event;
-
-	class_<MainRendererPpsHdr>("event_MainRendererPpsHdr", no_init)
-		.def(init<float, float, float, uint, float>())
-		.def(init<const MainRendererPpsHdr&>())
-	;
-}

+ 11 - 0
src/script/event/MainRendererPpsHdrEvent.cpp

@@ -0,0 +1,11 @@
+#include "Common.h"
+#include "event/MainRendererPpsHdrEvent.h"
+
+
+WRAP(MainRendererPpsHdrEvent)
+{
+	class_<MainRendererPpsHdrEvent>("MainRendererPpsHdrEvent", no_init)
+		.def(init<float, float, float, uint, float>())
+		.def(init<const MainRendererPpsHdrEvent&>())
+	;
+}

+ 0 - 19
src/script/event/Manager.cpp

@@ -1,19 +0,0 @@
-#include "Common.h"
-#include "event/Manager.h"
-
-#include "event/SceneColor.h"
-#include "event/MainRendererPpsHdr.h"
-
-
-WRAP(EventManager)
-{
-	using namespace event;
-
-	class_<Manager, noncopyable>("event_EventManager", no_init)
-		.def("createEvent", &Manager::createEvent<SceneColor>,
-			return_value_policy<reference_existing_object>())
-		.def("createEvent",
-			&Manager::createEvent<MainRendererPpsHdr>,
-			return_value_policy<reference_existing_object>())
-	;
-}

+ 0 - 13
src/script/event/SceneColor.cpp

@@ -1,13 +0,0 @@
-#include "Common.h"
-#include "event/SceneColor.h"
-
-
-WRAP(EventSceneColor)
-{
-	using namespace event;
-
-	class_<SceneColor>("event_EventSceneColor", no_init)
-		.def(init<float, float, const Vec3&>())
-		.def(init<const SceneColor&>())
-	;
-}

+ 11 - 0
src/script/event/SceneColorEvent.cpp

@@ -0,0 +1,11 @@
+#include "Common.h"
+#include "event/SceneColorEvent.h"
+
+
+WRAP(SceneColorEvent)
+{
+	class_<SceneColorEvent>("SceneColorEvent", no_init)
+		.def(init<float, float, const Vec3&>())
+		.def(init<const SceneColorEvent&>())
+	;
+}

+ 0 - 2
src/script/r/Bl.cpp

@@ -4,8 +4,6 @@
 
 WRAP(Bl)
 {
-	using namespace r;
-
 	class_<Bl, noncopyable>("Bl", no_init)
 		.def("isEnabled", (bool (Bl::*)() const)(&Bl::isEnabled))
 		.def("setEnabled", &Bl::setEnabled)

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů