Browse Source

Formatting the source with a custom clang-format

Panagiotis Christopoulos Charitos 10 years ago
parent
commit
dd4e75a30f
100 changed files with 950 additions and 685 deletions
  1. 92 0
      .clang-format
  2. 0 1
      include/anki/AnKi.h
  3. 0 1
      include/anki/Collision.h
  4. 0 1
      include/anki/Event.h
  5. 0 1
      include/anki/Gr.h
  6. 0 1
      include/anki/Math.h
  7. 0 1
      include/anki/Renderer.h
  8. 0 1
      include/anki/Resource.h
  9. 0 1
      include/anki/Ui.h
  10. 0 1
      include/anki/Util.h
  11. 5 4
      include/anki/collision/Aabb.h
  12. 12 9
      include/anki/collision/CollisionShape.h
  13. 2 2
      include/anki/collision/Common.h
  14. 3 3
      include/anki/collision/CompoundShape.h
  15. 2 2
      include/anki/collision/ContactPoint.h
  16. 5 4
      include/anki/collision/ConvexHullShape.h
  17. 7 6
      include/anki/collision/ConvexShape.h
  18. 2 2
      include/anki/collision/Forward.h
  19. 16 15
      include/anki/collision/Frustum.h
  20. 4 4
      include/anki/collision/Functions.h
  21. 6 4
      include/anki/collision/GjkEpa.h
  22. 17 15
      include/anki/collision/GjkEpaInternal.h
  23. 14 12
      include/anki/collision/LineSegment.h
  24. 3 3
      include/anki/collision/Obb.h
  25. 7 6
      include/anki/collision/Plane.h
  26. 12 10
      include/anki/collision/Sphere.h
  27. 2 2
      include/anki/collision/Tests.h
  28. 9 6
      include/anki/core/App.h
  29. 3 3
      include/anki/core/Config.h
  30. 4 3
      include/anki/core/NativeWindow.h
  31. 2 2
      include/anki/core/NativeWindowAndroid.h
  32. 2 2
      include/anki/core/NativeWindowEglFbdev.h
  33. 2 2
      include/anki/core/NativeWindowSdl.h
  34. 5 4
      include/anki/core/StdinListener.h
  35. 2 2
      include/anki/core/Threadpool.h
  36. 2 2
      include/anki/core/Timestamp.h
  37. 17 19
      include/anki/core/Trace.h
  38. 5 4
      include/anki/event/AnimationEvent.h
  39. 10 9
      include/anki/event/Event.h
  40. 2 2
      include/anki/event/EventManager.h
  41. 2 2
      include/anki/event/FollowPathEvent.h
  42. 7 6
      include/anki/event/JitterMoveEvent.h
  43. 5 4
      include/anki/event/LightEvent.h
  44. 2 2
      include/anki/event/MainRendererPpsHdrEvent.h
  45. 7 6
      include/anki/event/SceneAmbientColorEvent.h
  46. 3 2
      include/anki/gr/Buffer.h
  47. 47 26
      include/anki/gr/CommandBuffer.h
  48. 5 5
      include/anki/gr/Common.h
  49. 26 25
      include/anki/gr/Enums.h
  50. 3 3
      include/anki/gr/Framebuffer.h
  51. 6 5
      include/anki/gr/GrManager.h
  52. 5 4
      include/anki/gr/GrObject.h
  53. 3 3
      include/anki/gr/OcclusionQuery.h
  54. 11 10
      include/anki/gr/Pipeline.h
  55. 3 3
      include/anki/gr/ResourceGroup.h
  56. 6 5
      include/anki/gr/Sampler.h
  57. 10 10
      include/anki/gr/Shader.h
  58. 3 2
      include/anki/gr/Texture.h
  59. 5 3
      include/anki/gr/gl/BufferImpl.h
  60. 8 6
      include/anki/gr/gl/CommandBufferImpl.h
  61. 15 13
      include/anki/gr/gl/Common.h
  62. 5 5
      include/anki/gr/gl/Error.h
  63. 7 6
      include/anki/gr/gl/FramebufferImpl.h
  64. 3 2
      include/anki/gr/gl/GlObject.h
  65. 16 15
      include/anki/gr/gl/GlState.h
  66. 2 2
      include/anki/gr/gl/GrManagerImpl.h
  67. 5 4
      include/anki/gr/gl/OcclusionQueryImpl.h
  68. 7 5
      include/anki/gr/gl/PipelineImpl.h
  69. 4 3
      include/anki/gr/gl/RenderingThread.h
  70. 10 6
      include/anki/gr/gl/ResourceGroupImpl.h
  71. 5 3
      include/anki/gr/gl/SamplerImpl.h
  72. 5 4
      include/anki/gr/gl/ShaderImpl.h
  73. 11 6
      include/anki/gr/gl/TextureImpl.h
  74. 5 4
      include/anki/input/Input.h
  75. 9 8
      include/anki/input/InputSdl.h
  76. 2 2
      include/anki/input/KeyCode.h
  77. 19 14
      include/anki/math/Axisang.h
  78. 5 5
      include/anki/math/Euler.h
  79. 4 3
      include/anki/math/F16.h
  80. 30 15
      include/anki/math/Forward.h
  81. 14 15
      include/anki/math/Functions.h
  82. 14 12
      include/anki/math/Mat.h
  83. 20 19
      include/anki/math/Mat3.h
  84. 57 45
      include/anki/math/Mat3x4.h
  85. 5 5
      include/anki/math/Mat3x4.inl.h
  86. 85 47
      include/anki/math/Mat4.h
  87. 11 8
      include/anki/math/Mat4.inl.h
  88. 35 27
      include/anki/math/Quat.h
  89. 4 5
      include/anki/math/Simd.h
  90. 6 5
      include/anki/math/Transform.h
  91. 4 4
      include/anki/math/Vec.h
  92. 13 8
      include/anki/math/Vec2.h
  93. 15 9
      include/anki/math/Vec3.h
  94. 21 13
      include/anki/math/Vec4.h
  95. 8 8
      include/anki/math/Vec4.inl.h
  96. 5 4
      include/anki/misc/ConfigSet.h
  97. 13 10
      include/anki/misc/Xml.h
  98. 3 3
      include/anki/physics/Common.h
  99. 0 1
      include/anki/physics/Forward.h
  100. 5 8
      include/anki/physics/PhysicsBody.h

+ 92 - 0
.clang-format

@@ -0,0 +1,92 @@
+---
+Language:        Cpp
+# BasedOnStyle:  LLVM
+AccessModifierOffset: -4
+AlignAfterOpenBracket: DontAlign
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlinesLeft: false
+AlignOperands:   false
+AlignTrailingComments: false
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: None
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: true
+BinPackArguments: false
+BinPackParameters: false
+BraceWrapping:
+  AfterClass:      true
+  AfterControlStatement: true
+  AfterEnum:       true
+  AfterFunction:   true
+  AfterNamespace:  true
+  AfterObjCDeclaration: true
+  AfterStruct:     true
+  AfterUnion:      true
+  BeforeCatch:     true
+  BeforeElse:      true
+  IndentBraces:    false
+BreakBeforeBinaryOperators: NonAssignment
+BreakBeforeBraces: Custom
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializersBeforeComma: true
+ColumnLimit:     80
+CommentPragmas:  '^ IWYU pragma:'
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DerivePointerAlignment: false
+DisableFormat:   false
+ExperimentalAutoDetectBinPacking: false
+ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
+IncludeCategories:
+IncludeCategories:
+  - Regex:           '^"(llvm|llvm-c|clang|clang-c)/'
+    Priority:        2
+  - Regex:           '^(<|"(gtest|isl|json)/)'
+    Priority:        3
+  - Regex:           '.\*'
+    Priority:        1
+IndentCaseLabels: false
+IndentWidth:     4
+IndentWrappedFunctionNames: false
+KeepEmptyLinesAtTheStartOfBlocks: true
+MacroBlockBegin: ''
+MacroBlockEnd:   ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBlockIndentWidth: 2
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: true
+PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 60
+PointerAlignment: Left
+ReflowComments:  true
+SortIncludes:    true
+SpaceAfterCStyleCast: false
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: Never
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles:  false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard:        Cpp11
+TabWidth:        4
+UseTab:          Always
+SpaceAfterTemplateKeyword: false
+...
+

+ 0 - 1
include/anki/AnKi.h

@@ -9,4 +9,3 @@
 #include <anki/Math.h>
 #include <anki/Scene.h>
 #include <anki/Event.h>
-

+ 0 - 1
include/anki/Collision.h

@@ -19,4 +19,3 @@
 #include <anki/collision/GjkEpa.h>
 #include <anki/collision/Functions.h>
 #include <anki/collision/Tests.h>
-

+ 0 - 1
include/anki/Event.h

@@ -11,4 +11,3 @@
 #include <anki/event/LightEvent.h>
 #include <anki/event/JitterMoveEvent.h>
 #include <anki/event/AnimationEvent.h>
-

+ 0 - 1
include/anki/Gr.h

@@ -24,4 +24,3 @@
 #include <anki/gr/OcclusionQuery.h>
 #include <anki/gr/ResourceGroup.h>
 #include <anki/gr/GrManager.h>
-

+ 0 - 1
include/anki/Math.h

@@ -10,4 +10,3 @@
 #include <anki/math/Functions.h>
 
 /// @defgroup math Math library
-

+ 0 - 1
include/anki/Renderer.h

@@ -11,4 +11,3 @@
 #include <anki/renderer/Dbg.h>
 
 /// @defgroup renderer Renderering system
-

+ 0 - 1
include/anki/Resource.h

@@ -16,4 +16,3 @@
 /// @ingroup resource
 
 #include <anki/resource/ResourceManager.h>
-

+ 0 - 1
include/anki/Ui.h

@@ -10,4 +10,3 @@
 #include <anki/ui/UiInterfaceImpl.h>
 #include <anki/ui/Canvas.h>
 #include <anki/ui/Widget.h>
-

+ 0 - 1
include/anki/Util.h

@@ -66,4 +66,3 @@
 #include <anki/util/System.h>
 #include <anki/util/Thread.h>
 #include <anki/util/Visitor.h>
-

+ 5 - 4
include/anki/collision/Aabb.h

@@ -8,13 +8,14 @@
 #include <anki/collision/ConvexShape.h>
 #include <anki/math/Vec3.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup collision
 /// @{
 
 /// Axis align bounding box collision shape
