Browse Source

- Changing the structure to a more library friendly one. All headers in include/ and all sources in src/
- Replacing a fiew boost dependencies to C++11

Panagiotis Christopoulos Charitos 13 years ago
parent
commit
00a11aa706
100 changed files with 18 additions and 97 deletions
  1. 3 2
      CMakeLists.txt
  2. 0 33
      anki/script/math/Common.h
  3. 0 27
      anki/util/StdTypes.h
  4. 0 0
      include/anki/Version.h.cmake
  5. 0 0
      include/anki/collision/Aabb.h
  6. 0 0
      include/anki/collision/Collision.h
  7. 0 0
      include/anki/collision/CollisionAlgorithmsMatrix.h
  8. 0 0
      include/anki/collision/CollisionShape.h
  9. 0 0
      include/anki/collision/Forward.h
  10. 0 0
      include/anki/collision/Frustum.h
  11. 0 0
      include/anki/collision/LineSegment.h
  12. 0 0
      include/anki/collision/Obb.h
  13. 0 0
      include/anki/collision/Plane.h
  14. 0 0
      include/anki/collision/Ray.h
  15. 0 0
      include/anki/collision/Sphere.h
  16. 0 1
      include/anki/core/App.h
  17. 0 0
      include/anki/core/AsyncLoader.h
  18. 0 0
      include/anki/core/Globals.h
  19. 0 0
      include/anki/core/Logger.h
  20. 0 0
      include/anki/core/ParallelJob.h
  21. 0 0
      include/anki/core/ParallelManager.h
  22. 0 0
      include/anki/core/StdinListener.h
  23. 0 0
      include/anki/event/Event.h
  24. 0 0
      include/anki/event/EventManager.h
  25. 0 0
      include/anki/event/EventManager.inl.h
  26. 0 0
      include/anki/event/MainRendererPpsHdrEvent.h
  27. 0 0
      include/anki/event/SceneColorEvent.h
  28. 0 0
      include/anki/gl/BufferObject.h
  29. 0 0
      include/anki/gl/Fbo.h
  30. 0 0
      include/anki/gl/GlException.h
  31. 0 0
      include/anki/gl/GlStateMachine.h
  32. 0 0
      include/anki/gl/Query.h
  33. 0 0
      include/anki/gl/ShaderProgram.h
  34. 0 0
      include/anki/gl/Texture.h
  35. 0 0
      include/anki/gl/Vao.h
  36. 0 0
      include/anki/gl/Vbo.h
  37. 0 0
      include/anki/input/Input.h
  38. 0 0
      include/anki/math/Axisang.h
  39. 0 0
      include/anki/math/Axisang.inl.h
  40. 0 0
      include/anki/math/Euler.h
  41. 0 0
      include/anki/math/Euler.inl.h
  42. 0 0
      include/anki/math/Forward.h
  43. 0 0
      include/anki/math/Mat3.h
  44. 0 0
      include/anki/math/Mat3.inl.h
  45. 0 0
      include/anki/math/Mat4.h
  46. 0 0
      include/anki/math/Mat4.inl.h
  47. 0 0
      include/anki/math/Math.h
  48. 0 0
      include/anki/math/Math.inl.h
  49. 0 0
      include/anki/math/MathCommonIncludes.h
  50. 0 0
      include/anki/math/MathCommonSrc.h
  51. 0 0
      include/anki/math/MathSimd.h
  52. 0 0
      include/anki/math/Quat.h
  53. 0 0
      include/anki/math/Quat.inl.h
  54. 0 0
      include/anki/math/Transform.h
  55. 0 0
      include/anki/math/Transform.inl.h
  56. 0 0
      include/anki/math/Vec2.h
  57. 0 0
      include/anki/math/Vec2.inl.h
  58. 0 0
      include/anki/math/Vec3.h
  59. 0 0
      include/anki/math/Vec3.inl.h
  60. 0 0
      include/anki/math/Vec4.h
  61. 0 0
      include/anki/math/Vec4.inl.h
  62. 0 0
      include/anki/misc/Parser.h
  63. 0 0
      include/anki/misc/Parser.inl.h
  64. 0 0
      include/anki/misc/PropertyTree.h
  65. 0 0
      include/anki/physics/Character.h
  66. 0 0
      include/anki/physics/Convertors.h
  67. 0 0
      include/anki/physics/MotionState.h
  68. 0 0
      include/anki/physics/PhysWorld.h
  69. 0 0
      include/anki/physics/Ragdoll.h
  70. 0 0
      include/anki/physics/RigidBody.h
  71. 0 0
      include/anki/renderer/Bl.h
  72. 0 0
      include/anki/renderer/Bs.h
  73. 0 0
      include/anki/renderer/Dbg.h
  74. 0 0
      include/anki/renderer/Deformer.h
  75. 0 0
      include/anki/renderer/Drawer.h
  76. 0 0
      include/anki/renderer/Ez.h
  77. 0 0
      include/anki/renderer/Hdr.h
  78. 0 0
      include/anki/renderer/Is.h
  79. 0 0
      include/anki/renderer/MainRenderer.h
  80. 0 0
      include/anki/renderer/Ms.h
  81. 0 0
      include/anki/renderer/Pps.h
  82. 0 0
      include/anki/renderer/Renderer.h
  83. 0 0
      include/anki/renderer/RendererInitializer.h
  84. 0 0
      include/anki/renderer/RenderingPass.h
  85. 0 0
      include/anki/renderer/Sm.h
  86. 0 0
      include/anki/renderer/Smo.h
  87. 0 0
      include/anki/renderer/Ssao.h
  88. 0 0
      include/anki/resource/AsyncOperator.h
  89. 0 0
      include/anki/resource/AsyncTextureResourceManager.h
  90. 0 0
      include/anki/resource/DummyRsrc.h
  91. 5 16
      include/anki/resource/Extension.h
  92. 10 15
      include/anki/resource/Image.h
  93. 0 0
      include/anki/resource/LightRsrc.h
  94. 0 0
      include/anki/resource/Material.h
  95. 0 0
      include/anki/resource/MaterialCommon.h
  96. 0 0
      include/anki/resource/MaterialShaderProgramCreator.h
  97. 0 0
      include/anki/resource/Mesh.h
  98. 0 3
      include/anki/resource/MeshLoader.h
  99. 0 0
      include/anki/resource/Model.h
  100. 0 0
      include/anki/resource/ParticleEmitterRsrc.h