-class Aabb: public ConvexShape
+class Aabb : public ConvexShape
 {
 public:
 	using Base = ConvexShape;
@@ -26,7 +27,8 @@ public:
 
 	Aabb()
 		: Base(Type::AABB)
-	{}
+	{
+	}
 
 	Aabb(const Vec4& min, const Vec4& max)
 		: Base(Type::AABB)
@@ -124,4 +126,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 12 - 9
include/anki/collision/CollisionShape.h

@@ -11,7 +11,8 @@
 #include <anki/util/StdTypes.h>
 #include <anki/util/Visitor.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup collision
 /// @{
@@ -23,7 +24,7 @@ class CollisionShape
 public:
 	/// Collision shape type
 	/// @note WARNING: Order is important
-	enum class Type: U8
+	enum class Type : U8
 	{
 		PLANE,
 		LINE_SEG,
@@ -42,7 +43,8 @@ public:
 	{
 	public:
 		virtual ~MutableVisitor()
-		{}
+		{
+		}
 
 		virtual void visit(LineSegment&) = 0;
 		virtual void visit(Obb&) = 0;
@@ -58,7 +60,8 @@ public:
 	{
 	public:
 		virtual ~ConstVisitor()
-		{}
+		{
+		}
 
 		virtual void visit(const LineSegment&) = 0;
 		virtual void visit(const Obb&) = 0;
@@ -71,7 +74,8 @@ public:
 
 	CollisionShape(Type cid)
 		: m_cid(cid)
-	{}
+	{
+	}
 
 	CollisionShape(const CollisionShape& b)
 		: m_cid(b.m_cid)
@@ -80,7 +84,8 @@ public:
 	}
 
 	virtual ~CollisionShape()
-	{}
+	{
+	}
 
 	CollisionShape& operator=(const CollisionShape& b)
 	{
@@ -115,8 +120,7 @@ protected:
 	/// Function that iterates a point cloud
 	template<typename TFunc>
 	void iteratePointCloud(
-		const void* buff, U count, PtrSize stride, PtrSize buffSize,
-		TFunc func)
+		const void* buff, U count, PtrSize stride, PtrSize buffSize, TFunc func)
 	{
 		ANKI_ASSERT(buff);
 		ANKI_ASSERT(count > 1);
@@ -144,4 +148,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 2 - 2
include/anki/collision/Common.h

@@ -8,7 +8,8 @@
 #include <anki/collision/Forward.h>
 #include <anki/util/Allocator.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup collision
 /// @{
@@ -22,4 +23,3 @@ using CollisionAllocator = ChainAllocator<T>;
 /// @}
 
 } // end namespace anki
-

+ 3 - 3
include/anki/collision/CompoundShape.h

@@ -8,13 +8,14 @@
 #include <anki/collision/CollisionShape.h>
 #include <anki/util/NonCopyable.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup collision
 /// @{
 
 /// A shape that contains other shapes
-class CompoundShape: public CollisionShape, public NonCopyable
+class CompoundShape : public CollisionShape, public NonCopyable
 {
 public:
 	static Bool classof(const CollisionShape& c)
@@ -92,4 +93,3 @@ Error CompoundShape::iterateShapes(TFunc f) const
 /// @}
 
 } // end namespace anki
-

+ 2 - 2
include/anki/collision/ContactPoint.h

@@ -7,7 +7,8 @@
 
 #include <anki/Math.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup collision
 /// @{
@@ -24,4 +25,3 @@ public:
 /// @}
 
 } // end namespace anki
-

+ 5 - 4
include/anki/collision/ConvexHullShape.h

@@ -9,13 +9,14 @@
 #include <anki/Math.h>
 #include <anki/util/NonCopyable.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup collision
 /// @{
 
 /// Convex hull collision shape
-class ConvexHullShape: public NonCopyable, public ConvexShape
+class ConvexHullShape : public NonCopyable, public ConvexShape
 {
 public:
 	using Base = ConvexShape;
@@ -27,7 +28,8 @@ public:
 
 	ConvexHullShape()
 		: Base(Type::CONVEX_HULL)
-	{}
+	{
+	}
 
 	ConvexHullShape(ConvexHullShape&& b)
 		: Base(Type::CONVEX_HULL)
@@ -121,4 +123,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 7 - 6
include/anki/collision/ConvexShape.h

@@ -7,23 +7,25 @@
 
 #include <anki/collision/CollisionShape.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup collision
 /// @{
 
 /// Abstact class for convex collision shapes
-class ConvexShape: public CollisionShape
+class ConvexShape : public CollisionShape
 {
 public:
 	using Base = CollisionShape;
 
 	ConvexShape(Type cid)
-	:	Base(cid)
-	{}
+		: Base(cid)
+	{
+	}
 
 	ConvexShape(const ConvexShape& b)
-	:	Base(b)
+		: Base(b)
 	{
 		operator=(b);
 	}
@@ -46,4 +48,3 @@ public:
 /// @}
 
 } // end namespace anki
-

+ 2 - 2
include/anki/collision/Forward.h

@@ -5,7 +5,8 @@
 
 #pragma once
 
-namespace anki {
+namespace anki
+{
 
 class CollisionShape;
 
@@ -21,4 +22,3 @@ class ConvexHullShape;
 class ContactPoint;
 
 } // end namespace anki
-

+ 16 - 15
include/anki/collision/Frustum.h

@@ -12,25 +12,26 @@
 #include <anki/Math.h>
 #include <anki/util/Array.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup Collision
 /// @{
 
 /// Frustum collision shape. This shape consists from 6 planes. The planes are
 /// being used to find shapes that are inside the frustum
-class Frustum: public CompoundShape
+class Frustum : public CompoundShape
 {
 public:
 	/// Frustum type
-	enum class Type: U8
+	enum class Type : U8
 	{
 		PERSPECTIVE,
 		ORTHOGRAPHIC
 	};
 
 	/// The 6 frustum planes
-	enum class PlaneType: U8
+	enum class PlaneType : U8
 	{
 		NEAR,
 		FAR,
@@ -43,10 +44,12 @@ public:
 
 	Frustum(Type type)
 		: m_type(type)
-	{}
+	{
+	}
 
 	virtual ~Frustum()
-	{}
+	{
+	}
 
 	Type getType() const
 	{
@@ -138,7 +141,7 @@ private:
 };
 
 /// Frustum shape for perspective cameras
-class PerspectiveFrustum: public Frustum
+class PerspectiveFrustum : public Frustum
 {
 public:
 	static Bool classof(const Frustum& c)
@@ -219,8 +222,8 @@ public:
 	/// Implements Frustum::calculateProjectionMatrix
 	Mat4 calculateProjectionMatrix() const override;
 
-	static void calculateProjectionMatrix(F32 fovX, F32 fovY, F32 near, F32 far,
-		Mat4& proj);
+	static void calculateProjectionMatrix(
+		F32 fovX, F32 fovY, F32 near, F32 far, Mat4& proj);
 
 private:
 	/// @name Viewing variables
@@ -245,7 +248,7 @@ private:
 };
 
 /// Frustum shape for orthographic cameras
-class OrthographicFrustum: public Frustum
+class OrthographicFrustum : public Frustum
 {
 public:
 	static Bool classof(const Frustum& c)
@@ -264,8 +267,8 @@ public:
 	}
 
 	/// Set all
-	OrthographicFrustum(F32 left, F32 right, F32 near,
-		F32 far, F32 top, F32 bottom)
+	OrthographicFrustum(
+		F32 left, F32 right, F32 near, F32 far, F32 top, F32 bottom)
 		: OrthographicFrustum()
 	{
 		setAll(left, right, near, far, top, bottom);
@@ -312,8 +315,7 @@ public:
 	}
 
 	/// Set all
-	void setAll(F32 left, F32 right, F32 near,
-		F32 far, F32 top, F32 bottom)
+	void setAll(F32 left, F32 right, F32 near, F32 far, F32 top, F32 bottom)
 	{
 		m_left = left;
 		m_right = right;
@@ -364,4 +366,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 4 - 4
include/anki/collision/Functions.h

@@ -8,7 +8,8 @@
 #include <anki/collision/Plane.h>
 #include <anki/collision/Frustum.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup collision
 /// @{
@@ -19,10 +20,9 @@ namespace anki {
 /// @param[out] planes Pointers to the planes. Elements can be nullptr
 ///
 /// @note plane_count * 8 muls, plane_count sqrt
-extern void extractClipPlanes(const Mat4& mvp,
-	Plane* planes[(U)Frustum::PlaneType::COUNT]);
+extern void extractClipPlanes(
+	const Mat4& mvp, Plane* planes[(U)Frustum::PlaneType::COUNT]);
 
 /// @}
 
 } // end namespace anki
-

+ 6 - 4
include/anki/collision/GjkEpa.h

@@ -7,7 +7,8 @@
 
 #include <anki/Math.h>
 
-namespace anki {
+namespace anki
+{
 
 // Forward
 class ConvexShape;
@@ -51,8 +52,10 @@ private:
 	Vec4 m_dir;
 
 	/// Compute the support
-	static void support(const ConvexShape& shape0, const ConvexShape& shape1,
-		const Vec4& dir, Support& support);
+	static void support(const ConvexShape& shape0,
+		const ConvexShape& shape1,
+		const Vec4& dir,
+		Support& support);
 
 	/// Update simplex
 	Bool update(const Support& a);
@@ -60,4 +63,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 17 - 15
include/anki/collision/GjkEpaInternal.h

@@ -8,8 +8,10 @@
 #include <anki/Math.h>
 #include <anki/collision/Common.h>
 
-namespace anki {
-namespace detail {
+namespace anki
+{
+namespace detail
+{
 
 // Forward
 class Polytope;
@@ -26,9 +28,10 @@ public:
 	Face* m_face;
 
 	Edge(U32 i, U32 j, Face* face)
-	:	m_idx{{i, j}},
-		m_face(face)
-	{}
+		: m_idx{{i, j}}
+		, m_face(face)
+	{
+	}
 
 	Edge(const Edge&) = default;
 
@@ -80,7 +83,7 @@ public:
 	}
 
 	Face(U i, U j, U k)
-	:	Face()
+		: Face()
 	{
 		m_idx[0] = i;
 		m_idx[1] = j;
@@ -137,14 +140,14 @@ class Polytope
 	friend class Face;
 
 public:
-	Polytope(CollisionTempAllocator<U8>& alloc,
-		U32 maxSimplexSize,
-		U32 maxFaceCount)
-	:	m_maxSimplexSize(maxSimplexSize),
-		m_maxFaceCount(maxFaceCount),
-		m_simplex(alloc),
-		m_faces(alloc)
-	{}
+	Polytope(
+		CollisionTempAllocator<U8>& alloc, U32 maxSimplexSize, U32 maxFaceCount)
+		: m_maxSimplexSize(maxSimplexSize)
+		, m_maxFaceCount(maxFaceCount)
+		, m_simplex(alloc)
+		, m_faces(alloc)
+	{
+	}
 
 	void init(const Array<Support, 4>& gjkSupport);
 
@@ -187,4 +190,3 @@ public: // XXX
 
 } // end namesapce detail
 } // end namesapce anki
-

+ 14 - 12
include/anki/collision/LineSegment.h

@@ -8,14 +8,15 @@
 #include <anki/collision/CollisionShape.h>
 #include <anki/math/Vec3.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup Collision
 /// @{
 
 /// Line segment. Line from a point to a point. P0 = origin and
 /// P1 = direction + origin
-class LineSegment: public CollisionShape
+class LineSegment : public CollisionShape
 {
 public:
 	using Base = CollisionShape;
@@ -26,19 +27,21 @@ public:
 	}
 
 	LineSegment()
-	:	Base(Type::LINE_SEG),
-		m_origin(0.0),
-		m_dir(0.0)
-	{}
+		: Base(Type::LINE_SEG)
+		, m_origin(0.0)
+		, m_dir(0.0)
+	{
+	}
 
 	LineSegment(const Vec4& origin, const Vec4& direction)
-	:	Base(Type::LINE_SEG),
-		m_origin(origin),
-		m_dir(direction)
-	{}
+		: Base(Type::LINE_SEG)
+		, m_origin(origin)
+		, m_dir(direction)
+	{
+	}
 
 	LineSegment(const LineSegment& b)
-	:	Base(Type::LINE_SEG)
+		: Base(Type::LINE_SEG)
 	{
 		operator=(b);
 	}
@@ -113,4 +116,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 3 - 3
include/anki/collision/Obb.h

@@ -10,13 +10,14 @@
 #include <anki/Math.h>
 #include <anki/util/Array.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup collision
 /// @{
 
 /// Object oriented bounding box
-class Obb: public ConvexShape
+class Obb : public ConvexShape
 {
 public:
 	using Base = ConvexShape;
@@ -134,4 +135,3 @@ public:
 /// @}
 
 } // end namespace anki
-

+ 7 - 6
include/anki/collision/Plane.h

@@ -8,13 +8,14 @@
 #include <anki/collision/CollisionShape.h>
 #include <anki/Math.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup collision
 /// @{
 
 /// Plane collision shape
-class Plane: public CollisionShape
+class Plane : public CollisionShape
 {
 public:
 	using Base = CollisionShape;
@@ -27,7 +28,8 @@ public:
 	/// Default constructor
 	Plane()
 		: CollisionShape(Type::PLANE)
-	{}
+	{
+	}
 
 	/// Copy constructor
 	Plane(const Plane& b)
@@ -140,8 +142,8 @@ public:
 
 	/// Find the intersection point of this plane and a ray. If the ray hits
 	/// the back of the plane then there is no intersection.
-	Bool intersectRay(const Vec4& rayOrigin, const Vec4& rayDir,
-		Vec4& intersection) const;
+	Bool intersectRay(
+		const Vec4& rayOrigin, const Vec4& rayDir, Vec4& intersection) const;
 
 	/// Test a CollisionShape
 	template<typename T>
@@ -166,4 +168,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 12 - 10
include/anki/collision/Sphere.h

@@ -8,13 +8,14 @@
 #include <anki/collision/ConvexShape.h>
 #include <anki/Math.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup collision
 /// @{
 
 /// Sphere collision shape
-class Sphere: public ConvexShape
+class Sphere : public ConvexShape
 {
 public:
 	using Base = ConvexShape;
@@ -26,22 +27,24 @@ public:
 
 	/// Default constructor
 	Sphere()
-	:	Base(Type::SPHERE)
-	{}
+		: Base(Type::SPHERE)
+	{
+	}
 
 	/// Copy constructor
 	Sphere(const Sphere& b)
-	:	Base(Type::SPHERE)
+		: Base(Type::SPHERE)
 	{
 		operator=(b);
 	}
 
 	/// Constructor
 	Sphere(const Vec4& center, F32 radius)
-	:	Base(Type::SPHERE),
-		m_center(center),
-		m_radius(radius)
-	{}
+		: Base(Type::SPHERE)
+		, m_center(center)
+		, m_radius(radius)
+	{
+	}
 
 	const Vec4& getCenter() const
 	{
@@ -124,4 +127,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 2 - 2
include/anki/collision/Tests.h

@@ -7,7 +7,8 @@
 
 #include <anki/collision/Common.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup collision
 /// @{
@@ -17,4 +18,3 @@ Bool testCollisionShapes(const CollisionShape& a, const CollisionShape& b);
 /// @}
 
 } // end namespace anki
-

+ 9 - 6
include/anki/core/App.h

@@ -10,10 +10,11 @@
 #include <anki/util/Ptr.h>
 #include <anki/core/Timestamp.h>
 #if ANKI_OS == ANKI_OS_ANDROID
-#	include <android_native_app_glue.h>
+#include <android_native_app_glue.h>
 #endif
 
-namespace anki {
+namespace anki
+{
 
 #if ANKI_OS == ANKI_OS_ANDROID
 extern android_app* gAndroidApp;
@@ -40,13 +41,15 @@ class App
 
 public:
 	/// User callback of main loop
-	using UserMainLoopCallback = Error(*)(App& app, void* userData, Bool& quit);
+	using UserMainLoopCallback = Error (*)(
+		App& app, void* userData, Bool& quit);
 
 	App();
 	~App();
 
 	ANKI_USE_RESULT Error create(const ConfigSet& config,
-		AllocAlignedCallback allocCb, void* allocCbUserData);
+		AllocAlignedCallback allocCb,
+		void* allocCbUserData);
 
 	F32 getTimerTick() const
 	{
@@ -161,7 +164,8 @@ private:
 	F32 m_timerTick;
 
 	ANKI_USE_RESULT Error createInternal(const ConfigSet& config,
-		AllocAlignedCallback allocCb, void* allocCbUserData);
+		AllocAlignedCallback allocCb,
+		void* allocCbUserData);
 
 	ANKI_USE_RESULT Error initDirs();
 	void cleanup();
@@ -171,4 +175,3 @@ private:
 };
 
 } // end namespace anki
-

+ 3 - 3
include/anki/core/Config.h

@@ -7,13 +7,14 @@
 
 #include <anki/misc/ConfigSet.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup core
 /// @{
 
 /// Global configuration set
-class Config: public ConfigSet
+class Config : public ConfigSet
 {
 public:
 	Config();
@@ -22,4 +23,3 @@ public:
 /// @}
 
 } // end namespace anki
-

+ 4 - 3
include/anki/core/NativeWindow.h

@@ -10,7 +10,8 @@
 #include <anki/util/String.h>
 #include <anki/util/Allocator.h>
 
-namespace anki {
+namespace anki
+{
 
 class NativeWindowImpl;
 using Context = void*;
@@ -47,7 +48,8 @@ public:
 	};
 
 	NativeWindow()
-	{}
+	{
+	}
 
 	~NativeWindow()
 	{
@@ -101,4 +103,3 @@ private:
 };
 
 } // end namespace anki
-

+ 2 - 2
include/anki/core/NativeWindowAndroid.h

@@ -10,7 +10,8 @@
 #include <GLES3/gl3.h>
 #include <android_native_app_glue.h>
 
-namespace anki {
+namespace anki
+{
 
 /// Native window implementation for Android
 struct NativeWindowImpl
@@ -29,4 +30,3 @@ struct NativeWindowImpl
 };
 
 } // end namespace anki
-

+ 2 - 2
include/anki/core/NativeWindowEglFbdev.h

@@ -10,7 +10,8 @@
 #include <EGL/egl.h>
 #include <GLES3/gl3.h>
 
-namespace anki {
+namespace anki
+{
 
 /// Native window implementation for EGL & FBDEV
 struct NativeWindowImpl
@@ -30,4 +31,3 @@ struct NativeWindowImpl
 };
 
 } // end namespace anki
-

+ 2 - 2
include/anki/core/NativeWindowSdl.h

@@ -8,7 +8,8 @@
 #include <anki/core/NativeWindow.h>
 #include <SDL.h>
 
-namespace anki {
+namespace anki
+{
 
 static_assert(sizeof(SDL_GLContext) == sizeof(void*), "Incorrect assumption");
 
@@ -21,4 +22,3 @@ public:
 };
 
 } // end namespace anki
-

+ 5 - 4
include/anki/core/StdinListener.h

@@ -9,7 +9,8 @@
 #include <anki/util/Thread.h>
 #include <anki/util/List.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup core
 /// @{
@@ -21,8 +22,9 @@ class StdinListener
 {
 public:
 	StdinListener()
-	:	m_thrd("anki_stdin")
-	{}
+		: m_thrd("anki_stdin")
+	{
+	}
 
 	~StdinListener();
 
@@ -44,4 +46,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 2 - 2
include/anki/core/Threadpool.h

@@ -8,10 +8,10 @@
 #include <anki/util/Thread.h>
 #include <anki/util/Singleton.h>
 
-namespace anki {
+namespace anki
+{
 
 /// Singleton
 typedef Singleton<ThreadPool> ThreadPoolSingleton;
 
 } // end namespace anki
-

+ 2 - 2
include/anki/core/Timestamp.h

@@ -7,7 +7,8 @@
 
 #include <anki/util/StdTypes.h>
 
-namespace anki {
+namespace anki
+{
 
 /// Timestamp type
 using Timestamp = U32;
@@ -15,4 +16,3 @@ using Timestamp = U32;
 const U MAX_TIMESTAMP = MAX_U32;
 
 } // end namespace anki
-

+ 17 - 19
include/anki/core/Trace.h

@@ -14,7 +14,8 @@
 #include <anki/util/Logger.h>
 #include <anki/util/File.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup core
 /// @{
@@ -62,12 +63,13 @@ class TraceManager
 {
 public:
 	TraceManager()
-	{}
+	{
+	}
 
 	~TraceManager();
 
-	ANKI_USE_RESULT Error create(HeapAllocator<U8> alloc,
-		const CString& cacheDir);
+	ANKI_USE_RESULT Error create(
+		HeapAllocator<U8> alloc, const CString& cacheDir);
 
 	void startEvent();
 
@@ -119,31 +121,27 @@ using TraceManagerSingleton = Singleton<TraceManager>;
 
 #if ANKI_ENABLE_TRACE
 
-#	define ANKI_TRACE_START_EVENT(name_) \
-	TraceManagerSingleton::get().startEvent()
+#define ANKI_TRACE_START_EVENT(name_) TraceManagerSingleton::get().startEvent()
 
-#	define ANKI_TRACE_STOP_EVENT(name_) \
+#define ANKI_TRACE_STOP_EVENT(name_)                                           \
 	TraceManagerSingleton::get().stopEvent(TraceEventType::name_)
 
-#	define ANKI_TRACE_INC_COUNTER(name_, val_) \
-	TraceManagerSingleton::get().incCounter(TraceCounterType:: name_, val_)
+#define ANKI_TRACE_INC_COUNTER(name_, val_)                                    \
+	TraceManagerSingleton::get().incCounter(TraceCounterType::name_, val_)
 
-#	define ANKI_TRACE_START_FRAME() \
-	TraceManagerSingleton::get().startFrame()
+#define ANKI_TRACE_START_FRAME() TraceManagerSingleton::get().startFrame()
 
-#	define ANKI_TRACE_STOP_FRAME() \
-	TraceManagerSingleton::get().stopFrame()
+#define ANKI_TRACE_STOP_FRAME() TraceManagerSingleton::get().stopFrame()
 
 #else
 
-#	define ANKI_TRACE_START_EVENT(name_) ((void)0)
-#	define ANKI_TRACE_STOP_EVENT(name_) ((void)0)
-#	define ANKI_TRACE_INC_COUNTER(name_, val_) ((void)0)
-#	define ANKI_TRACE_START_FRAME() ((void)0)
-#	define ANKI_TRACE_STOP_FRAME() ((void)0)
+#define ANKI_TRACE_START_EVENT(name_) ((void)0)
+#define ANKI_TRACE_STOP_EVENT(name_) ((void)0)
+#define ANKI_TRACE_INC_COUNTER(name_, val_) ((void)0)
+#define ANKI_TRACE_START_FRAME() ((void)0)
+#define ANKI_TRACE_STOP_FRAME() ((void)0)
 
 #endif
 /// @}
 
 } // end namespace anki
-

+ 5 - 4
include/anki/event/AnimationEvent.h

@@ -6,19 +6,20 @@
 #include <anki/event/Event.h>
 #include <anki/resource/Animation.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup event
 /// @{
 
 /// Event controled by animation resource
-class AnimationEvent: public Event
+class AnimationEvent : public Event
 {
 public:
 	AnimationEvent(EventManager* manager);
 
-	ANKI_USE_RESULT Error init(const AnimationResourcePtr& anim,
-		SceneNode* movableSceneNode);
+	ANKI_USE_RESULT Error init(
+		const AnimationResourcePtr& anim, SceneNode* movableSceneNode);
 
 	/// Implements Event::update
 	ANKI_USE_RESULT Error update(F32 prevUpdateTime, F32 crntTime) override;

+ 10 - 9
include/anki/event/Event.h

@@ -9,7 +9,8 @@
 #include <anki/Math.h>
 #include <anki/util/Enum.h>
 
-namespace anki {
+namespace anki
+{
 
 // Forward
 class EventManager;
@@ -26,7 +27,7 @@ class Event
 
 public:
 	/// Event flags
-	enum class Flag: U8
+	enum class Flag : U8
 	{
 		NONE = 0,
 		REANIMATE = 1 << 0,
@@ -39,8 +40,10 @@ public:
 
 	virtual ~Event();
 
-	void init(F32 startTime, F32 duration,
-		SceneNode* snode = nullptr, Flag flags = Flag::NONE);
+	void init(F32 startTime,
+		F32 duration,
+		SceneNode* snode = nullptr,
+		Flag flags = Flag::NONE);
 
 	F32 getStartTime() const
 	{
@@ -86,9 +89,8 @@ public:
 
 	void setReanimate(Bool reanimate)
 	{
-		m_flags = (reanimate)
-			? (m_flags | Flag::REANIMATE)
-			: (m_flags & ~Flag::REANIMATE);
+		m_flags = (reanimate) ? (m_flags | Flag::REANIMATE)
+							  : (m_flags & ~Flag::REANIMATE);
 	}
 
 	Bool getReanimate() const
@@ -122,7 +124,7 @@ protected:
 	EventManager* m_manager = nullptr;
 
 	F32 m_startTime; ///< The time the event will start. Eg 23:00. If it's < 0
-	                 ///< then start the event now.
+	///< then start the event now.
 	F32 m_duration; ///< The duration of the event
 
 	SceneNode* m_node = nullptr;
@@ -136,4 +138,3 @@ protected:
 /// @}
 
 } // end namespace anki
-

+ 2 - 2
include/anki/event/EventManager.h

@@ -11,7 +11,8 @@
 #include <anki/scene/Common.h>
 #include <anki/Math.h>
 
-namespace anki {
+namespace anki
+{
 
 // Forward
 class SceneGraph;
@@ -105,4 +106,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 2 - 2
include/anki/event/FollowPathEvent.h

@@ -8,7 +8,8 @@
 #include <anki/event/Event.h>
 #include <anki/scene/SceneNode.h>
 
-namespace anki {
+namespace anki
+{
 
 #if 0
 
@@ -36,4 +37,3 @@ private:
 #endif
 
 } // end namespace anki
-

+ 7 - 6
include/anki/event/JitterMoveEvent.h

@@ -8,22 +8,24 @@
 #include <anki/event/Event.h>
 #include <anki/Math.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup event
 /// @{
 
 /// An event for simple movable animations
-class JitterMoveEvent: public Event
+class JitterMoveEvent : public Event
 {
 public:
 	/// Constructor
 	JitterMoveEvent(EventManager* manager)
 		: Event(manager)
-	{}
+	{
+	}
 
-	ANKI_USE_RESULT Error init(F32 startTime, F32 duration,
-		SceneNode* movableSceneNode);
+	ANKI_USE_RESULT Error init(
+		F32 startTime, F32 duration, SceneNode* movableSceneNode);
 
 	/// Implements Event::update
 	ANKI_USE_RESULT Error update(F32 prevUpdateTime, F32 crntTime);
@@ -37,4 +39,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 5 - 4
include/anki/event/LightEvent.h

@@ -8,7 +8,8 @@
 #include <anki/event/Event.h>
 #include <anki/Math.h>
 
-namespace anki {
+namespace anki
+{
 
 // Forward
 class Light;
@@ -17,13 +18,14 @@ class Light;
 /// @{
 
 /// An event for light animation
-class LightEvent: public Event
+class LightEvent : public Event
 {
 public:
 	/// Create
 	LightEvent(EventManager* manager)
 		: Event(manager)
-	{}
+	{
+	}
 
 	ANKI_USE_RESULT Error init(F32 startTime, F32 duration, SceneNode* light);
 
@@ -70,4 +72,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 2 - 2
include/anki/event/MainRendererPpsHdrEvent.h

@@ -8,7 +8,8 @@
 #include <anki/event/Event.h>
 #include <cstdint>
 
-namespace anki {
+namespace anki
+{
 
 #if 0
 
@@ -44,4 +45,3 @@ private:
 #endif
 
 } // end namespace
-

+ 7 - 6
include/anki/event/SceneAmbientColorEvent.h

@@ -8,22 +8,24 @@
 #include <anki/event/Event.h>
 #include <anki/Math.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup event
 /// @{
 
 /// Change the scene color
-class SceneAmbientColorEvent: public Event
+class SceneAmbientColorEvent : public Event
 {
 public:
 	/// Create
 	SceneAmbientColorEvent(EventManager* manager)
 		: Event(manager)
-	{}
+	{
+	}
 
-	ANKI_USE_RESULT Error init(F32 startTime, F32 duration,
-		const Vec4& finalColor);
+	ANKI_USE_RESULT Error init(
+		F32 startTime, F32 duration, const Vec4& finalColor);
 
 	/// Implements Event::update
 	ANKI_USE_RESULT Error update(F32 prevUpdateTime, F32 crntTime);
@@ -35,4 +37,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 3 - 2
include/anki/gr/Buffer.h

@@ -7,13 +7,14 @@
 
 #include <anki/gr/GrObject.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup graphics
 /// @{
 
 /// GPU buffer.
-class Buffer: public GrObject
+class Buffer : public GrObject
 {
 public:
 	/// Construct.

+ 47 - 26
include/anki/gr/CommandBuffer.h

@@ -8,7 +8,8 @@
 #include <anki/gr/GrObject.h>
 #include <anki/util/Functions.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup graphics
 /// @{
@@ -19,16 +20,21 @@ class DrawElementsIndirectInfo
 {
 public:
 	DrawElementsIndirectInfo()
-	{}
+	{
+	}
 
-	DrawElementsIndirectInfo(U32 count, U32 instanceCount, U32 firstIndex,
-		U32 baseVertex, U32 baseInstance)
+	DrawElementsIndirectInfo(U32 count,
+		U32 instanceCount,
+		U32 firstIndex,
+		U32 baseVertex,
+		U32 baseInstance)
 		: m_count(count)
 		, m_instanceCount(instanceCount)
 		, m_firstIndex(firstIndex)
 		, m_baseVertex(baseVertex)
 		, m_baseInstance(baseInstance)
-	{}
+	{
+	}
 
 	U32 m_count = MAX_U32;
 	U32 m_instanceCount = 1;
@@ -43,15 +49,17 @@ class DrawArraysIndirectInfo
 {
 public:
 	DrawArraysIndirectInfo()
-	{}
+	{
+	}
 
-	DrawArraysIndirectInfo(U32 count, U32 instanceCount, U32 first,
-		U32 baseInstance)
+	DrawArraysIndirectInfo(
+		U32 count, U32 instanceCount, U32 first, U32 baseInstance)
 		: m_count(count)
 		, m_instanceCount(instanceCount)
 		, m_first(first)
 		, m_baseInstance(baseInstance)
-	{}
+	{
+	}
 
 	U32 m_count = MAX_U32;
 	U32 m_instanceCount = 1;
@@ -75,7 +83,7 @@ private:
 };
 
 /// Command buffer.
-class CommandBuffer: public GrObject
+class CommandBuffer : public GrObject
 {
 public:
 	/// Construct.
@@ -115,24 +123,33 @@ public:
 	void bindFramebuffer(FramebufferPtr fb);
 
 	/// Bind resources.
-	void bindResourceGroup(ResourceGroupPtr rc, U slot,
-		const DynamicBufferInfo* dynInfo);
+	void bindResourceGroup(
+		ResourceGroupPtr rc, U slot, const DynamicBufferInfo* dynInfo);
 	/// @}
 
 	/// @name Jobs
 	/// @{
-	void drawElements(U32 count, U32 instanceCount = 1, U32 firstIndex = 0,
-		U32 baseVertex = 0, U32 baseInstance = 0);
-
-	void drawArrays(U32 count, U32 instanceCount = 1, U32 first = 0,
+	void drawElements(U32 count,
+		U32 instanceCount = 1,
+		U32 firstIndex = 0,
+		U32 baseVertex = 0,
 		U32 baseInstance = 0);
 
-	void drawElementsConditional(OcclusionQueryPtr query, U32 count,
-		U32 instanceCount = 1, U32 firstIndex = 0, U32 baseVertex = 0,
+	void drawArrays(
+		U32 count, U32 instanceCount = 1, U32 first = 0, U32 baseInstance = 0);
+
+	void drawElementsConditional(OcclusionQueryPtr query,
+		U32 count,
+		U32 instanceCount = 1,
+		U32 firstIndex = 0,
+		U32 baseVertex = 0,
 		U32 baseInstance = 0);
 
-	void drawArraysConditional(OcclusionQueryPtr query, U32 count,
-		U32 instanceCount = 1, U32 first = 0, U32 baseInstance = 0);
+	void drawArraysConditional(OcclusionQueryPtr query,
+		U32 count,
+		U32 instanceCount = 1,
+		U32 first = 0,
+		U32 baseInstance = 0);
 
 	void dispatchCompute(U32 groupCountX, U32 groupCountY, U32 groupCountZ);
 
@@ -140,22 +157,26 @@ public:
 
 	void generateMipmaps(TexturePtr tex, U surface);
 
-	void copyTextureToTexture(TexturePtr src, U srcSlice, U srcLevel,
-		TexturePtr dest, U destSlice, U destLevel);
+	void copyTextureToTexture(TexturePtr src,
+		U srcSlice,
+		U srcLevel,
+		TexturePtr dest,
+		U destSlice,
+		U destLevel);
 	/// @}
 
 	/// @name Resource upload
 	/// @{
 
 	/// Upload data to a texture.
-	void textureUpload(TexturePtr tex, U32 mipmap, U32 slice,
-		const DynamicBufferToken& token);
+	void textureUpload(
+		TexturePtr tex, U32 mipmap, U32 slice, const DynamicBufferToken& token);
 
 	/// Write data to a buffer. It will copy the dynamic memory to the buffer
 	/// starting from offset to the range indicated by the allocation of the
 	/// token.
-	void writeBuffer(BufferPtr buff, PtrSize offset,
-		const DynamicBufferToken& token);
+	void writeBuffer(
+		BufferPtr buff, PtrSize offset, const DynamicBufferToken& token);
 	/// @}
 
 	/// @name Other

+ 5 - 5
include/anki/gr/Common.h

@@ -9,7 +9,8 @@
 #include <anki/util/Allocator.h>
 #include <anki/util/Ptr.h>
 
-namespace anki {
+namespace anki
+{
 
 // Forward
 class GrManager;
@@ -23,9 +24,9 @@ class FramebufferInitializer;
 class DynamicBufferToken;
 class DynamicBufferInfo;
 
-#define ANKI_GR_CLASS(x_) \
-	class x_##Impl; \
-	class x_; \
+#define ANKI_GR_CLASS(x_)                                                      \
+	class x_##Impl;                                                            \
+	class x_;                                                                  \
 	using x_##Ptr = IntrusivePtr<x_>;
 
 ANKI_GR_CLASS(Buffer)
@@ -87,4 +88,3 @@ inline U32 computeMaxMipmapCount(U32 w, U32 h)
 /// @}
 
 } // end namespace anki
-

+ 26 - 25
include/anki/gr/Enums.h

@@ -8,12 +8,13 @@
 #include <anki/util/StdTypes.h>
 #include <anki/util/Enum.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup graphics
 /// @{
 
-enum ColorBit: U8
+enum ColorBit : U8
 {
 	NONE = 0,
 	RED = 1 << 0,
@@ -24,7 +25,7 @@ enum ColorBit: U8
 };
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(ColorBit, inline)
 
-enum PrimitiveTopology: U8
+enum PrimitiveTopology : U8
 {
 	POINTS,
 	LINES,
@@ -34,21 +35,21 @@ enum PrimitiveTopology: U8
 	PATCHES
 };
 
-enum class FillMode: U8
+enum class FillMode : U8
 {
 	POINTS,
 	WIREFRAME,
 	SOLID
 };
 
-enum class CullMode: U8
+enum class CullMode : U8
 {
 	FRONT,
 	BACK,
 	FRONT_AND_BACK
 };
 
-enum class CompareOperation: U8
+enum class CompareOperation : U8
 {
 	ALWAYS,
 	LESS,
@@ -60,7 +61,7 @@ enum class CompareOperation: U8
 	NEVER
 };
 
-enum class BlendMethod: U8
+enum class BlendMethod : U8
 {
 	ZERO,
 	ONE,
@@ -83,7 +84,7 @@ enum class BlendMethod: U8
 	ONE_MINUS_SRC1_ALPHA
 };
 
-enum class BlendFunction: U8
+enum class BlendFunction : U8
 {
 	ADD,
 	SUBTRACT,
@@ -92,14 +93,14 @@ enum class BlendFunction: U8
 	MAX
 };
 
-enum class VertexStepRate: U8
+enum class VertexStepRate : U8
 {
 	VERTEX,
 	INSTANCE,
 	DRAW
 };
 
-enum class ComponentFormat: U8
+enum class ComponentFormat : U8
 {
 	NONE,
 
@@ -136,7 +137,7 @@ enum class ComponentFormat: U8
 	LAST_COMPRESSED = R8G8B8A8_ETC2
 };
 
-enum class TransformFormat: U8
+enum class TransformFormat : U8
 {
 	NONE,
 	UNORM,
@@ -146,7 +147,7 @@ enum class TransformFormat: U8
 	FLOAT
 };
 
-enum class TextureType: U8
+enum class TextureType : U8
 {
 	_1D,
 	_2D,
@@ -156,14 +157,14 @@ enum class TextureType: U8
 	CUBE_ARRAY
 };
 
-enum class SamplingFilter: U8
+enum class SamplingFilter : U8
 {
 	NEAREST,
 	LINEAR,
 	BASE ///< Only for mipmaps
 };
 
-enum class ShaderType: U8
+enum class ShaderType : U8
 {
 	VERTEX,
 	TESSELLATION_CONTROL,
@@ -176,7 +177,7 @@ enum class ShaderType: U8
 };
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(ShaderType, inline)
 
-enum class ShaderTypeBit: U8
+enum class ShaderTypeBit : U8
 {
 	NONE = 0,
 	VERTEX = 1 << 0,
@@ -188,7 +189,7 @@ enum class ShaderTypeBit: U8
 };
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(ShaderTypeBit, inline)
 
-enum class ShaderVariableDataType: U8
+enum class ShaderVariableDataType : U8
 {
 	NONE,
 	FLOAT,
@@ -226,7 +227,8 @@ public:
 		: m_components(cf)
 		, m_transform(tf)
 		, m_srgb(srgb)
-	{}
+	{
+	}
 
 	PixelFormat& operator=(const PixelFormat&) = default;
 
@@ -238,7 +240,7 @@ public:
 };
 
 /// Occlusion query result bit.
-enum class OcclusionQueryResultBit: U8
+enum class OcclusionQueryResultBit : U8
 {
 	NOT_AVAILABLE = 1 << 0,
 	VISIBLE = 1 << 1,
@@ -247,7 +249,7 @@ enum class OcclusionQueryResultBit: U8
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(OcclusionQueryResultBit, inline)
 
 /// Occlusion query result.
-enum class OcclusionQueryResult: U8
+enum class OcclusionQueryResult : U8
 {
 	NOT_AVAILABLE,
 	VISIBLE,
@@ -255,7 +257,7 @@ enum class OcclusionQueryResult: U8
 };
 
 /// Attachment load operation.
-enum class AttachmentLoadOperation: U8
+enum class AttachmentLoadOperation : U8
 {
 	LOAD,
 	CLEAR,
@@ -263,7 +265,7 @@ enum class AttachmentLoadOperation: U8
 };
 
 /// Attachment store operation.
-enum class AttachmentStoreOperation: U8
+enum class AttachmentStoreOperation : U8
 {
 	STORE,
 	RESOLVE_MSAA,
@@ -271,7 +273,7 @@ enum class AttachmentStoreOperation: U8
 };
 
 /// Buffer usage modes.
-enum class BufferUsageBit: U8
+enum class BufferUsageBit : U8
 {
 	NONE = 0,
 	UNIFORM = 1 << 0,
@@ -283,7 +285,7 @@ enum class BufferUsageBit: U8
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(BufferUsageBit, inline)
 
 /// Buffer usage modes.
-enum class BufferUsage: U8
+enum class BufferUsage : U8
 {
 	UNIFORM,
 	STORAGE,
@@ -298,7 +300,7 @@ enum class BufferUsage: U8
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(BufferUsage, inline)
 
 /// Buffer access from client modes.
-enum class BufferAccessBit: U8
+enum class BufferAccessBit : U8
 {
 	NONE = 0,
 	CLIENT_MAP_READ = 1 << 0,
@@ -309,4 +311,3 @@ ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(BufferAccessBit, inline)
 /// @}
 
 } // end namespace anki
-

+ 3 - 3
include/anki/gr/Framebuffer.h

@@ -9,7 +9,8 @@
 #include <anki/gr/Texture.h>
 #include <cstring>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup graphics
 /// @{
@@ -89,7 +90,7 @@ public:
 };
 
 /// GPU framebuffer.
-class Framebuffer: public GrObject
+class Framebuffer : public GrObject
 {
 public:
 	/// Construct.
@@ -113,4 +114,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 6 - 5
include/anki/gr/GrManager.h

@@ -8,7 +8,8 @@
 #include <anki/gr/Common.h>
 #include <anki/util/String.h>
 
-namespace anki {
+namespace anki
+{
 
 // Forward
 class ConfigSet;
@@ -21,7 +22,8 @@ class GrManagerInterface
 {
 public:
 	virtual ~GrManagerInterface()
-	{}
+	{
+	}
 
 	/// Swap buffers.
 	virtual void swapBuffersCommand() = 0;
@@ -75,8 +77,8 @@ public:
 
 	/// Allocate memory for dynamic buffers. The memory will be reclaimed at
 	/// the begining of the next frame.
-	void* allocateFrameHostVisibleMemory(PtrSize size, BufferUsage usage,
-		DynamicBufferToken& token);
+	void* allocateFrameHostVisibleMemory(
+		PtrSize size, BufferUsage usage, DynamicBufferToken& token);
 
 anki_internal:
 	GrAllocator<U8>& getAllocator()
@@ -121,4 +123,3 @@ IntrusivePtr<T> GrManager::newInstance(Args&&... args)
 /// @}
 
 } // end namespace anki
-

+ 5 - 4
include/anki/gr/GrObject.h

@@ -9,19 +9,21 @@
 #include <anki/util/Atomic.h>
 #include <anki/util/NonCopyable.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup graphics
 /// @{
 
 /// Base of all graphics objects.
-class GrObject: public NonCopyable
+class GrObject : public NonCopyable
 {
 public:
 	GrObject(GrManager* manager);
 
 	virtual ~GrObject()
-	{}
+	{
+	}
 
 	GrManager& getManager()
 	{
@@ -54,4 +56,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 3 - 3
include/anki/gr/OcclusionQuery.h

@@ -7,13 +7,14 @@
 
 #include <anki/gr/GrObject.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup graphics
 /// @{
 
 /// Occlusion query.
-class OcclusionQuery: public GrObject
+class OcclusionQuery : public GrObject
 {
 public:
 	/// Construct.
@@ -37,4 +38,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 11 - 10
include/anki/gr/Pipeline.h

@@ -8,7 +8,8 @@
 #include <anki/gr/GrObject.h>
 #include <anki/gr/Shader.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup graphics
 /// @{
@@ -91,7 +92,7 @@ public:
 	Array<ColorAttachmentStateInfo, MAX_COLOR_ATTACHMENTS> m_attachments;
 };
 
-enum class PipelineSubStateBit: U16
+enum class PipelineSubStateBit : U16
 {
 	NONE = 0,
 	VERTEX = 1 << 0,
@@ -102,7 +103,8 @@ enum class PipelineSubStateBit: U16
 	DEPTH_STENCIL = 1 << 5,
 	COLOR = 1 << 6,
 	ALL = VERTEX | INPUT_ASSEMBLER | TESSELLATION | VIEWPORT | RASTERIZER
-		| DEPTH_STENCIL | COLOR
+		| DEPTH_STENCIL
+		| COLOR
 };
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(PipelineSubStateBit, inline)
 
@@ -112,11 +114,11 @@ class PipelineInitializer
 public:
 	PipelineInitializer()
 	{
-		// Do a special construction. The state will be hashed and the padding
-		// may contain garbage. With this trick zero the padding
-#define ANKI_CONSTRUCT_AND_ZERO_PADDING(member_) \
-	memset(&member_, 0, sizeof(member_)); \
-	new (&member_) decltype(member_)()
+// Do a special construction. The state will be hashed and the padding
+// may contain garbage. With this trick zero the padding
+#define ANKI_CONSTRUCT_AND_ZERO_PADDING(member_)                               \
+	memset(&member_, 0, sizeof(member_));                                      \
+	new(&member_) decltype(member_)()
 
 		ANKI_CONSTRUCT_AND_ZERO_PADDING(m_vertex);
 		ANKI_CONSTRUCT_AND_ZERO_PADDING(m_inputAssembler);
@@ -141,7 +143,7 @@ public:
 };
 
 /// Graphics and compute pipeline. Contains the static state.
-class Pipeline: public GrObject
+class Pipeline : public GrObject
 {
 public:
 	/// Construct.
@@ -165,4 +167,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 3 - 3
include/anki/gr/ResourceGroup.h

@@ -10,7 +10,8 @@
 #include <anki/gr/Sampler.h>
 #include <anki/gr/Buffer.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup graphics
 /// @{
@@ -55,7 +56,7 @@ public:
 };
 
 /// Resource group.
-class ResourceGroup: public GrObject
+class ResourceGroup : public GrObject
 {
 public:
 	/// Construct.
@@ -79,4 +80,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 6 - 5
include/anki/gr/Sampler.h

@@ -8,16 +8,17 @@
 #include <anki/gr/GrObject.h>
 #include <anki/gr/Texture.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup graphics
 /// @{
 
 /// GPU sampler.
-class Sampler: public GrObject
+class Sampler : public GrObject
 {
 public:
-    /// Construct.
+	/// Construct.
 	Sampler(GrManager* manager);
 
 	/// Destroy.
@@ -29,11 +30,11 @@ public:
 		return *m_impl;
 	}
 
-    /// Create it.
+	/// Create it.
 	void create(const SamplerInitializer& init);
 
 private:
-    UniquePtr<SamplerImpl> m_impl;
+	UniquePtr<SamplerImpl> m_impl;
 };
 /// @}
 

+ 10 - 10
include/anki/gr/Shader.h

@@ -8,7 +8,8 @@
 #include <anki/gr/GrObject.h>
 #include <anki/Math.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup graphics
 /// @{
@@ -17,11 +18,12 @@ namespace anki {
 template<typename T>
 ShaderVariableDataType getShaderVariableTypeFromTypename();
 
-#define ANKI_SPECIALIZE_SHADER_VAR_TYPE_GET(typename_, type_) \
-	template<> \
-	inline ShaderVariableDataType \
-		getShaderVariableTypeFromTypename<typename_>() { \
-		return ShaderVariableDataType::type_; \
+#define ANKI_SPECIALIZE_SHADER_VAR_TYPE_GET(typename_, type_)                  \
+	template<>                                                                 \
+	inline ShaderVariableDataType                                              \
+	getShaderVariableTypeFromTypename<typename_>()                             \
+	{                                                                          \
+		return ShaderVariableDataType::type_;                                  \
 	}
 
 ANKI_SPECIALIZE_SHADER_VAR_TYPE_GET(F32, FLOAT)
@@ -50,8 +52,7 @@ public:
 };
 
 /// Populate the memory of a variable that is inside a shader block.
-void writeShaderBlockMemory(
-	ShaderVariableDataType type,
+void writeShaderBlockMemory(ShaderVariableDataType type,
 	const ShaderVariableBlockInfo& varBlkInfo,
 	const void* elements,
 	U32 elementsCount,
@@ -59,7 +60,7 @@ void writeShaderBlockMemory(
 	const void* buffEnd);
 
 /// GPU shader.
-class Shader: public GrObject
+class Shader : public GrObject
 {
 public:
 	/// Construct.
@@ -83,4 +84,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 3 - 2
include/anki/gr/Texture.h

@@ -7,7 +7,8 @@
 
 #include <anki/gr/GrObject.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup graphics
 /// @{
@@ -41,7 +42,7 @@ public:
 };
 
 /// GPU texture
-class Texture: public GrObject
+class Texture : public GrObject
 {
 public:
 	/// Construct.

+ 5 - 3
include/anki/gr/gl/BufferImpl.h

@@ -7,13 +7,14 @@
 
 #include <anki/gr/gl/GlObject.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup opengl
 /// @{
 
 /// Buffer implementation
-class BufferImpl: public GlObject
+class BufferImpl : public GlObject
 {
 public:
 	U32 m_size = 0; ///< The size of the buffer
@@ -27,7 +28,8 @@ public:
 
 	BufferImpl(GrManager* manager)
 		: GlObject(manager)
-	{}
+	{
+	}
 
 	~BufferImpl()
 	{

+ 8 - 6
include/anki/gr/gl/CommandBufferImpl.h

@@ -10,7 +10,8 @@
 #include <anki/util/Assert.h>
 #include <anki/util/Allocator.h>
 
-namespace anki {
+namespace anki
+{
 
 // Forward
 class GlState;
@@ -28,7 +29,8 @@ public:
 	GlCommand* m_nextCommand = nullptr;
 
 	virtual ~GlCommand()
-	{}
+	{
+	}
 
 	/// Execute command
 	virtual ANKI_USE_RESULT Error operator()(GlState& state) = 0;
@@ -43,7 +45,8 @@ public:
 	/// Default constructor
 	CommandBufferImpl(GrManager* manager)
 		: m_manager(manager)
-	{}
+	{
+	}
 
 	~CommandBufferImpl()
 	{
@@ -117,8 +120,8 @@ template<typename TCommand, typename... TArgs>
 inline void CommandBufferImpl::pushBackNewCommand(TArgs&&... args)
 {
 	ANKI_ASSERT(!m_immutable);
-	TCommand* newCommand = m_alloc.template newInstance<TCommand>(
-		std::forward<TArgs>(args)...);
+	TCommand* newCommand =
+		m_alloc.template newInstance<TCommand>(std::forward<TArgs>(args)...);
 
 	if(m_firstCommand != nullptr)
 	{
@@ -137,4 +140,3 @@ inline void CommandBufferImpl::pushBackNewCommand(TArgs&&... args)
 /// @}
 
 } // end namespace anki
-

+ 15 - 13
include/anki/gr/gl/Common.h

@@ -8,20 +8,21 @@
 #include <anki/gr/Common.h>
 
 #if ANKI_GL == ANKI_GL_DESKTOP
-#	if ANKI_OS == ANKI_OS_WINDOWS && !defined(GLEW_STATIC)
-#		define GLEW_STATIC
-#	endif
-#	include <GL/glew.h>
-#	if !defined(ANKI_GLEW_H)
-#		error "Wrong GLEW included"
-#	endif
+#if ANKI_OS == ANKI_OS_WINDOWS && !defined(GLEW_STATIC)
+#define GLEW_STATIC
+#endif
+#include <GL/glew.h>
+#if !defined(ANKI_GLEW_H)
+#error "Wrong GLEW included"
+#endif
 #elif ANKI_GL == ANKI_GL_ES
-#	include <GLES3/gl3.h>
+#include <GLES3/gl3.h>
 #else
-#	error "See file"
+#error "See file"
 #endif
 
-namespace anki {
+namespace anki
+{
 
 // Forward
 class GlState;
@@ -33,9 +34,10 @@ class RenderingThread;
 /// Converter.
 GLenum convertCompareOperation(CompareOperation in);
 
-void convertFilter(SamplingFilter minMagFilter, SamplingFilter mipFilter,
-	GLenum& minFilter, GLenum& magFilter);
+void convertFilter(SamplingFilter minMagFilter,
+	SamplingFilter mipFilter,
+	GLenum& minFilter,
+	GLenum& magFilter);
 /// @}
 
 } // end namespace anki
-

+ 5 - 5
include/anki/gr/gl/Error.h

@@ -7,7 +7,8 @@
 
 #include <anki/gr/gl/Common.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup opengl
 /// @{
@@ -20,12 +21,11 @@ namespace anki {
 /// ANKI_CHECK_GL_ERROR macro
 void glConditionalCheckError(const char* file, int line, const char* func);
 
-#	define ANKI_CHECK_GL_ERROR() \
-		glConditionalCheckError(ANKI_FILE, __LINE__, ANKI_FUNC)
+#define ANKI_CHECK_GL_ERROR()                                                  \
+	glConditionalCheckError(ANKI_FILE, __LINE__, ANKI_FUNC)
 #else
-#	define ANKI_CHECK_GL_ERROR() ((void)0)
+#define ANKI_CHECK_GL_ERROR() ((void)0)
 #endif
 /// @}
 
 } // end namespace anki
-

+ 7 - 6
include/anki/gr/gl/FramebufferImpl.h

@@ -8,18 +8,20 @@
 #include <anki/gr/gl/GlObject.h>
 #include <anki/gr/Framebuffer.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup opengl
 /// @{
 
 /// Framebuffer implementation.
-class FramebufferImpl: public GlObject
+class FramebufferImpl : public GlObject
 {
 public:
 	FramebufferImpl(GrManager* manager)
 		: GlObject(manager)
-	{}
+	{
+	}
 
 	~FramebufferImpl()
 	{
@@ -42,8 +44,8 @@ private:
 	Bool8 m_bindDefault = false;
 
 	/// Attach a texture
-	static void attachTextureInternal(GLenum attachment, const TextureImpl& tex,
-		const U32 layer);
+	static void attachTextureInternal(
+		GLenum attachment, const TextureImpl& tex, const U32 layer);
 
 	/// Create the FBO
 	ANKI_USE_RESULT Error createFbo(
@@ -53,4 +55,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 3 - 2
include/anki/gr/gl/GlObject.h

@@ -7,13 +7,14 @@
 
 #include <anki/gr/gl/Common.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup opengl
 /// @{
 
 /// State of the handle
-enum class GlObjectState: U32
+enum class GlObjectState : U32
 {
 	NEW,
 	TO_BE_CREATED,

+ 16 - 15
include/anki/gr/gl/GlState.h

@@ -8,7 +8,8 @@
 #include <anki/gr/gl/Common.h>
 #include <anki/util/DArray.h>
 
-namespace anki {
+namespace anki
+{
 
 // Forward
 class ConfigSet;
@@ -17,7 +18,7 @@ class ConfigSet;
 /// @{
 
 /// Knowing the ventor allows some optimizations
-enum class GpuVendor: U8
+enum class GpuVendor : U8
 {
 	UNKNOWN,
 	ARM,
@@ -67,11 +68,11 @@ public:
 		U64 m_color = 0;
 	} m_stateHashes;
 
-	Array2d<Bool, MAX_COLOR_ATTACHMENTS, 4> m_colorWriteMasks  = {{
-		{{true, true, true, true}},
-		{{true, true, true, true}},
-		{{true, true, true, true}},
-		{{true, true, true, true}}}};
+	Array2d<Bool, MAX_COLOR_ATTACHMENTS, 4> m_colorWriteMasks = {
+		{{{true, true, true, true}},
+			{{true, true, true, true}},
+			{{true, true, true, true}},
+			{{true, true, true, true}}}};
 	Bool m_depthWriteMask = true;
 	/// @}
 
@@ -96,7 +97,8 @@ public:
 
 	GlState(GrManager* manager)
 		: m_manager(manager)
-	{}
+	{
+	}
 
 	/// Call this from the main thread.
 	void init0(const ConfigSet& config);
@@ -108,8 +110,8 @@ public:
 	void destroy();
 
 	/// Allocate memory for a dynamic buffer.
-	void* allocateDynamicMemory(PtrSize size, BufferUsage usage,
-		DynamicBufferToken& token);
+	void* allocateDynamicMemory(
+		PtrSize size, BufferUsage usage, DynamicBufferToken& token);
 
 	void checkDynamicMemoryConsumption();
 
@@ -117,13 +119,13 @@ private:
 	GrManager* m_manager;
 	DArray<U8> m_transferBuffer;
 
-	void initDynamicBuffer(GLenum target, U32 aligment, U32 maxAllocationSize,
-		BufferUsage usage);
+	void initDynamicBuffer(
+		GLenum target, U32 aligment, U32 maxAllocationSize, BufferUsage usage);
 };
 
 //==============================================================================
-inline void* GlState::allocateDynamicMemory(PtrSize originalSize,
-	BufferUsage usage, DynamicBufferToken& token)
+inline void* GlState::allocateDynamicMemory(
+	PtrSize originalSize, BufferUsage usage, DynamicBufferToken& token)
 {
 	ANKI_ASSERT(originalSize > 0);
 
@@ -159,4 +161,3 @@ inline void* GlState::allocateDynamicMemory(PtrSize originalSize,
 /// @}
 
 } // end namespace anki
-

+ 2 - 2
include/anki/gr/gl/GrManagerImpl.h

@@ -7,7 +7,8 @@
 
 #include <anki/gr/Common.h>
 
-namespace anki {
+namespace anki
+{
 
 // Forward
 class RenderingThread;
@@ -48,4 +49,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 5 - 4
include/anki/gr/gl/OcclusionQueryImpl.h

@@ -7,18 +7,20 @@
 
 #include <anki/gr/gl/GlObject.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup opengl
 /// @{
 
 /// Occlusion query.
-class OcclusionQueryImpl: public GlObject
+class OcclusionQueryImpl : public GlObject
 {
 public:
 	OcclusionQueryImpl(GrManager* manager)
 		: GlObject(manager)
-	{}
+	{
+	}
 
 	~OcclusionQueryImpl()
 	{
@@ -54,4 +56,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 7 - 5
include/anki/gr/gl/PipelineImpl.h

@@ -8,18 +8,20 @@
 #include <anki/gr/gl/GlObject.h>
 #include <anki/gr/Pipeline.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup opengl
 /// @{
 
 /// Program pipeline
-class PipelineImpl: public GlObject
+class PipelineImpl : public GlObject
 {
 public:
 	PipelineImpl(GrManager* manager)
 		: GlObject(manager)
-	{}
+	{
+	}
 
 	~PipelineImpl()
 	{
@@ -96,7 +98,8 @@ private:
 	void setInputAssemblerState(GlState& state) const;
 	void setTessellationState(GlState& state) const;
 	void setViewportState(GlState& state) const
-	{}
+	{
+	}
 	void setRasterizerState(GlState& state) const;
 	void setDepthStencilState(GlState& state) const;
 	void setColorState(GlState& state) const;
@@ -104,4 +107,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 4 - 3
include/anki/gr/gl/RenderingThread.h

@@ -9,7 +9,8 @@
 #include <anki/gr/gl/GlState.h>
 #include <anki/util/Thread.h>
 
-namespace anki {
+namespace anki
+{
 
 class GrManagerInterface;
 
@@ -40,7 +41,8 @@ public:
 
 	/// Start the working thread
 	/// @note Don't free the context before calling #stop
-	void start(WeakPtr<GrManagerInterface> interface, Bool registerMessages,
+	void start(WeakPtr<GrManagerInterface> interface,
+		Bool registerMessages,
 		const ConfigSet& config);
 
 	/// Stop the working thread
@@ -106,4 +108,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 10 - 6
include/anki/gr/gl/ResourceGroupImpl.h

@@ -9,18 +9,20 @@
 #include <anki/gr/ResourceGroup.h>
 #include <anki/util/DArray.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup opengl
 /// @{
 
 /// Resource group implementation.
-class ResourceGroupImpl: public GlObject
+class ResourceGroupImpl : public GlObject
 {
 public:
 	ResourceGroupImpl(GrManager* manager)
 		: GlObject(manager)
-	{}
+	{
+	}
 
 	~ResourceGroupImpl()
 	{
@@ -65,12 +67,14 @@ private:
 	DArray<IntrusivePtr<GrObject>> m_refs;
 
 	template<typename InBindings, typename OutBindings>
-	void initBuffers(const InBindings& in, OutBindings& out, U8& count,
-		U& resourcesCount, U& dynCount);
+	void initBuffers(const InBindings& in,
+		OutBindings& out,
+		U8& count,
+		U& resourcesCount,
+		U& dynCount);
 
 	void initResourceReferences(const ResourceGroupInitializer& init, U count);
 };
 /// @}
 
 } // end namespace anki
-

+ 5 - 3
include/anki/gr/gl/SamplerImpl.h

@@ -7,18 +7,20 @@
 
 #include <anki/gr/gl/GlObject.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup opengl
 /// @{
 
 /// Sampler GL object.
-class SamplerImpl: public GlObject
+class SamplerImpl : public GlObject
 {
 public:
 	SamplerImpl(GrManager* manager)
 		: GlObject(manager)
-	{}
+	{
+	}
 
 	~SamplerImpl()
 	{

+ 5 - 4
include/anki/gr/gl/ShaderImpl.h

@@ -8,7 +8,8 @@
 #include <anki/gr/Shader.h>
 #include <anki/gr/gl/GlObject.h>
 
-namespace anki {
+namespace anki
+{
 
 // Forward
 class CString;
@@ -19,7 +20,7 @@ class String;
 
 /// Shader program. It only contains a single shader and it can be combined
 /// with other programs in a program pipiline.
-class ShaderImpl: public GlObject
+class ShaderImpl : public GlObject
 {
 public:
 	GLenum m_glType = 0;
@@ -27,7 +28,8 @@ public:
 
 	ShaderImpl(GrManager* manager)
 		: GlObject(manager)
-	{}
+	{
+	}
 
 	~ShaderImpl();
 
@@ -42,4 +44,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 11 - 6
include/anki/gr/gl/TextureImpl.h

@@ -8,13 +8,14 @@
 #include <anki/gr/gl/GlObject.h>
 #include <anki/util/DArray.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup opengl
 /// @{
 
 /// Texture container.
-class TextureImpl: public GlObject
+class TextureImpl : public GlObject
 {
 public:
 	GLenum m_target = GL_NONE; ///< GL_TEXTURE_2D, GL_TEXTURE_3D... etc
@@ -31,7 +32,8 @@ public:
 
 	TextureImpl(GrManager* manager)
 		: GlObject(manager)
-	{}
+	{
+	}
 
 	~TextureImpl();
 
@@ -45,12 +47,15 @@ public:
 	void generateMipmaps(U surface);
 
 	/// Copy a single slice from one texture to another.
-	static void copy(const TextureImpl& src, U srcSlice, U srcLevel,
-		const TextureImpl& dest, U destSlice, U destLevel);
+	static void copy(const TextureImpl& src,
+		U srcSlice,
+		U srcLevel,
+		const TextureImpl& dest,
+		U destSlice,
+		U destLevel);
 
 	void bind();
 };
 /// @}
 
 } // end namespace anki
-

+ 5 - 4
include/anki/input/Input.h

@@ -11,7 +11,8 @@
 #include <anki/util/StdTypes.h>
 #include <anki/input/KeyCode.h>
 
-namespace anki {
+namespace anki
+{
 
 class InputImpl;
 class NativeWindow;
@@ -22,7 +23,7 @@ class NativeWindow;
 class Input
 {
 public:
-	enum class Event: U8
+	enum class Event : U8
 	{
 		WINDOW_FOCUS_LOST,
 		WINDOW_FOCUS_GAINED,
@@ -31,7 +32,8 @@ public:
 	};
 
 	Input()
-	{}
+	{
+	}
 
 	~Input()
 	{
@@ -124,4 +126,3 @@ private:
 };
 
 } // end namespace anki
-

+ 9 - 8
include/anki/input/InputSdl.h

@@ -9,24 +9,25 @@
 #include <SDL_keycode.h>
 #include <unordered_map>
 
-namespace anki {
+namespace anki
+{
 
 /// SDL input implementation
 class InputImpl
 {
 public:
-	std::unordered_map<
-		SDL_Keycode,
+	std::unordered_map<SDL_Keycode,
 		KeyCode,
 		std::hash<SDL_Keycode>,
 		std::equal_to<SDL_Keycode>,
-		HeapAllocator<std::pair<const SDL_Keycode, KeyCode>>> m_sdlToAnki;
+		HeapAllocator<std::pair<const SDL_Keycode, KeyCode>>>
+		m_sdlToAnki;
 
 	InputImpl(HeapAllocator<std::pair<const SDL_Keycode, KeyCode>>& alloc)
-		: m_sdlToAnki(10, std::hash<SDL_Keycode>(),
-			std::equal_to<SDL_Keycode>(), alloc)
-	{}
+		: m_sdlToAnki(
+			  10, std::hash<SDL_Keycode>(), std::equal_to<SDL_Keycode>(), alloc)
+	{
+	}
 };
 
 } // end namespace anki
-

+ 2 - 2
include/anki/input/KeyCode.h

@@ -5,7 +5,8 @@
 
 #pragma once
 
-namespace anki {
+namespace anki
+{
 
 /// Keyboard scancodes taken from SDL
 enum class KeyCode
@@ -271,4 +272,3 @@ enum class MouseButton
 };
 
 } // end namespace anki
-

+ 19 - 14
include/anki/math/Axisang.h

@@ -7,7 +7,8 @@
 
 #include <anki/math/CommonIncludes.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup math
 /// @{
@@ -20,19 +21,22 @@ public:
 	/// @name Constructors
 	/// @{
 	TAxisang()
-	:	m_ang(0.0),
-		m_axis(0.0)
-	{}
+		: m_ang(0.0)
+		, m_axis(0.0)
+	{
+	}
 
 	TAxisang(const TAxisang& b)
-	:	m_ang(b.m_ang),
-		m_axis(b.m_axis)
-	{}
+		: m_ang(b.m_ang)
+		, m_axis(b.m_axis)
+	{
+	}
 
 	TAxisang(const T rad, const TVec3<T>& axis)
-	:	m_ang(rad),
-		m_axis(axis)
-	{}
+		: m_ang(rad)
+		, m_axis(axis)
+	{
+	}
 
 	explicit TAxisang(const TQuat<T>& q)
 	{
@@ -51,8 +55,7 @@ public:
 
 	explicit TAxisang(const TMat3<T>& m3)
 	{
-		if(isZero<T>(m3(0, 1) - m3(1, 0))
-			&& isZero<T>(m3(0, 2) - m3(2, 0))
+		if(isZero<T>(m3(0, 1) - m3(1, 0)) && isZero<T>(m3(0, 2) - m3(2, 0))
 			&& isZero<T>(m3(1, 2) - m3(2, 1)))
 		{
 
@@ -193,7 +196,10 @@ public:
 	{
 		String s;
 		Error err = s.sprintf("axis: %f %f %f, angle: %f",
-			m_axis[0], m_axis[1], m_axis[2], m_ang);
+			m_axis[0],
+			m_axis[1],
+			m_axis[2],
+			m_ang);
 		(void)err;
 		return s;
 	}
@@ -212,4 +218,3 @@ typedef TAxisang<F32> Axisang;
 /// @}
 
 } // end namespace anki
-

+ 5 - 5
include/anki/math/Euler.h

@@ -7,7 +7,8 @@
 
 #include <anki/math/CommonIncludes.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup math
 /// @{
@@ -76,7 +77,7 @@ public:
 		sy = m3(0, 2);
 		cy = sqrt<T>(1.0 - sy * sy);
 		// normal case
-		if (!isZero<T>(cy))
+		if(!isZero<T>(cy))
 		{
 			T factor = 1.0 / cy;
 			sx = -m3(1, 2) * factor;
@@ -101,12 +102,12 @@ public:
 
 	/// @name Accessors
 	/// @{
-	T& operator [](const U i)
+	T& operator[](const U i)
 	{
 		return m_arr[i];
 	}
 
-	T operator [](const U i) const
+	T operator[](const U i) const
 	{
 		return m_arr[i];
 	}
@@ -186,4 +187,3 @@ typedef TEuler<F32> Euler;
 /// @}
 
 } // end namespace anki
-

+ 4 - 3
include/anki/math/F16.h

@@ -7,7 +7,8 @@
 
 #include <anki/math/CommonIncludes.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup math
 /// @{
@@ -27,7 +28,8 @@ public:
 	/// @name Constructors
 	/// @{
 	F16()
-	{}
+	{
+	}
 
 	F16(const F16& b)
 	{
@@ -218,4 +220,3 @@ inline F32 operator/(const F32 f, const F16 h)
 static_assert(sizeof(F16) == 2, "Incorrect size");
 
 } // end namespace anki
-

+ 30 - 15
include/anki/math/Forward.h

@@ -7,27 +7,42 @@
 
 #include <anki/util/StdTypes.h>
 
-namespace anki {
+namespace anki
+{
 
 class F16;
 
 template<typename T, U N, typename TSimd, typename TV>
 class TVec;
-template<typename T> class TVec2;
-template<typename T> class TVec3;
-template<typename T> class TVec4;
-
-template<typename T, U J, U I, typename TSimd, typename TM, typename TVJ,
+template<typename T>
+class TVec2;
+template<typename T>
+class TVec3;
+template<typename T>
+class TVec4;
+
+template<typename T,
+	U J,
+	U I,
+	typename TSimd,
+	typename TM,
+	typename TVJ,
 	typename TVI>
 class TMat;
-template<typename T> class TMat3;
-template<typename T> class TMat3x4;
-template<typename T> class TMat4;
-
-template<typename T> class TQuat;
-template<typename T> class TTransform;
-template<typename T> class TAxisang;
-template<typename T> class TEuler;
+template<typename T>
+class TMat3;
+template<typename T>
+class TMat3x4;
+template<typename T>
+class TMat4;
+
+template<typename T>
+class TQuat;
+template<typename T>
+class TTransform;
+template<typename T>
+class TAxisang;
+template<typename T>
+class TEuler;
 
 } // end namespace anki
-

+ 14 - 15
include/anki/math/Functions.h

@@ -9,7 +9,8 @@
 #include <cmath>
 #include <cstdlib>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup math
 /// @{
@@ -135,11 +136,11 @@ inline T abs(const T f)
 	return std::fabs(f);
 }
 
-#define ANKI_SPECIALIZE_ABS_INT(type_) \
-	template<> \
-	inline type_ abs(const type_ f) \
-	{ \
-		return std::abs(f); \
+#define ANKI_SPECIALIZE_ABS_INT(type_)                                         \
+	template<>                                                                 \
+	inline type_ abs(const type_ f)                                            \
+	{                                                                          \
+		return std::abs(f);                                                    \
 	}
 
 ANKI_SPECIALIZE_ABS_INT(I8)
@@ -155,11 +156,11 @@ inline Bool isZero(const T f)
 	return abs<T>(f) < getEpsilon<T>();
 }
 
-#define ANKI_SPECIALIZE_IS_ZERO_INT(type_) \
-	template<> \
-	inline Bool isZero(const type_ x) \
-	{ \
-		return x == type_(0); \
+#define ANKI_SPECIALIZE_IS_ZERO_INT(type_)                                     \
+	template<>                                                                 \
+	inline Bool isZero(const type_ x)                                          \
+	{                                                                          \
+		return x == type_(0);                                                  \
 	}
 
 ANKI_SPECIALIZE_IS_ZERO_INT(I8)
@@ -221,8 +222,7 @@ static Type cosInterpolate(const Type& from, const Type& to, F32 u)
 ///              from [0.0, 1.0]
 template<typename Type>
 static Type cubicInterpolate(
-	const Type& a, const Type& b, const Type& c,
-	const Type& d, F32 u)
+	const Type& a, const Type& b, const Type& c, const Type& d, F32 u)
 {
 	F32 u2 = u * u;
 	Type a0 = d - c - a + b;
@@ -230,9 +230,8 @@ static Type cubicInterpolate(
 	Type a2 = c - a;
 	Type a3 = b;
 
-	return(a0 * u * u2 + a1 * u2 + a2 * u + a3);
+	return (a0 * u * u2 + a1 * u2 + a2 * u + a3);
 }
 /// @}
 
 } // end namespace anki
-

+ 14 - 12
include/anki/math/Mat.h

@@ -8,7 +8,8 @@
 #include <anki/math/CommonIncludes.h>
 #include <anki/math/Vec.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup math
 /// @{
@@ -20,7 +21,12 @@ namespace anki {
 /// @tparam TM The type of the derived class. Eg TMat3.
 /// @tparam TVJ The vector type of the row.
 /// @tparam TVI The vector type of the column.
-template<typename T, U J, U I, typename TSimd, typename TM, typename TVJ,
+template<typename T,
+	U J,
+	U I,
+	typename TSimd,
+	typename TM,
+	typename TVJ,
 	typename TVI>
 class TMat
 {
@@ -33,7 +39,8 @@ public:
 	/// @name Constructors
 	/// @{
 	TMat()
-	{}
+	{
+	}
 
 	TMat(const TMat& b)
 	{
@@ -483,8 +490,7 @@ public:
 		m(2, 2) = m(2, 2) * cosa - m(2, 1) * sina;
 
 		// zAxis.normalize();
-		T len = sqrt(m(0, 2) * m(0, 2)
-			+ m(1, 2) * m(1, 2) + m(2, 2) * m(2, 2));
+		T len = sqrt(m(0, 2) * m(0, 2) + m(1, 2) * m(1, 2) + m(2, 2) * m(2, 2));
 		m(0, 2) /= len;
 		m(1, 2) /= len;
 		m(2, 2) /= len;
@@ -511,8 +517,7 @@ public:
 		m(2, 2) = m(2, 2) * cosa + m(2, 0) * sina;
 
 		// zAxis.normalize();
-		T len = sqrt(m(0, 2) * m(0, 2)
-			+ m(1, 2) * m(1, 2) + m(2, 2) * m(2, 2));
+		T len = sqrt(m(0, 2) * m(0, 2) + m(1, 2) * m(1, 2) + m(2, 2) * m(2, 2));
 		m(0, 2) /= len;
 		m(1, 2) /= len;
 		m(2, 2) /= len;
@@ -537,8 +542,7 @@ public:
 		m(2, 0) = m(2, 0) * cosa + m(2, 1) * sina;
 
 		// xAxis.normalize();
-		T len = sqrt(m(0, 0) * m(0, 0)
-			+ m(1, 0) * m(1, 0) + m(2, 0) * m(2, 0));
+		T len = sqrt(m(0, 0) * m(0, 0) + m(1, 0) * m(1, 0) + m(2, 0) * m(2, 0));
 		m(0, 0) /= len;
 		m(1, 0) /= len;
 		m(2, 0) /= len;
@@ -663,8 +667,7 @@ public:
 	{
 		if(ROW_SIZE == 4)
 		{
-			ANKI_ASSERT(isZero<T>(v[3] - static_cast<T>(1))
-				&& "w should be 1");
+			ANKI_ASSERT(isZero<T>(v[3] - static_cast<T>(1)) && "w should be 1");
 		}
 		setColumn(3, v);
 	}
@@ -775,4 +778,3 @@ protected:
 /// @}
 
 } // end namespace anki
-

+ 20 - 19
include/anki/math/Mat3.h

@@ -8,7 +8,8 @@
 #include <anki/math/CommonIncludes.h>
 #include <anki/math/Mat.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup math
 /// @{
@@ -17,7 +18,7 @@ namespace anki {
 /// functions. Its row major. The columns are the x,y,z axis
 /// @note TMat3*TMat3: 27 muls 18 adds
 template<typename T>
-class TMat3: public TMat<T, 3, 3, Array<T, 9>, TMat3<T>, TVec3<T>, TVec3<T>>
+class TMat3 : public TMat<T, 3, 3, Array<T, 9>, TMat3<T>, TVec3<T>, TVec3<T>>
 {
 	/// @name Friends
 	/// @{
@@ -39,15 +40,16 @@ public:
 	/// @name Constructors
 	/// @{
 	TMat3()
-	:	Base()
-	{}
+		: Base()
+	{
+	}
 
 	TMat3(const TMat3& b)
-	:	Base(b)
-	{}
+		: Base(b)
+	{
+	}
 
-	TMat3(
-		T m00, T m01, T m02, T m10, T m11, T m12, T m20, T m21, T m22)
+	TMat3(T m00, T m01, T m02, T m10, T m11, T m12, T m20, T m21, T m22)
 	{
 		TMat3& m = *this;
 		m(0, 0) = m00;
@@ -62,12 +64,14 @@ public:
 	}
 
 	explicit TMat3(const T f)
-	:	Base(f)
-	{}
+		: Base(f)
+	{
+	}
 
 	explicit TMat3(const T arr[])
-	:	Base(arr)
-	{}
+		: Base(arr)
+	{
+	}
 
 	explicit TMat3(const TQuat<T>& q)
 	{
@@ -91,10 +95,9 @@ public:
 	{
 		const TMat3& m = *this;
 		// For the accurate method see < r664
-		return m(0, 0) * (m(1, 1) * m(2, 2)
-			- m(1, 2) * m(2, 1)) - m(0, 1) * (m(1, 0)
-			* m(2, 2) - m(1, 2) * m(2, 0)) + m(0, 2)
-			* (m(0, 1) * m(2, 1) - m(1, 1) * m(2, 0));
+		return m(0, 0) * (m(1, 1) * m(2, 2) - m(1, 2) * m(2, 1))
+			- m(0, 1) * (m(1, 0) * m(2, 2) - m(1, 2) * m(2, 0))
+			+ m(0, 2) * (m(0, 1) * m(2, 1) - m(1, 1) * m(2, 0));
 	}
 
 	TMat3 getInverse() const
@@ -107,8 +110,7 @@ public:
 		T cofactor0 = m(1, 1) * m(2, 2) - m(1, 2) * m(2, 1);
 		T cofactor3 = m(0, 2) * m(2, 1) - m(0, 1) * m(2, 2);
 		T cofactor6 = m(0, 1) * m(1, 2) - m(0, 2) * m(1, 1);
-		T det = m(0, 0) * cofactor0 + m(1, 0) * cofactor3
-			+ m(2, 0) * cofactor6;
+		T det = m(0, 0) * cofactor0 + m(1, 0) * cofactor3 + m(2, 0) * cofactor6;
 
 		ANKI_ASSERT(!isZero<T>(det)); // Cannot invert det == 0
 
@@ -198,4 +200,3 @@ static_assert(sizeof(Mat3) == sizeof(F32) * 3 * 3, "Incorrect size");
 /// @}
 
 } // end namespace anki
-

+ 57 - 45
include/anki/math/Mat3x4.h

@@ -8,7 +8,8 @@
 #include <anki/math/CommonIncludes.h>
 #include <anki/math/Mat.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup math
 /// @{
@@ -34,27 +35,49 @@ public:
 /// 3x4 Matrix. Mainly used for transformations. It includes many helpful member
 /// functions. Its row major. The columns are the x,y,z axis
 template<typename T>
-class alignas(16) TMat3x4: public TMat<T, 3, 4, typename TMat3x4Simd<T>::Type,
-	  TMat3x4<T>, TVec4<T>, TVec3<T>>
+class alignas(16) TMat3x4 : public TMat<T,
+								3,
+								4,
+								typename TMat3x4Simd<T>::Type,
+								TMat3x4<T>,
+								TVec4<T>,
+								TVec3<T>>
 {
 public:
-	using Base = TMat<T, 3, 4, typename TMat3x4Simd<T>::Type,
-	  TMat3x4<T>, TVec4<T>, TVec3<T>>;
+	using Base = TMat<T,
+		3,
+		4,
+		typename TMat3x4Simd<T>::Type,
+		TMat3x4<T>,
+		TVec4<T>,
+		TVec3<T>>;
 
 	using Base::Base;
 
 	/// @name Constructors
 	/// @{
 	TMat3x4()
-	:	Base()
-	{}
+		: Base()
+	{
+	}
 
 	TMat3x4(const TMat3x4& b)
-	:	Base(b)
-	{}
+		: Base(b)
+	{
+	}
 
-	TMat3x4(T m00, T m01, T m02, T m03, T m10, T m11, T m12, T m13,
-		T m20, T m21, T m22, T m23)
+	TMat3x4(T m00,
+		T m01,
+		T m02,
+		T m03,
+		T m10,
+		T m11,
+		T m12,
+		T m13,
+		T m20,
+		T m21,
+		T m22,
+		T m23)
 	{
 		TMat3x4& m = *this;
 		m(0, 0) = m00;
@@ -72,8 +95,9 @@ public:
 	}
 
 	explicit TMat3x4(const T f)
-	:	Base(f)
-	{}
+		: Base(f)
+	{
+	}
 
 	explicit TMat3x4(const TMat3<T>& m3)
 	{
@@ -179,33 +203,24 @@ public:
 		const TMat3x4& a = *static_cast<const TMat3x4*>(this);
 		TMat3x4 c;
 
-		c(0, 0) =
-			a(0, 0) * b(0, 0) + a(0, 1) * b(1, 0) + a(0, 2) * b(2, 0);
-		c(0, 1) =
-			a(0, 0) * b(0, 1) + a(0, 1) * b(1, 1) + a(0, 2) * b(2, 1);
-		c(0, 2) =
-			a(0, 0) * b(0, 2) + a(0, 1) * b(1, 2) + a(0, 2) * b(2, 2);
-		c(1, 0) =
-			a(1, 0) * b(0, 0) + a(1, 1) * b(1, 0) + a(1, 2) * b(2, 0);
-		c(1, 1) =
-			a(1, 0) * b(0, 1) + a(1, 1) * b(1, 1) + a(1, 2) * b(2, 1);
-		c(1, 2) =
-			a(1, 0) * b(0, 2) + a(1, 1) * b(1, 2) + a(1, 2) * b(2, 2);
-		c(2, 0) =
-			a(2, 0) * b(0, 0) + a(2, 1) * b(1, 0) + a(2, 2) * b(2, 0);
-		c(2, 1) =
-			a(2, 0) * b(0, 1) + a(2, 1) * b(1, 1) + a(2, 2) * b(2, 1);
-		c(2, 2) =
-			a(2, 0) * b(0, 2) + a(2, 1) * b(1, 2) + a(2, 2) * b(2, 2);
-
-		c(0, 3) = a(0, 0) * b(0, 3) + a(0, 1) * b(1, 3)
-			+ a(0, 2) * b(2, 3) + a(0, 3);
-
-		c(1, 3) = a(1, 0) * b(0, 3) + a(1, 1) * b(1, 3)
-			+ a(1, 2) * b(2, 3) + a(1, 3);
-
-		c(2, 3) = a(2, 0) * b(0, 3) + a(2, 1) * b(1, 3)
-			+ a(2, 2) * b(2, 3) + a(2, 3);
+		c(0, 0) = a(0, 0) * b(0, 0) + a(0, 1) * b(1, 0) + a(0, 2) * b(2, 0);
+		c(0, 1) = a(0, 0) * b(0, 1) + a(0, 1) * b(1, 1) + a(0, 2) * b(2, 1);
+		c(0, 2) = a(0, 0) * b(0, 2) + a(0, 1) * b(1, 2) + a(0, 2) * b(2, 2);
+		c(1, 0) = a(1, 0) * b(0, 0) + a(1, 1) * b(1, 0) + a(1, 2) * b(2, 0);
+		c(1, 1) = a(1, 0) * b(0, 1) + a(1, 1) * b(1, 1) + a(1, 2) * b(2, 1);
+		c(1, 2) = a(1, 0) * b(0, 2) + a(1, 1) * b(1, 2) + a(1, 2) * b(2, 2);
+		c(2, 0) = a(2, 0) * b(0, 0) + a(2, 1) * b(1, 0) + a(2, 2) * b(2, 0);
+		c(2, 1) = a(2, 0) * b(0, 1) + a(2, 1) * b(1, 1) + a(2, 2) * b(2, 1);
+		c(2, 2) = a(2, 0) * b(0, 2) + a(2, 1) * b(1, 2) + a(2, 2) * b(2, 2);
+
+		c(0, 3) =
+			a(0, 0) * b(0, 3) + a(0, 1) * b(1, 3) + a(0, 2) * b(2, 3) + a(0, 3);
+
+		c(1, 3) =
+			a(1, 0) * b(0, 3) + a(1, 1) * b(1, 3) + a(1, 2) * b(2, 3) + a(1, 3);
+
+		c(2, 3) =
+			a(2, 0) * b(0, 3) + a(2, 1) * b(1, 3) + a(2, 2) * b(2, 3) + a(2, 3);
 
 		return c;
 	}
@@ -218,9 +233,7 @@ public:
 	static const TMat3x4& getIdentity()
 	{
 		static const TMat3x4 ident(
-			1.0, 0.0, 0.0, 0.0,
-			0.0, 1.0, 0.0, 0.0,
-			0.0, 0.0, 1.0, 0.0);
+			1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
 		return ident;
 	}
 	/// @}
@@ -244,7 +257,7 @@ TMat3x4<F32> TMat3x4<F32>::combineTransformations(const TMat3x4<F32>& b) const;
 
 #elif ANKI_SIMD == ANKI_SIMD_NEON
 
-#	error "TODO"
+#error "TODO"
 
 #endif
 
@@ -256,4 +269,3 @@ static_assert(sizeof(Mat3x4) == sizeof(F32) * 3 * 4, "Incorrect size");
 } // end namespace anki
 
 #include <anki/math/Mat3x4.inl.h>
-

+ 5 - 5
include/anki/math/Mat3x4.inl.h

@@ -5,7 +5,8 @@
 
 #include <anki/math/CommonSrc.h>
 
-namespace anki {
+namespace anki
+{
 
 #if ANKI_SIMD == ANKI_SIMD_SSE
 
@@ -46,7 +47,7 @@ template<>
 inline TVec3<F32> TMat3x4<F32>::Base::operator*(const TVec4<F32>& b) const
 {
 	TVec3<F32> v;
-	
+
 	for(U i = 0; i < 3; i++)
 	{
 		_mm_store_ss(&v[i], _mm_dp_ps(m_simd[i], b.getSimd(), 0xF1));
@@ -73,9 +74,9 @@ inline TMat3x4<F32> TMat3x4<F32>::combineTransformations(
 
 		t1 = _mm_set1_ps(a(i, 0));
 		t2 = _mm_mul_ps(b.m_simd[0], t1);
-		t1 =_mm_set1_ps(a(i, 1));
+		t1 = _mm_set1_ps(a(i, 1));
 		t2 = _mm_add_ps(_mm_mul_ps(b.m_simd[1], t1), t2);
-		t1 =_mm_set1_ps(a(i, 2));
+		t1 = _mm_set1_ps(a(i, 2));
 		t2 = _mm_add_ps(_mm_mul_ps(b.m_simd[2], t1), t2);
 
 		TVec4<F32> v4(0.0, 0.0, 0.0, a(i, 3));
@@ -90,4 +91,3 @@ inline TMat3x4<F32> TMat3x4<F32>::combineTransformations(
 #endif
 
 } // end namespace anki
-

+ 85 - 47
include/anki/math/Mat4.h

@@ -7,7 +7,8 @@
 
 #include <anki/math/CommonIncludes.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup math
 /// @{
@@ -34,8 +35,13 @@ public:
 /// row major. SSE optimized
 /// @note TMat4*TMat4: 64 muls 48 adds
 template<typename T>
-class alignas(16) TMat4: public TMat<T, 4, 4, typename TMat4Simd<T>::Type,
-	  TMat4<T>, TVec4<T>, TVec4<T>>
+class alignas(16) TMat4 : public TMat<T,
+							  4,
+							  4,
+							  typename TMat4Simd<T>::Type,
+							  TMat4<T>,
+							  TVec4<T>,
+							  TVec4<T>>
 {
 	/// @name Friends
 	/// @{
@@ -50,8 +56,13 @@ class alignas(16) TMat4: public TMat<T, 4, 4, typename TMat4Simd<T>::Type,
 	/// @}
 
 public:
-	using Base = TMat<T, 4, 4, typename TMat4Simd<T>::Type,
-	  TMat4<T>, TVec4<T>, TVec4<T>>;
+	using Base = TMat<T,
+		4,
+		4,
+		typename TMat4Simd<T>::Type,
+		TMat4<T>,
+		TVec4<T>,
+		TVec4<T>>;
 
 	using Base::getTranslationPart;
 	using Base::setTranslationPart;
@@ -62,14 +73,30 @@ public:
 	/// @{
 	TMat4()
 		: Base()
-	{}
+	{
+	}
 
 	TMat4(const TMat4& b)
 		: Base(b)
-	{}
+	{
+	}
 
-	TMat4(T m00, T m01, T m02, T m03, T m10, T m11, T m12, T m13,
-		T m20, T m21, T m22, T m23, T m30, T m31, T m32, T m33)
+	TMat4(T m00,
+		T m01,
+		T m02,
+		T m03,
+		T m10,
+		T m11,
+		T m12,
+		T m13,
+		T m20,
+		T m21,
+		T m22,
+		T m23,
+		T m30,
+		T m31,
+		T m32,
+		T m33)
 	{
 		TMat4& m = *this;
 		m(0, 0) = m00;
@@ -92,7 +119,8 @@ public:
 
 	explicit TMat4(const T f)
 		: Base(f)
-	{}
+	{
+	}
 
 	explicit TMat4(const TMat3<T>& m3)
 	{
@@ -183,10 +211,11 @@ public:
 	}
 
 	explicit TMat4(const TTransform<T>& t)
-		: TMat4(TVec4<T>(t.getOrigin().xyz(), 1.0)
-		, t.getRotation().getRotationPart()
-		, t.getScale())
-	{}
+		: TMat4(TVec4<T>(t.getOrigin().xyz(), 1.0),
+			  t.getRotation().getRotationPart(),
+			  t.getScale())
+	{
+	}
 	/// @}
 
 	/// @name Other
@@ -240,21 +269,21 @@ public:
 		tmp[10] = in(0, 2) * in(1, 3);
 		tmp[11] = in(1, 2) * in(0, 3);
 
-		m4(0, 0) =  tmp[0] * in(1, 1) + tmp[3] * in(2, 1) + tmp[4] * in(3, 1);
+		m4(0, 0) = tmp[0] * in(1, 1) + tmp[3] * in(2, 1) + tmp[4] * in(3, 1);
 		m4(0, 0) -= tmp[1] * in(1, 1) + tmp[2] * in(2, 1) + tmp[5] * in(3, 1);
-		m4(0, 1) =  tmp[1] * in(0, 1) + tmp[6] * in(2, 1) + tmp[9] * in(3, 1);
+		m4(0, 1) = tmp[1] * in(0, 1) + tmp[6] * in(2, 1) + tmp[9] * in(3, 1);
 		m4(0, 1) -= tmp[0] * in(0, 1) + tmp[7] * in(2, 1) + tmp[8] * in(3, 1);
-		m4(0, 2) =  tmp[2] * in(0, 1) + tmp[7] * in(1, 1) + tmp[10] * in(3, 1);
+		m4(0, 2) = tmp[2] * in(0, 1) + tmp[7] * in(1, 1) + tmp[10] * in(3, 1);
 		m4(0, 2) -= tmp[3] * in(0, 1) + tmp[6] * in(1, 1) + tmp[11] * in(3, 1);
-		m4(0, 3) =  tmp[5] * in(0, 1) + tmp[8] * in(1, 1) + tmp[11] * in(2, 1);
+		m4(0, 3) = tmp[5] * in(0, 1) + tmp[8] * in(1, 1) + tmp[11] * in(2, 1);
 		m4(0, 3) -= tmp[4] * in(0, 1) + tmp[9] * in(1, 1) + tmp[10] * in(2, 1);
-		m4(1, 0) =  tmp[1] * in(1, 0) + tmp[2] * in(2, 0) + tmp[5] * in(3, 0);
+		m4(1, 0) = tmp[1] * in(1, 0) + tmp[2] * in(2, 0) + tmp[5] * in(3, 0);
 		m4(1, 0) -= tmp[0] * in(1, 0) + tmp[3] * in(2, 0) + tmp[4] * in(3, 0);
-		m4(1, 1) =  tmp[0] * in(0, 0) + tmp[7] * in(2, 0) + tmp[8] * in(3, 0);
+		m4(1, 1) = tmp[0] * in(0, 0) + tmp[7] * in(2, 0) + tmp[8] * in(3, 0);
 		m4(1, 1) -= tmp[1] * in(0, 0) + tmp[6] * in(2, 0) + tmp[9] * in(3, 0);
-		m4(1, 2) =  tmp[3] * in(0, 0) + tmp[6] * in(1, 0) + tmp[11] * in(3, 0);
+		m4(1, 2) = tmp[3] * in(0, 0) + tmp[6] * in(1, 0) + tmp[11] * in(3, 0);
 		m4(1, 2) -= tmp[2] * in(0, 0) + tmp[7] * in(1, 0) + tmp[10] * in(3, 0);
-		m4(1, 3) =  tmp[4] * in(0, 0) + tmp[9] * in(1, 0) + tmp[10] * in(2, 0);
+		m4(1, 3) = tmp[4] * in(0, 0) + tmp[9] * in(1, 0) + tmp[10] * in(2, 0);
 		m4(1, 3) -= tmp[5] * in(0, 0) + tmp[8] * in(1, 0) + tmp[11] * in(2, 0);
 
 		tmp[0] = in(2, 0) * in(3, 1);
@@ -270,25 +299,25 @@ public:
 		tmp[10] = in(0, 0) * in(1, 1);
 		tmp[11] = in(1, 0) * in(0, 1);
 
-		m4(2, 0) =  tmp[0] * in(1, 3) + tmp[3] * in(2, 3) + tmp[4] * in(3, 3);
+		m4(2, 0) = tmp[0] * in(1, 3) + tmp[3] * in(2, 3) + tmp[4] * in(3, 3);
 		m4(2, 0) -= tmp[1] * in(1, 3) + tmp[2] * in(2, 3) + tmp[5] * in(3, 3);
-		m4(2, 1) =  tmp[1] * in(0, 3) + tmp[6] * in(2, 3) + tmp[9] * in(3, 3);
+		m4(2, 1) = tmp[1] * in(0, 3) + tmp[6] * in(2, 3) + tmp[9] * in(3, 3);
 		m4(2, 1) -= tmp[0] * in(0, 3) + tmp[7] * in(2, 3) + tmp[8] * in(3, 3);
-		m4(2, 2) =  tmp[2] * in(0, 3) + tmp[7] * in(1, 3) + tmp[10] * in(3, 3);
+		m4(2, 2) = tmp[2] * in(0, 3) + tmp[7] * in(1, 3) + tmp[10] * in(3, 3);
 		m4(2, 2) -= tmp[3] * in(0, 3) + tmp[6] * in(1, 3) + tmp[11] * in(3, 3);
-		m4(2, 3) =  tmp[5] * in(0, 3) + tmp[8] * in(1, 3) + tmp[11] * in(2, 3);
+		m4(2, 3) = tmp[5] * in(0, 3) + tmp[8] * in(1, 3) + tmp[11] * in(2, 3);
 		m4(2, 3) -= tmp[4] * in(0, 3) + tmp[9] * in(1, 3) + tmp[10] * in(2, 3);
-		m4(3, 0) =  tmp[2] * in(2, 2) + tmp[5] * in(3, 2) + tmp[1] * in(1, 2);
+		m4(3, 0) = tmp[2] * in(2, 2) + tmp[5] * in(3, 2) + tmp[1] * in(1, 2);
 		m4(3, 0) -= tmp[4] * in(3, 2) + tmp[0] * in(1, 2) + tmp[3] * in(2, 2);
-		m4(3, 1) =  tmp[8] * in(3, 2) + tmp[0] * in(0, 2) + tmp[7] * in(2, 2);
+		m4(3, 1) = tmp[8] * in(3, 2) + tmp[0] * in(0, 2) + tmp[7] * in(2, 2);
 		m4(3, 1) -= tmp[6] * in(2, 2) + tmp[9] * in(3, 2) + tmp[1] * in(0, 2);
-		m4(3, 2) =  tmp[6] * in(1, 2) + tmp[11] * in(3, 2) + tmp[3] * in(0, 2);
+		m4(3, 2) = tmp[6] * in(1, 2) + tmp[11] * in(3, 2) + tmp[3] * in(0, 2);
 		m4(3, 2) -= tmp[10] * in(3, 2) + tmp[2] * in(0, 2) + tmp[7] * in(1, 2);
-		m4(3, 3) =  tmp[10] * in(2, 2) + tmp[4] * in(0, 2) + tmp[9] * in(1, 2);
+		m4(3, 3) = tmp[10] * in(2, 2) + tmp[4] * in(0, 2) + tmp[9] * in(1, 2);
 		m4(3, 3) -= tmp[8] * in(1, 2) + tmp[11] * in(2, 2) + tmp[5] * in(0, 2);
 
-		T det = in(0, 0) * m4(0, 0) + in(1, 0) * m4(0, 1)
-			+ in(2, 0) * m4(0, 2) + in(3, 0) * m4(0, 3);
+		T det = in(0, 0) * m4(0, 0) + in(1, 0) * m4(0, 1) + in(2, 0) * m4(0, 2)
+			+ in(3, 0) * m4(0, 3);
 
 		ANKI_ASSERT(!isZero<T>(det)); // Cannot invert, det == 0
 		det = 1.0 / det;
@@ -319,11 +348,22 @@ public:
 
 	static const TMat4& getIdentity()
 	{
-		static const TMat4 ident(
-			1.0, 0.0, 0.0, 0.0,
-			0.0, 1.0, 0.0, 0.0,
-			0.0, 0.0, 1.0, 0.0,
-			0.0, 0.0, 0.0, 1.0);
+		static const TMat4 ident(1.0,
+			0.0,
+			0.0,
+			0.0,
+			0.0,
+			1.0,
+			0.0,
+			0.0,
+			0.0,
+			0.0,
+			1.0,
+			0.0,
+			0.0,
+			0.0,
+			0.0,
+			1.0);
 		return ident;
 	}
 
@@ -379,12 +419,9 @@ public:
 		const TMat4& m = *this;
 
 		return TVec3<T>(
-			m(0, 0) * v.x() + m(0, 1) * v.y()
-			+ m(0, 2) * v.z() + m(0, 3),
-			m(1, 0) * v.x() + m(1, 1) * v.y()
-			+ m(1, 2) * v.z() + m(1, 3),
-			m(2, 0) * v.x() + m(2, 1) * v.y()
-			+ m(2, 2) * v.z() + m(2, 3));
+			m(0, 0) * v.x() + m(0, 1) * v.y() + m(0, 2) * v.z() + m(0, 3),
+			m(1, 0) * v.x() + m(1, 1) * v.y() + m(1, 2) * v.z() + m(1, 3),
+			m(2, 0) * v.x() + m(2, 1) * v.y() + m(2, 2) * v.z() + m(2, 3));
 	}
 	/// @}
 };
@@ -421,8 +458,10 @@ template<>
 TVec4<F32> TMat4<F32>::Base::operator*(const TVec4<F32>& b) const;
 
 template<>
-void TMat4<F32>::Base::setRows(const TVec4<F32>& a, const TVec4<F32>& b,
-	const TVec4<F32>& c, const TVec4<F32>& d);
+void TMat4<F32>::Base::setRows(const TVec4<F32>& a,
+	const TVec4<F32>& b,
+	const TVec4<F32>& c,
+	const TVec4<F32>& d);
 
 template<>
 void TMat4<F32>::Base::setRow(const U i, const TVec4<F32>& v);
@@ -432,7 +471,7 @@ void TMat4<F32>::Base::transpose();
 
 #elif ANKI_SIMD == ANKI_SIMD_NEON
 
-#	error "TODO"
+#error "TODO"
 
 #endif
 
@@ -444,4 +483,3 @@ static_assert(sizeof(Mat4) == sizeof(F32) * 4 * 4, "Incorrect size");
 } // end namespace anki
 
 #include <anki/math/Mat4.inl.h>
-

+ 11 - 8
include/anki/math/Mat4.inl.h

@@ -5,7 +5,8 @@
 
 #include <anki/math/CommonSrc.h>
 
-namespace anki {
+namespace anki
+{
 
 //==============================================================================
 // Friends                                                                     =
@@ -157,11 +158,11 @@ inline TMat4<F32> TMat4<F32>::Base::operator*(const TMat4<F32>& b) const
 
 		t1 = _mm_set1_ps(m(i, 0));
 		t2 = _mm_mul_ps(b.m_simd[0], t1);
-		t1 =_mm_set1_ps(m(i, 1));
+		t1 = _mm_set1_ps(m(i, 1));
 		t2 = _mm_add_ps(_mm_mul_ps(b.m_simd[1], t1), t2);
-		t1 =_mm_set1_ps(m(i, 2));
+		t1 = _mm_set1_ps(m(i, 2));
 		t2 = _mm_add_ps(_mm_mul_ps(b.m_simd[2], t1), t2);
-		t1 =_mm_set1_ps(m(i, 3));
+		t1 = _mm_set1_ps(m(i, 3));
 		t2 = _mm_add_ps(_mm_mul_ps(b.m_simd[3], t1), t2);
 
 		out.m_simd[i] = t2;
@@ -179,7 +180,7 @@ template<>
 inline TVec4<F32> TMat4<F32>::Base::operator*(const TVec4<F32>& b) const
 {
 	TVec4<F32> v;
-	
+
 	for(U i = 0; i < 4; i++)
 	{
 		_mm_store_ss(&v[i], _mm_dp_ps(m_simd[i], b.getSimd(), 0xF1));
@@ -194,8 +195,10 @@ inline TVec4<F32> TMat4<F32>::Base::operator*(const TVec4<F32>& b) const
 
 //==============================================================================
 template<>
-inline void TMat4<F32>::Base::setRows(const TVec4<F32>& a, const TVec4<F32>& b, 
-	const TVec4<F32>& c, const TVec4<F32>& d)
+inline void TMat4<F32>::Base::setRows(const TVec4<F32>& a,
+	const TVec4<F32>& b,
+	const TVec4<F32>& c,
+	const TVec4<F32>& d)
 {
 	m_simd[0] = a.getSimd();
 	m_simd[1] = b.getSimd();
@@ -219,7 +222,7 @@ inline void TMat4<F32>::Base::transpose()
 
 #elif ANKI_SIMD == ANKI_SIMD_NEON
 
-#	error "TODO"
+#error "TODO"
 
 #endif
 

+ 35 - 27
include/anki/math/Quat.h

@@ -8,15 +8,16 @@
 #include <anki/math/CommonIncludes.h>
 #include <anki/math/Vec4.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup math
 /// @{
 
 /// Quaternion. Used in rotations
 template<typename T>
-class alignas(16) TQuat:
-	public TVec<T, 4, typename TVec4Simd<T>::Type, TQuat<T>>
+class alignas(16) TQuat
+	: public TVec<T, 4, typename TVec4Simd<T>::Type, TQuat<T>>
 {
 public:
 	using Base = TVec<T, 4, typename TVec4Simd<T>::Type, TQuat<T>>;
@@ -31,40 +32,49 @@ public:
 	/// @name Constructors
 	/// @{
 	TQuat()
-	:	Base()
-	{}
+		: Base()
+	{
+	}
 
 	TQuat(const TQuat& b)
-	:	Base(b)
-	{}
+		: Base(b)
+	{
+	}
 
 	TQuat(const T x_, const T y_, const T z_, const T w_)
-	:	Base(x_, y_, z_, w_)
-	{}
+		: Base(x_, y_, z_, w_)
+	{
+	}
 
 	explicit TQuat(const T f)
-	:	Base(f)
-	{}
+		: Base(f)
+	{
+	}
 
 	explicit TQuat(const T arr[])
-	:	Base(arr)
-	{}
+		: Base(arr)
+	{
+	}
 
 	explicit TQuat(const typename Base::Simd& simd)
-	:	Base(simd)
-	{}
+		: Base(simd)
+	{
+	}
 
 	TQuat(const TVec2<T>& v, const T z_, const T w_)
-	:	Base(v, z_, w_)
-	{}
+		: Base(v, z_, w_)
+	{
+	}
 
 	TQuat(const TVec3<T>& v, const T w_)
-	:	Base(v, w_)
-	{}
+		: Base(v, w_)
+	{
+	}
 
 	explicit TQuat(const TVec4<T>& v)
-	:	Base(v.x(), v.y(), v.z(), v.w())
-	{}
+		: Base(v.x(), v.y(), v.z(), v.w())
+	{
+	}
 
 	explicit TQuat(const TMat3<T>& m3)
 	{
@@ -107,10 +117,10 @@ public:
 	}
 
 	explicit TQuat(const TMat3x4<T>& m)
-	:	TQuat(m.getRotationPart())
+		: TQuat(m.getRotationPart())
 	{
-		ANKI_ASSERT(isZero<T>(m(0, 3)) && isZero<T>(m(1, 3))
-			&& isZero<T>(m(2, 3)));
+		ANKI_ASSERT(
+			isZero<T>(m(0, 3)) && isZero<T>(m(1, 3)) && isZero<T>(m(2, 3)));
 	}
 
 	explicit TQuat(const TEuler<T>& eu)
@@ -260,8 +270,7 @@ public:
 	{
 		ANKI_ASSERT(isZero<T>(1.0 - Base::getLength())); // Not normalized quat
 		TVec3<T> qXyz(Base::xyz());
-		return
-			v + qXyz.cross(qXyz.cross(v) + v * Base::w()) * 2.0;
+		return v + qXyz.cross(qXyz.cross(v) + v * Base::w()) * 2.0;
 	}
 
 	void setIdentity()
@@ -281,4 +290,3 @@ typedef TQuat<F32> Quat;
 /// @}
 
 } // end namespace anki
-

+ 4 - 5
include/anki/math/Simd.h

@@ -8,12 +8,11 @@
 #include <anki/Config.h>
 
 #if ANKI_SIMD == ANKI_SIMD_SSE
-#	include <smmintrin.h>
+#include <smmintrin.h>
 #elif ANKI_SIMD == ANKI_SIMD_NEON
-#	include <arm_neon.h>
+#include <arm_neon.h>
 #elif ANKI_SIMD == ANKI_SIMD_NONE
-#	define ANKI_DUMMY_DUMMY_DUMMY 1
+#define ANKI_DUMMY_DUMMY_DUMMY 1
 #else
-#	error "See file"
+#error "See file"
 #endif
-

+ 6 - 5
include/anki/math/Transform.h

@@ -7,7 +7,8 @@
 
 #include <anki/math/CommonIncludes.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup math
 /// @{
@@ -20,7 +21,8 @@ public:
 	/// @name Constructors
 	/// @{
 	TTransform()
-	{}
+	{
+	}
 
 	TTransform(const TTransform& b)
 		: m_origin(b.m_origin)
@@ -38,8 +40,8 @@ public:
 		checkW();
 	}
 
-	TTransform(const TVec4<T>& origin, const TMat3x4<T>& rotation,
-		const T scale)
+	TTransform(
+		const TVec4<T>& origin, const TMat3x4<T>& rotation, const T scale)
 		: m_origin(origin)
 		, m_rotation(rotation)
 		, m_scale(scale)
@@ -211,4 +213,3 @@ typedef TTransform<F32> Transform;
 /// @}
 
 } // end namespace anki
-

+ 4 - 4
include/anki/math/Vec.h

@@ -8,7 +8,8 @@
 #include <anki/math/CommonIncludes.h>
 #include <type_traits>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup math
 /// @{
@@ -26,7 +27,8 @@ public:
 	/// @name Constructors
 	/// @{
 	TVec()
-	{}
+	{
+	}
 
 	TVec(const TVec& b)
 	{
@@ -310,7 +312,6 @@ public:
 		return TVec3<T>(z(), z(), z());
 	}
 
-
 	TVec4<T> xxxx() const
 	{
 		static_assert(N > 3, "Wrong vector");
@@ -2185,4 +2186,3 @@ protected:
 /// @}
 
 } // end namespace anki
-

+ 13 - 8
include/anki/math/Vec2.h

@@ -8,14 +8,15 @@
 #include <anki/math/CommonIncludes.h>
 #include <anki/math/Vec.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup math
 /// @{
 
 /// 2D vector
 template<typename T>
-class TVec2: public TVec<T, 2, Array<T, 2>, TVec2<T>>
+class TVec2 : public TVec<T, 2, Array<T, 2>, TVec2<T>>
 {
 	/// @name Friends
 	/// @{
@@ -36,23 +37,28 @@ public:
 	/// @{
 	TVec2()
 		: Base()
-	{}
+	{
+	}
 
 	TVec2(const TVec2& b)
 		: Base(b)
-	{}
+	{
+	}
 
 	TVec2(const T x_, const T y_)
 		: Base(x_, y_)
-	{}
+	{
+	}
 
 	explicit TVec2(const T f)
 		: Base(f)
-	{}
+	{
+	}
 
 	explicit TVec2(const T arr[])
 		: Base(arr)
-	{}
+	{
+	}
 	/// @}
 };
 
@@ -99,4 +105,3 @@ typedef TVec2<U32> UVec2;
 /// @}
 
 } // end namespace anki
-

+ 15 - 9
include/anki/math/Vec3.h

@@ -8,14 +8,15 @@
 #include <anki/math/CommonIncludes.h>
 #include <anki/math/Vec.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup math
 /// @{
 
 /// 3D vector template. One of the most used classes
 template<typename T>
-class TVec3: public TVec<T, 3, Array<T, 3>, TVec3<T>>
+class TVec3 : public TVec<T, 3, Array<T, 3>, TVec3<T>>
 {
 	/// @name Friends
 	/// @{
@@ -41,27 +42,33 @@ public:
 	/// @{
 	TVec3()
 		: Base()
-	{}
+	{
+	}
 
 	TVec3(const TVec3& b)
 		: Base(b)
-	{}
+	{
+	}
 
 	TVec3(const T x_, const T y_, const T z_)
 		: Base(x_, y_, z_)
-	{}
+	{
+	}
 
 	explicit TVec3(const T f)
 		: Base(f)
-	{}
+	{
+	}
 
 	explicit TVec3(const T arr[])
 		: Base(arr)
-	{}
+	{
+	}
 
 	TVec3(const TVec2<T>& v, const T z_)
 		: Base(v.x(), v.y(), z_)
-	{}
+	{
+	}
 	/// @}
 
 	/// @name Other
@@ -131,4 +138,3 @@ typedef TVec3<U32> UVec3;
 /// @}
 
 } // end namespace anki
-

+ 21 - 13
include/anki/math/Vec4.h

@@ -7,7 +7,8 @@
 
 #include <anki/math/CommonIncludes.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup math
 /// @{
@@ -37,8 +38,8 @@ struct TVec4Simd<F32>
 
 /// 4D vector. SIMD optimized
 template<typename T>
-class alignas(16) TVec4:
-	public TVec<T, 4, typename TVec4Simd<T>::Type, TVec4<T>>
+class alignas(16) TVec4
+	: public TVec<T, 4, typename TVec4Simd<T>::Type, TVec4<T>>
 {
 	/// @name Friends
 	/// @{
@@ -65,35 +66,43 @@ public:
 	/// @{
 	TVec4()
 		: Base()
-	{}
+	{
+	}
 
 	TVec4(const TVec4& b)
 		: Base(b)
-	{}
+	{
+	}
 
 	TVec4(const T x_, const T y_, const T z_, const T w_)
 		: Base(x_, y_, z_, w_)
-	{}
+	{
+	}
 
 	explicit TVec4(const T f)
 		: Base(f)
-	{}
+	{
+	}
 
 	explicit TVec4(const T arr[])
 		: Base(arr)
-	{}
+	{
+	}
 
 	explicit TVec4(const typename Base::Simd& simd)
 		: Base(simd)
-	{}
+	{
+	}
 
 	TVec4(const TVec2<T>& v, const T z_, const T w_)
 		: Base(v.x(), v.y(), z_, w_)
-	{}
+	{
+	}
 
 	TVec4(const TVec3<T>& v, const T w_)
 		: Base(v.x(), v.y(), v.z(), w_)
-	{}
+	{
+	}
 	/// @}
 
 	/// @name Operators with same
@@ -205,7 +214,7 @@ TVec4<F32> TVec4<F32>::Base::getAbs() const;
 
 #elif ANKI_SIMD == ANKI_SIMD_NEON
 
-#	error "TODO"
+#error "TODO"
 
 #endif
 
@@ -226,4 +235,3 @@ typedef TVec4<U32> UVec4;
 } // end namespace anki
 
 #include <anki/math/Vec4.inl.h>
-

+ 8 - 8
include/anki/math/Vec4.inl.h

@@ -5,7 +5,8 @@
 
 #include <anki/math/CommonSrc.h>
 
-namespace anki {
+namespace anki
+{
 
 //==============================================================================
 // Friends                                                                     =
@@ -69,8 +70,7 @@ inline TVec4<F32>::TVec4(const F32 arr[])
 
 //==============================================================================
 template<>
-inline TVec4<F32>::TVec4(const F32 x_, const F32 y_, const F32 z_, 
-	const F32 w_)
+inline TVec4<F32>::TVec4(const F32 x_, const F32 y_, const F32 z_, const F32 w_)
 {
 	m_simd = _mm_set_ps(w_, z_, y_, x_);
 }
@@ -166,12 +166,12 @@ inline TVec4<F32> TVec4<F32>::cross(const TVec4<F32>& b) const
 	const auto mask0 = _MM_SHUFFLE(3, 0, 2, 1);
 	const auto mask1 = _MM_SHUFFLE(3, 1, 0, 2);
 
-	__m128 tmp0 = _mm_mul_ps(_mm_shuffle_ps(a.m_simd, a.m_simd, mask0), 
+	__m128 tmp0 = _mm_mul_ps(_mm_shuffle_ps(a.m_simd, a.m_simd, mask0),
 		_mm_shuffle_ps(b.m_simd, b.m_simd, mask1));
-	__m128 tmp1 = _mm_mul_ps(_mm_shuffle_ps(a.m_simd, a.m_simd, mask1), 
+	__m128 tmp1 = _mm_mul_ps(_mm_shuffle_ps(a.m_simd, a.m_simd, mask1),
 		_mm_shuffle_ps(b.m_simd, b.m_simd, mask0));
 
-	return TVec4<F32>(_mm_sub_ps(tmp0, tmp1));	
+	return TVec4<F32>(_mm_sub_ps(tmp0, tmp1));
 }
 
 //==============================================================================
@@ -208,7 +208,7 @@ template<>
 inline TVec4<F32> TVec4<F32>::Base::getAbs() const
 {
 	static const __m128 signMask = _mm_set1_ps(-0.0f);
-	return TVec4<F32>(_mm_andnot_ps(signMask, m_simd));	
+	return TVec4<F32>(_mm_andnot_ps(signMask, m_simd));
 }
 
 #elif ANKI_SIMD == ANKI_SIMD_NEON
@@ -217,7 +217,7 @@ inline TVec4<F32> TVec4<F32>::Base::getAbs() const
 // NEON specializations                                                        =
 //==============================================================================
 
-#	error "TODO"
+#error "TODO"
 
 #endif
 

+ 5 - 4
include/anki/misc/ConfigSet.h

@@ -8,7 +8,8 @@
 #include <anki/util/List.h>
 #include <anki/util/String.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup misc
 /// @{
@@ -47,7 +48,7 @@ protected:
 	void newOption(const CString& name, F64 value);
 
 private:
-	class Option: public NonCopyable
+	class Option : public NonCopyable
 	{
 	public:
 		String m_name;
@@ -62,7 +63,8 @@ private:
 			, m_strVal(std::move(b.m_strVal))
 			, m_fVal(b.m_fVal)
 			, m_type(b.m_type)
-		{}
+		{
+		}
 
 		~Option() = default;
 
@@ -78,4 +80,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 13 - 10
include/anki/misc/Xml.h

@@ -10,10 +10,11 @@
 #include <anki/Math.h>
 #include <tinyxml2.h>
 #if !ANKI_TINYXML2
-#	error "Wrong tinyxml2 included"
+#error "Wrong tinyxml2 included"
 #endif
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup misc
 /// @{
@@ -26,18 +27,21 @@ class XmlElement
 public:
 	XmlElement()
 		: m_el(nullptr)
-	{}
+	{
+	}
 
 	XmlElement(const XmlElement& b)
 		: m_el(b.m_el)
 		, m_alloc(b.m_alloc)
-	{}
+	{
+	}
 
-	XmlElement(const tinyxml2::XMLElement* el,
-		GenericMemoryPoolAllocator<U8> alloc)
+	XmlElement(
+		const tinyxml2::XMLElement* el, GenericMemoryPoolAllocator<U8> alloc)
 		: m_el(el)
 		, m_alloc(alloc)
-	{}
+	{
+	}
 
 	/// If element has something return true
 	operator Bool() const
@@ -108,8 +112,8 @@ public:
 	ANKI_USE_RESULT Error parse(
 		const CString& xmlText, GenericMemoryPoolAllocator<U8> alloc);
 
-	ANKI_USE_RESULT Error getChildElement(const CString& name,
-		XmlElement& out) const;
+	ANKI_USE_RESULT Error getChildElement(
+		const CString& name, XmlElement& out) const;
 
 private:
 	tinyxml2::XMLDocument m_doc;
@@ -118,4 +122,3 @@ private:
 /// @}
 
 } // end namespace anki
-

+ 3 - 3
include/anki/physics/Common.h

@@ -11,7 +11,8 @@
 #include <anki/Math.h>
 #include <Newton.h>
 
-namespace anki {
+namespace anki
+{
 
 // Forward
 class PhysicsObject;
@@ -39,7 +40,7 @@ using PhysicsBodyPtr = PhysicsPtr<PhysicsBody>;
 using PhysicsPlayerControllerPtr = PhysicsPtr<PhysicsPlayerController>;
 
 /// Material types.
-enum class PhysicsMaterialBit: U16
+enum class PhysicsMaterialBit : U16
 {
 	NONE = 0,
 	STATIC_GEOMETRY = 1 << 0,
@@ -76,4 +77,3 @@ ANKI_USE_RESULT inline Mat4 toNewton(const Mat4& m)
 /// @}
 
 } // end namespace anki
-

+ 0 - 1
include/anki/physics/Forward.h

@@ -6,4 +6,3 @@
 #pragma once
 
 #include <anki/physics/Common.h>
-

+ 5 - 8
include/anki/physics/PhysicsBody.h

@@ -7,7 +7,8 @@
 
 #include <anki/physics/PhysicsObject.h>
 
-namespace anki {
+namespace anki
+{
 
 /// @addtogroup physics
 /// @{
@@ -24,7 +25,7 @@ struct PhysicsBodyInitializer
 };
 
 /// Rigid body.
-class PhysicsBody: public PhysicsObject
+class PhysicsBody : public PhysicsObject
 {
 public:
 	using Initializer = PhysicsBodyInitializer;
@@ -84,18 +85,14 @@ private:
 	Bool8 m_updated = true;
 
 	/// Newton callback.
-	static void onTransformCallback(
-		const NewtonBody* const body,
+	static void onTransformCallback(const NewtonBody* const body,
 		const dFloat* const matrix,
 		int threadIndex);
 
 	/// Newton callback
 	static void applyGravityForce(
-		const NewtonBody* body,
-		dFloat timestep,
-		int threadIndex);
+		const NewtonBody* body, dFloat timestep, int threadIndex);
 };
 /// @}
 
 } // end namespace anki
-

Some files were not shown because too many files changed in this diff