+ 3 - 2
CMakeLists.txt

@@ -61,7 +61,7 @@ ENDIF()
 #
 SET(ANKI_VERSION 0.1)
 
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/anki/Version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/anki/Version.h)
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/include/anki/Version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/anki/Version.h)
 
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/anki/Version.h DESTINATION ${INCLUDE_INSTALL_DIR}/anki)
 	
@@ -153,7 +153,8 @@ INCLUDE_DIRECTORIES(${ANKI_PROJ_SOURCE_DIR})
 #
 # libanki
 #
-ADD_SUBDIRECTORY(anki)
+INCLUDE_DIRECTORIES(include)
+ADD_SUBDIRECTORY(src)
 
 #
 # Unit tests

+ 0 - 33
anki/script/math/Common.h

@@ -1,33 +0,0 @@
-#ifndef ANKI_SCRIPT_MATH_COMMON_H
-#define ANKI_SCRIPT_MATH_COMMON_H
-
-#include "anki/script/Common.h"
-
-
-namespace anki {
-
-
-template<typename ClassType, typename RetType,
-	RetType (ClassType::* accessor)() const>
-RetType getM(const ClassType* t)
-{
-	return (t->*accessor)();
-}
-
-
-template<typename ClassType, typename InType, InType& (ClassType::* accessor)()>
-void setM(ClassType* t, InType in)
-{
-	(t->*accessor)() = in;
-}
-
-
-#define BP_PROPERTY_MATH(ClassType__, name__) \
-	.add_property(#name__, &getM<ClassType__, float, &ClassType__::name__>, \
-		&setM<ClassType__, float, &ClassType__::name__>)
-
-
-} // end namespace
-
-
-#endif

+ 0 - 27
anki/util/StdTypes.h

@@ -1,27 +0,0 @@
-#ifndef ANKI_UTIL_STD_TYPES_H
-#define ANKI_UTIL_STD_TYPES_H
-
-
-#ifndef uchar
-typedef unsigned char uchar;
-#endif
-
-#ifndef uint
-typedef unsigned int uint;
-#endif
-
-#ifndef ushort
-typedef unsigned short int ushort;
-#endif
-
-#ifndef ulong
-typedef unsigned long int ulong;
-#endif
-
-
-#if !defined(NULL)
-#	define NULL 0
-#endif
-
-
-#endif

+ 0 - 0
anki/Version.h.cmake → include/anki/Version.h.cmake


+ 0 - 0
anki/collision/Aabb.h → include/anki/collision/Aabb.h


+ 0 - 0
anki/collision/Collision.h → include/anki/collision/Collision.h


+ 0 - 0
anki/collision/CollisionAlgorithmsMatrix.h → include/anki/collision/CollisionAlgorithmsMatrix.h


+ 0 - 0
anki/collision/CollisionShape.h → include/anki/collision/CollisionShape.h


+ 0 - 0
anki/collision/Forward.h → include/anki/collision/Forward.h


+ 0 - 0
anki/collision/Frustum.h → include/anki/collision/Frustum.h


+ 0 - 0
anki/collision/LineSegment.h → include/anki/collision/LineSegment.h


+ 0 - 0
anki/collision/Obb.h → include/anki/collision/Obb.h


+ 0 - 0
anki/collision/Plane.h → include/anki/collision/Plane.h


+ 0 - 0
anki/collision/Ray.h → include/anki/collision/Ray.h


+ 0 - 0
anki/collision/Sphere.h → include/anki/collision/Sphere.h


+ 0 - 1
anki/core/App.h → include/anki/core/App.h

@@ -3,7 +3,6 @@
 
 #include <SDL/SDL.h>
 #include <boost/filesystem.hpp>
-#include "anki/util/StdTypes.h"
 #include "anki/core/Logger.h"
 
 

+ 0 - 0
anki/core/AsyncLoader.h → include/anki/core/AsyncLoader.h


+ 0 - 0
anki/core/Globals.h → include/anki/core/Globals.h


+ 0 - 0
anki/core/Logger.h → include/anki/core/Logger.h


+ 0 - 0
anki/core/ParallelJob.h → include/anki/core/ParallelJob.h


+ 0 - 0
anki/core/ParallelManager.h → include/anki/core/ParallelManager.h


+ 0 - 0
anki/core/StdinListener.h → include/anki/core/StdinListener.h


+ 0 - 0
anki/event/Event.h → include/anki/event/Event.h


+ 0 - 0
anki/event/EventManager.h → include/anki/event/EventManager.h


+ 0 - 0
anki/event/EventManager.inl.h → include/anki/event/EventManager.inl.h


+ 0 - 0
anki/event/MainRendererPpsHdrEvent.h → include/anki/event/MainRendererPpsHdrEvent.h


+ 0 - 0
anki/event/SceneColorEvent.h → include/anki/event/SceneColorEvent.h


+ 0 - 0
anki/gl/BufferObject.h → include/anki/gl/BufferObject.h


+ 0 - 0
anki/gl/Fbo.h → include/anki/gl/Fbo.h


+ 0 - 0
anki/gl/GlException.h → include/anki/gl/GlException.h


+ 0 - 0
anki/gl/GlStateMachine.h → include/anki/gl/GlStateMachine.h


+ 0 - 0
anki/gl/Query.h → include/anki/gl/Query.h


+ 0 - 0
anki/gl/ShaderProgram.h → include/anki/gl/ShaderProgram.h


+ 0 - 0
anki/gl/Texture.h → include/anki/gl/Texture.h


+ 0 - 0
anki/gl/Vao.h → include/anki/gl/Vao.h


+ 0 - 0
anki/gl/Vbo.h → include/anki/gl/Vbo.h


+ 0 - 0
anki/input/Input.h → include/anki/input/Input.h


+ 0 - 0
anki/math/Axisang.h → include/anki/math/Axisang.h


+ 0 - 0
anki/math/Axisang.inl.h → include/anki/math/Axisang.inl.h


+ 0 - 0
anki/math/Euler.h → include/anki/math/Euler.h


+ 0 - 0
anki/math/Euler.inl.h → include/anki/math/Euler.inl.h


+ 0 - 0
anki/math/Forward.h → include/anki/math/Forward.h


+ 0 - 0
anki/math/Mat3.h → include/anki/math/Mat3.h


+ 0 - 0
anki/math/Mat3.inl.h → include/anki/math/Mat3.inl.h


+ 0 - 0
anki/math/Mat4.h → include/anki/math/Mat4.h


+ 0 - 0
anki/math/Mat4.inl.h → include/anki/math/Mat4.inl.h


+ 0 - 0
anki/math/Math.h → include/anki/math/Math.h


+ 0 - 0
anki/math/Math.inl.h → include/anki/math/Math.inl.h


+ 0 - 0
anki/math/MathCommonIncludes.h → include/anki/math/MathCommonIncludes.h


+ 0 - 0
anki/math/MathCommonSrc.h → include/anki/math/MathCommonSrc.h


+ 0 - 0
anki/math/MathSimd.h → include/anki/math/MathSimd.h


+ 0 - 0
anki/math/Quat.h → include/anki/math/Quat.h


+ 0 - 0
anki/math/Quat.inl.h → include/anki/math/Quat.inl.h


+ 0 - 0
anki/math/Transform.h → include/anki/math/Transform.h


+ 0 - 0
anki/math/Transform.inl.h → include/anki/math/Transform.inl.h


+ 0 - 0
anki/math/Vec2.h → include/anki/math/Vec2.h


+ 0 - 0
anki/math/Vec2.inl.h → include/anki/math/Vec2.inl.h


+ 0 - 0
anki/math/Vec3.h → include/anki/math/Vec3.h


+ 0 - 0
anki/math/Vec3.inl.h → include/anki/math/Vec3.inl.h


+ 0 - 0
anki/math/Vec4.h → include/anki/math/Vec4.h


+ 0 - 0
anki/math/Vec4.inl.h → include/anki/math/Vec4.inl.h


+ 0 - 0
anki/misc/Parser.h → include/anki/misc/Parser.h


+ 0 - 0
anki/misc/Parser.inl.h → include/anki/misc/Parser.inl.h


+ 0 - 0
anki/misc/PropertyTree.h → include/anki/misc/PropertyTree.h


+ 0 - 0
anki/physics/Character.h → include/anki/physics/Character.h


+ 0 - 0
anki/physics/Convertors.h → include/anki/physics/Convertors.h


+ 0 - 0
anki/physics/MotionState.h → include/anki/physics/MotionState.h


+ 0 - 0
anki/physics/PhysWorld.h → include/anki/physics/PhysWorld.h


+ 0 - 0
anki/physics/Ragdoll.h → include/anki/physics/Ragdoll.h


+ 0 - 0
anki/physics/RigidBody.h → include/anki/physics/RigidBody.h


+ 0 - 0
anki/renderer/Bl.h → include/anki/renderer/Bl.h


+ 0 - 0
anki/renderer/Bs.h → include/anki/renderer/Bs.h


+ 0 - 0
anki/renderer/Dbg.h → include/anki/renderer/Dbg.h


+ 0 - 0
anki/renderer/Deformer.h → include/anki/renderer/Deformer.h


+ 0 - 0
anki/renderer/Drawer.h → include/anki/renderer/Drawer.h


+ 0 - 0
anki/renderer/Ez.h → include/anki/renderer/Ez.h


+ 0 - 0
anki/renderer/Hdr.h → include/anki/renderer/Hdr.h


+ 0 - 0
anki/renderer/Is.h → include/anki/renderer/Is.h


+ 0 - 0
anki/renderer/MainRenderer.h → include/anki/renderer/MainRenderer.h


+ 0 - 0
anki/renderer/Ms.h → include/anki/renderer/Ms.h


+ 0 - 0
anki/renderer/Pps.h → include/anki/renderer/Pps.h


+ 0 - 0
anki/renderer/Renderer.h → include/anki/renderer/Renderer.h


+ 0 - 0
anki/renderer/RendererInitializer.h → include/anki/renderer/RendererInitializer.h


+ 0 - 0
anki/renderer/RenderingPass.h → include/anki/renderer/RenderingPass.h


+ 0 - 0
anki/renderer/Sm.h → include/anki/renderer/Sm.h


+ 0 - 0
anki/renderer/Smo.h → include/anki/renderer/Smo.h


+ 0 - 0
anki/renderer/Ssao.h → include/anki/renderer/Ssao.h


+ 0 - 0
anki/resource/AsyncOperator.h → include/anki/resource/AsyncOperator.h


+ 0 - 0
anki/resource/AsyncTextureResourceManager.h → include/anki/resource/AsyncTextureResourceManager.h


+ 0 - 0
anki/resource/DummyRsrc.h → include/anki/resource/DummyRsrc.h


+ 5 - 16
anki/resource/Extension.h → include/anki/resource/Extension.h

@@ -1,19 +1,11 @@
 #ifndef ANKI_RESOURCE_EXTENSION_H
 #define ANKI_RESOURCE_EXTENSION_H
 
-#include "anki/util/StdTypes.h"
-
-
 namespace anki {
 
-
-/// Extension @ref Resource resource
+/// Extension resource
 class Extension
 {
-private:
-	void* libHandle;
-	int(*foobarPtr)(void*);
-
 public:
 	Extension();
 	~Extension();
@@ -21,15 +13,12 @@ public:
 	/*template<typename Type>
 	int FooBar(Type* ptr) { DEBUG_ERR(foobarPtr==NULL);
 		return (*foobarPtr)(reinterpret_cast<Type*>(ptr)); }*/
-};
-
-
-inline Extension::Extension()
-	: libHandle(NULL), foobarPtr(NULL)
-{}
 
+private:
+	void* libHandle = nullptr;
+	int(*foobarPtr)(void*) = nullptr;
+};
 
 } // end namespace
 
-
 #endif

+ 10 - 15
anki/resource/Image.h → include/anki/resource/Image.h

@@ -1,14 +1,11 @@
 #ifndef ANKI_RESOURCE_IMAGE_H
 #define ANKI_RESOURCE_IMAGE_H
 
-#include "anki/util/StdTypes.h"
 #include "anki/util/Util.h"
 #include <vector>
 
-
 namespace anki {
 
-
 /// Image class.
 /// Used in Texture::load. Supported types: TGA and PNG
 class Image
@@ -49,12 +46,12 @@ public:
 
 	/// @name Accessors
 	/// @{
-	uint getWidth() const
+	uint32_t getWidth() const
 	{
 		return width;
 	}
 
-	uint getHeight() const
+	uint32_t getHeight() const
 	{
 		return height;
 	}
@@ -64,7 +61,7 @@ public:
 		return type;
 	}
 
-	const uchar* getData() const
+	const uint8_t* getData() const
 	{
 		return &data[0];
 	}
@@ -87,16 +84,16 @@ public:
 	void load(const char* filename);
 
 private:
-	uint width; ///< Image width
-	uint height; ///< Image height
+	uint32_t width; ///< Image width
+	uint32_t height; ///< Image height
 	ColorType type; ///< Image color type
-	std::vector<uchar> data; ///< Image data
+	std::vector<uint8_t> data; ///< Image data
 	DataCompression dataCompression;
 
 	/// @name TGA headers
 	/// @{
-	static uchar tgaHeaderUncompressed[12];
-	static uchar tgaHeaderCompressed[12];
+	static uint8_t tgaHeaderUncompressed[12];
+	static uint8_t tgaHeaderCompressed[12];
 	/// @}
 
 	/// Load a TGA
@@ -108,13 +105,13 @@ private:
 	/// @param[in] fs The input
 	/// @param[out] bpp Bits per pixel
 	/// @exception Exception
-	void loadUncompressedTga(std::fstream& fs, uint& bpp);
+	void loadUncompressedTga(std::fstream& fs, uint32_t& bpp);
 
 	/// Used by loadTga
 	/// @param[in] fs The input
 	/// @param[out] bpp Bits per pixel
 	/// @exception Exception
-	void loadCompressedTga(std::fstream& fs, uint& bpp);
+	void loadCompressedTga(std::fstream& fs, uint32_t& bpp);
 
 	/// Load PNG. Dont throw exception because libpng is in C
 	/// @param[in] filename The file to load
@@ -127,8 +124,6 @@ private:
 	void loadDds(const char* filename);
 };
 
-
 } // end namespace
 
-
 #endif

+ 0 - 0
anki/resource/LightRsrc.h → include/anki/resource/LightRsrc.h


+ 0 - 0
anki/resource/Material.h → include/anki/resource/Material.h


+ 0 - 0
anki/resource/MaterialCommon.h → include/anki/resource/MaterialCommon.h


+ 0 - 0
anki/resource/MaterialShaderProgramCreator.h → include/anki/resource/MaterialShaderProgramCreator.h


+ 0 - 0
anki/resource/Mesh.h → include/anki/resource/Mesh.h


+ 0 - 3
anki/resource/MeshLoader.h → include/anki/resource/MeshLoader.h

@@ -2,16 +2,13 @@
 #define ANKI_RESOURCE_MESH_LOADER_H
 
 #include "anki/math/Math.h"
-#include "anki/util/StdTypes.h"
 #include <boost/range/iterator_range.hpp>
 #include <boost/array.hpp>
 #include <string>
 #include <vector>
 
-
 namespace anki {
 
-
 /// Mesh data. This class loads the mesh file and the Mesh class loads it to
 /// the GPU
 ///

+ 0 - 0
anki/resource/Model.h → include/anki/resource/Model.h


+ 0 - 0
anki/resource/ParticleEmitterRsrc.h → include/anki/resource/ParticleEmitterRsrc.h


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