Browse Source

- Removing a few macros
- Removing the custom vector (Vec) and adding a few GCC defines for extra
assertion in STL containers

Panagiotis Christopoulos Charitos 14 years ago
parent
commit
97b21240a6
54 changed files with 401 additions and 351 deletions
  1. 3 1
      CMakeLists.txt
  2. 1 1
      src/Main.cpp
  3. 2 2
      src/core/Object.h
  4. 1 1
      src/gl/Vao.cpp
  5. 10 3
      src/gl/Vao.h
  6. 2 2
      src/phys/PhysWorld.h
  7. 3 3
      src/r/Dbg.cpp
  8. 1 1
      src/r/Dbg.h
  9. 0 1
      src/r/Ms.h
  10. 1 1
      src/rsrc/Image.cpp
  11. 4 3
      src/rsrc/Image.h
  12. 0 1
      src/rsrc/LightRsrc.h
  13. 14 15
      src/rsrc/Material.h
  14. 4 2
      src/rsrc/MaterialShaderProgramCreator.cpp
  15. 3 3
      src/rsrc/MaterialShaderProgramCreator.h
  16. 0 1
      src/rsrc/MaterialVariable.h
  17. 9 8
      src/rsrc/Mesh.cpp
  18. 1 1
      src/rsrc/MeshData.cpp
  19. 16 16
      src/rsrc/MeshData.h
  20. 3 3
      src/rsrc/Path.h
  21. 0 1
      src/rsrc/ResourceManager.h
  22. 4 2
      src/rsrc/RsrcAsyncLoadingReqsHandler.h
  23. 9 3
      src/rsrc/RsrcLoadingRequests.h
  24. 2 2
      src/rsrc/ShaderProgram.cpp
  25. 6 2
      src/rsrc/ShaderProgram.h
  26. 7 5
      src/rsrc/ShaderProgramPrePreprocessor.cpp
  27. 41 24
      src/rsrc/ShaderProgramPrePreprocessor.h
  28. 13 13
      src/rsrc/ShaderProgramUniformVariable.cpp
  29. 23 7
      src/rsrc/ShaderProgramVariable.h
  30. 31 11
      src/rsrc/SkelAnim.h
  31. 60 16
      src/rsrc/Skeleton.h
  32. 2 1
      src/rsrc/Skin.cpp
  33. 4 3
      src/rsrc/Skin.h
  34. 0 1
      src/rsrc/Texture.h
  35. 3 3
      src/scene/Camera.h
  36. 1 1
      src/scene/MaterialRuntime.cpp
  37. 25 7
      src/scene/ModelNode.h
  38. 1 1
      src/scene/ParticleEmitterNode.h
  39. 1 1
      src/scene/Scene.cpp
  40. 1 1
      src/scene/Scene.h
  41. 2 2
      src/scene/SceneNode.cpp
  42. 3 3
      src/scene/SceneNode.h
  43. 15 12
      src/scene/SkinNode.cpp
  44. 12 12
      src/scene/SkinNode.h
  45. 35 11
      src/scene/VisibilityInfo.h
  46. 0 1
      src/scene/VisibilityTester.h
  47. 1 4
      src/script/scene/ModelNode.cpp
  48. 2 1
      src/ui/UiFtFontLoader.cpp
  49. 6 5
      src/ui/UiFtFontLoader.h
  50. 0 1
      src/ui/UiPainterDevice.h
  51. 0 49
      src/util/Accessors.h
  52. 2 2
      src/util/Util.cpp
  53. 11 4
      src/util/Util.h
  54. 0 70
      src/util/Vec.h

+ 3 - 1
CMakeLists.txt

@@ -31,7 +31,9 @@ ELSE()
 	ADD_DEFINITIONS("-fsingle-precision-constant")
 ENDIF()
 
-IF(CMAKE_BUILD_TYPE STREQUAL Release OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
+IF(CMAKE_BUILD_TYPE STREQUAL Debug)
+	ADD_DEFINITIONS("-D_GLIBCXX_DEBUG -D_GLIBXX_DEBUG_PEDANTIC")
+ELSE()
 	ADD_DEFINITIONS("-DBOOST_DISABLE_ASSERTS -mtune=core2 -ffast-math")
 ENDIF()
 	

+ 1 - 1
src/Main.cpp

@@ -62,7 +62,7 @@ UiPainter* painter;
 
 
 // Physics
-Vec<btRigidBody*> boxes;
+std::vector<btRigidBody*> boxes;
 
 #define ARRAY_SIZE_X 5
 #define ARRAY_SIZE_Y 5

+ 2 - 2
src/core/Object.h

@@ -1,7 +1,7 @@
 #ifndef OBJECT_H
 #define OBJECT_H
 
-#include "util/Vec.h"
+#include <vector>
 
 
 /// A class for automatic garbage collection. Cause we -the programmers- get
@@ -10,7 +10,7 @@
 class Object
 {
 	public:
-		typedef Vec<Object*> Container;
+		typedef std::vector<Object*> Container;
 
 		/// Calls addChild if parent is not NULL
 		/// @exception Exception

+ 1 - 1
src/gl/Vao.cpp

@@ -51,7 +51,7 @@ void Vao::attachArrayBufferVbo(const Vbo& vbo,
 	GLint size, GLenum type, GLboolean normalized, GLsizei stride,
 	const GLvoid* pointer)
 {
-	attachArrayBufferVbo(vbo, attribVar.getLoc(), size, type, normalized,
+	attachArrayBufferVbo(vbo, attribVar.getLocation(), size, type, normalized,
 		stride, pointer);
 }
 

+ 10 - 3
src/gl/Vao.h

@@ -1,10 +1,11 @@
 #ifndef VAO_H
 #define VAO_H
 
-#include <GL/glew.h>
 #include "util/StdTypes.h"
+#include "util/Assert.h"
 #include "core/Object.h"
 #include "GlException.h"
+#include <GL/glew.h>
 
 
 class ShaderProgramAttributeVariable;
@@ -80,10 +81,16 @@ class Vao
 		void attachElementArrayBufferVbo(const Vbo& vbo);
 
 		/// Bind it
-		void bind() const {glBindVertexArray(glId);}
+		void bind() const
+		{
+			glBindVertexArray(glId);
+		}
 
 		/// Unbind all VAOs
-		static void unbind() {glBindVertexArray(0);}
+		static void unbind()
+		{
+			glBindVertexArray(0);
+		}
 
 	private:
 		uint glId; ///< The OpenGL id

+ 2 - 2
src/phys/PhysWorld.h

@@ -2,7 +2,7 @@
 #define PHYS_WORLD_H
 
 #include "Convertors.h"
-#include "util/Vec.h"
+#include <vector>
 #include <boost/scoped_ptr.hpp>
 #include <btBulletCollisionCommon.h>
 #include <btBulletDynamicsCommon.h>
@@ -53,7 +53,7 @@ class PhysWorld
 		/// Keep here for garbage collection
 		boost::scoped_ptr<btIDebugDraw> debugDrawer;
 		float defaultContactProcessingThreshold;
-		Vec<Character*> characters;
+		std::vector<Character*> characters;
 };
 
 

+ 3 - 3
src/r/Dbg.cpp

@@ -93,12 +93,12 @@ void Dbg::renderGrid()
 //==============================================================================
 void Dbg::drawSphere(float radius, int complexity)
 {
-	Vec<Vec3>* sphereLines;
+	std::vector<Vec3>* sphereLines;
 
 	//
 	// Pre-calculate the sphere points5
 	//
-	std::map<uint, Vec<Vec3> >::iterator it =
+	std::map<uint, std::vector<Vec3> >::iterator it =
 		complexityToPreCalculatedSphere.find(complexity);
 
 	if(it != complexityToPreCalculatedSphere.end()) // Found
@@ -107,7 +107,7 @@ void Dbg::drawSphere(float radius, int complexity)
 	}
 	else // Not found
 	{
-		complexityToPreCalculatedSphere[complexity] = Vec<Vec3>();
+		complexityToPreCalculatedSphere[complexity] = std::vector<Vec3>();
 		sphereLines = &complexityToPreCalculatedSphere[complexity];
 
 		float fi = Math::PI / complexity;

+ 1 - 1
src/r/Dbg.h

@@ -80,7 +80,7 @@ class Dbg: public SwitchableRenderingPass
 		/// This is a container of some precalculated spheres. Its a map that
 		/// from sphere complexity it returns a vector of lines (Vec3s in
 		/// pairs)
-		std::map<uint, Vec<Vec3> > complexityToPreCalculatedSphere;
+		std::map<uint, std::vector<Vec3> > complexityToPreCalculatedSphere;
 };
 
 

+ 0 - 1
src/r/Ms.h

@@ -4,7 +4,6 @@
 #include "RenderingPass.h"
 #include "rsrc/Texture.h"
 #include "gl/Fbo.h"
-#include "util/Accessors.h"
 #include "Ez.h"
 
 

+ 1 - 1
src/rsrc/Image.cpp

@@ -229,7 +229,7 @@ bool Image::loadPng(const char* filename, std::string& err) throw()
 	uint channels;
 	uint rowbytes;
 	uint colorType;
-	Vec<png_bytep> rowPointers;
+	std::vector<png_bytep> rowPointers;
 
 	//
 	// Open file

+ 4 - 3
src/rsrc/Image.h

@@ -1,8 +1,9 @@
 #ifndef IMAGE_H
 #define IMAGE_H
 
-#include "util/Vec.h"
 #include "util/StdTypes.h"
+#include "util/Util.h"
+#include <vector>
 
 
 /// Image class.
@@ -68,7 +69,7 @@ class Image
 		/// Get image size in bytes
 		size_t getDataSize() const
 		{
-			return data.getSizeInBytes();
+			return util::getVectorSizeInBytes(data);
 		}
 
 		DataCompression getDataCompression() const
@@ -86,7 +87,7 @@ class Image
 		uint width; ///< Image width
 		uint height; ///< Image height
 		ColorType type; ///< Image color type
-		Vec<uchar> data; ///< Image data
+		std::vector<uchar> data; ///< Image data
 		DataCompression dataCompression;
 
 		/// @name TGA headers

+ 0 - 1
src/rsrc/LightRsrc.h

@@ -4,7 +4,6 @@
 #include "m/Math.h"
 #include "RsrcPtr.h"
 #include "rsrc/Texture.h"
-#include "util/Accessors.h"
 
 
 /// Properties common for all lights

+ 14 - 15
src/rsrc/Material.h

@@ -137,7 +137,10 @@ class Material: public MaterialProperties
 		}
 
 		/// Access the base class just for copying in other classes
-		GETTER_R(MaterialProperties, *this, accessPropertiesBaseClass)
+		const MaterialProperties& getBaseClass() const
+		{
+			return *this;
+		}
 
 		const ShaderProgram& getShaderProgram(PassType p) const
 		{
@@ -152,10 +155,10 @@ class Material: public MaterialProperties
 				mtlVars.begin(), mtlVars.end());
 		}
 
-		boost::iterator_range<Vec<MaterialUserVariable*>::const_iterator>
+		boost::iterator_range<std::vector<MaterialUserVariable*>::const_iterator>
 			getUserVariables() const
 		{
-			return boost::iterator_range<Vec<MaterialUserVariable*>::
+			return boost::iterator_range<std::vector<MaterialUserVariable*>::
 				const_iterator>(userMtlVars.begin(), userMtlVars.end());
 		}
 
@@ -168,12 +171,17 @@ class Material: public MaterialProperties
 
 		/// Check if a buildin variable exists in a pass type
 		bool buildinVariableExits(MaterialBuildinVariable::MatchingVariable e,
-			PassType p) const;
+			PassType p) const
+		{
+			return buildinsArr[e] != NULL && buildinsArr[e]->inPass(p);
+		}
 
 		/// Check if a buildin variable exists in a any pass type
 		bool buildinVariableExits(
 			MaterialBuildinVariable::MatchingVariable e) const
-			{return buildinsArr[e] != NULL;}
+		{
+			return buildinsArr[e] != NULL;
+		}
 
 	private:
 		//======================================================================
@@ -195,7 +203,7 @@ class Material: public MaterialProperties
 
 		BuildinsArr buildinsArr; ///< To find. Initialize to int
 
-		Vec<MaterialUserVariable*> userMtlVars; ///< To iterate
+		std::vector<MaterialUserVariable*> userMtlVars; ///< To iterate
 
 		/// The most important aspect of materials
 		ShaderPrograms sProgs;
@@ -223,13 +231,4 @@ inline const MaterialBuildinVariable& Material::getBuildinVariable(
 }
 
 
-inline bool Material::buildinVariableExits(
-	MaterialBuildinVariable::MatchingVariable e,
-	PassType p) const
-
-{
-	return buildinsArr[e] != NULL && buildinsArr[e]->inPass(p);
-}
-
-
 #endif

+ 4 - 2
src/rsrc/MaterialShaderProgramCreator.cpp

@@ -348,7 +348,7 @@ void MaterialShaderProgramCreator::parseShaderProgramTag(
 	// <includes></includes>
 	//
 	boost::ptr_vector<FuncDefinition> funcDefs;
-	Vec<std::string> includeLines;
+	std::vector<std::string> includeLines;
 
 	const ptree& includesPt = pt.get_child("includes");
 	BOOST_FOREACH(const ptree::value_type& v, includesPt)
@@ -370,7 +370,9 @@ void MaterialShaderProgramCreator::parseShaderProgramTag(
 	//
 	// <ins></ins>
 	//
-	Vec<std::string> uniformsLines; // Store the source of the uniform vars
+
+	// Store the source of the uniform vars
+	std::vector<std::string> uniformsLines;
 
 	boost::optional<const ptree&> insPt = pt.get_child_optional("inputs");
 	if(insPt)

+ 3 - 3
src/rsrc/MaterialShaderProgramCreator.h

@@ -2,10 +2,9 @@
 #define MATERIAL_SHADER_PROGRAM_CREATOR_H
 
 #include "util/ConstCharPtrHashMap.h"
-#include "util/Vec.h"
-#include "util/Accessors.h"
 #include "util/scanner/Forward.h"
 #include <GL/glew.h>
+#include <vector>
 #include <boost/property_tree/ptree_fwd.hpp>
 #include <boost/ptr_container/ptr_vector.hpp>
 
@@ -100,7 +99,8 @@ class MaterialShaderProgramCreator
 		/// Go from function name to function definition
 		ConstCharPtrHashMap<FuncDefinition*>::Type funcNameToDef;
 
-		Vec<std::string> srcLines; ///< The lines of the shader program source
+		/// The lines of the shader program source
+		std::vector<std::string> srcLines;
 
 		std::string source; ///< Shader program final source
 

+ 0 - 1
src/rsrc/MaterialVariable.h

@@ -3,7 +3,6 @@
 
 #include "MaterialCommon.h"
 #include "ShaderProgramVariable.h"
-#include "util/Accessors.h"
 #include "util/Assert.h"
 #include <GL/glew.h>
 #include <string>

+ 9 - 8
src/rsrc/Mesh.cpp

@@ -1,9 +1,10 @@
-#include <fstream>
-#include <boost/lexical_cast.hpp>
 #include "Mesh.h"
 #include "rsrc/Material.h"
 #include "MeshData.h"
 #include "gl/Vbo.h"
+#include "util/Util.h"
+#include <fstream>
+#include <boost/lexical_cast.hpp>
 
 
 //==============================================================================
@@ -46,19 +47,19 @@ void Mesh::createVbos(const MeshData& meshData)
 {
 	vbos[VBO_VERT_INDECES].create(
 		GL_ELEMENT_ARRAY_BUFFER,
-		meshData.getVertIndeces().getSizeInBytes(),
+		util::getVectorSizeInBytes(meshData.getVertIndeces()),
 		&meshData.getVertIndeces()[0],
 		GL_STATIC_DRAW);
 
 	vbos[VBO_VERT_POSITIONS].create(
 		GL_ARRAY_BUFFER,
-		meshData.getVertCoords().getSizeInBytes(),
+		util::getVectorSizeInBytes(meshData.getVertCoords()),
 		&meshData.getVertCoords()[0],
 		GL_STATIC_DRAW);
 
 	vbos[VBO_VERT_NORMALS].create(
 		GL_ARRAY_BUFFER,
-		meshData.getVertNormals().getSizeInBytes(),
+		util::getVectorSizeInBytes(meshData.getVertNormals()),
 		&meshData.getVertNormals()[0],
 		GL_STATIC_DRAW);
 
@@ -66,7 +67,7 @@ void Mesh::createVbos(const MeshData& meshData)
 	{
 		vbos[VBO_VERT_TANGENTS].create(
 			GL_ARRAY_BUFFER,
-			meshData.getVertTangents().getSizeInBytes(),
+			util::getVectorSizeInBytes(meshData.getVertTangents()),
 			&meshData.getVertTangents()[0],
 			GL_STATIC_DRAW);
 	}
@@ -75,7 +76,7 @@ void Mesh::createVbos(const MeshData& meshData)
 	{
 		vbos[VBO_TEX_COORDS].create(
 			GL_ARRAY_BUFFER,
-			meshData.getTexCoords().getSizeInBytes(),
+			util::getVectorSizeInBytes(meshData.getTexCoords()),
 			&meshData.getTexCoords()[0],
 			GL_STATIC_DRAW);
 	}
@@ -84,7 +85,7 @@ void Mesh::createVbos(const MeshData& meshData)
 	{
 		vbos[VBO_VERT_WEIGHTS].create(
 			GL_ARRAY_BUFFER,
-			meshData.getVertWeights().getSizeInBytes(),
+			util::getVectorSizeInBytes(meshData.getVertWeights()),
 			&meshData.getVertWeights()[0],
 			GL_STATIC_DRAW);
 	}

+ 1 - 1
src/rsrc/MeshData.cpp

@@ -229,7 +229,7 @@ void MeshData::createVertNormals()
 void MeshData::createVertTangents()
 {
 	vertTangents.resize(vertCoords.size(), Vec4(0.0)); // alloc
-	Vec<Vec3> bitagents(vertCoords.size(), Vec3(0.0));
+	std::vector<Vec3> bitagents(vertCoords.size(), Vec3(0.0));
 
 	for(uint i = 0; i < tris.size(); i++)
 	{

+ 16 - 16
src/rsrc/MeshData.h

@@ -3,11 +3,10 @@
 
 #include "m/Math.h"
 #include "util/StdTypes.h"
-#include "util/Accessors.h"
-#include "util/Vec.h"
 #include <boost/range/iterator_range.hpp>
 #include <boost/array.hpp>
 #include <string>
+#include <vector>
 
 
 /// Mesh data. This class loads the mesh file and the Mesh class loads it to
@@ -76,37 +75,37 @@ class MeshData
 
 		/// @name Accessors
 		/// @{
-		const Vec<Vec3>& getVertCoords() const
+		const std::vector<Vec3>& getVertCoords() const
 		{
 			return vertCoords;
 		}
 
-		const Vec<Vec3>& getVertNormals() const
+		const std::vector<Vec3>& getVertNormals() const
 		{
 			return vertNormals;
 		}
 
-		const Vec<Vec4>& getVertTangents() const
+		const std::vector<Vec4>& getVertTangents() const
 		{
 			return vertTangents;
 		}
 
-		const Vec<Vec2>& getTexCoords() const
+		const std::vector<Vec2>& getTexCoords() const
 		{
 			return texCoords;
 		}
 
-		const Vec<VertexWeight>& getVertWeights() const
+		const std::vector<VertexWeight>& getVertWeights() const
 		{
 			return vertWeights;
 		}
 
-		const Vec<Triangle>& getTris() const
+		const std::vector<Triangle>& getTris() const
 		{
 			return tris;
 		}
 
-		const Vec<ushort>& getVertIndeces() const
+		const std::vector<ushort>& getVertIndeces() const
 		{
 			return vertIndeces;
 		}
@@ -115,14 +114,15 @@ class MeshData
 	private:
 		/// @name Data
 		/// @{
-		Vec<Vec3> vertCoords; ///< Loaded from file
-		Vec<Vec3> vertNormals; ///< Generated
-		Vec<Vec4> vertTangents; ///< Generated
+		std::vector<Vec3> vertCoords; ///< Loaded from file
+		std::vector<Vec3> vertNormals; ///< Generated
+		std::vector<Vec4> vertTangents; ///< Generated
 		/// Optional. One for every vert so we can use vertex arrays & VBOs
-		Vec<Vec2> texCoords;
-		Vec<VertexWeight> vertWeights; ///< Optional
-		Vec<Triangle> tris; ///< Required
-		Vec<ushort> vertIndeces; ///< Generated. Used for vertex arrays & VBOs
+		std::vector<Vec2> texCoords;
+		std::vector<VertexWeight> vertWeights; ///< Optional
+		std::vector<Triangle> tris; ///< Required
+		/// Generated. Used for vertex arrays & VBOs
+		std::vector<ushort> vertIndeces;
 		/// @}
 
 		/// Load the mesh data from a binary file

+ 3 - 3
src/rsrc/Path.h

@@ -8,9 +8,9 @@
 class Path
 {
 	public:
-		Vec<Vec3> positions; ///< AKA translations
-		Vec<Mat3> rotations;
-		Vec<float>  scales;
+		std::vector<Vec3> positions; ///< AKA translations
+		std::vector<Mat3> rotations;
+		std::vector<float>  scales;
 		float         step;
 
 		Path() {}

+ 0 - 1
src/rsrc/ResourceManager.h

@@ -5,7 +5,6 @@
 #include <boost/scoped_ptr.hpp>
 #include <string>
 #include "core/AsyncLoader.h"
-#include "util/Accessors.h"
 #include "RsrcHook.h"
 #include "RsrcAsyncLoadingReqsHandler.h"
 

+ 4 - 2
src/rsrc/RsrcAsyncLoadingReqsHandler.h

@@ -4,7 +4,6 @@
 #include <string>
 #include <boost/ptr_container/ptr_list.hpp>
 #include "core/AsyncLoader.h"
-#include "util/Accessors.h"
 #include "Image.h"
 #include "MeshData.h"
 #include "RsrcLoadingRequests.h"
@@ -20,7 +19,10 @@ class Mesh;
 class RsrcAsyncLoadingReqsHandler
 {
 	public:
-		GETTER_R(uint, frameServedRequestsNum, getFrameServedRequestsNum)
+		uint getFrameServedRequestsNum() const
+		{
+			return frameServedRequestsNum;
+		}
 
 		/// Send a loading request to an AsyncLoader
 		/// @tparam Type It should be Texture or Mesh

+ 9 - 3
src/rsrc/RsrcLoadingRequests.h

@@ -2,7 +2,6 @@
 #define RSRC_LOADING_REQUESTS_H
 
 #include <string>
-#include "util/Accessors.h"
 #include "rsrc/Image.h"
 
 
@@ -15,8 +14,15 @@ class Texture;
 class RsrcLoadingRequestBase
 {
 	public:
-		RsrcLoadingRequestBase(const char* filename_): filename(filename_) {}
-		GETTER_R(std::string, filename, getFilename)
+		RsrcLoadingRequestBase(const char* filename_)
+		:	filename(filename_)
+		{}
+
+		const std::string& getFilename() const
+		{
+			return filename;
+		}
+
 		virtual void postRequest(AsyncLoader& al) = 0;
 		virtual void doPostLoading() = 0;
 

+ 2 - 2
src/rsrc/ShaderProgram.cpp

@@ -72,7 +72,7 @@ uint ShaderProgram::createAndCompileShader(const char* sourceCode,
 		// print info log
 		int infoLen = 0;
 		int charsWritten = 0;
-		Vec<char> infoLog;
+		std::vector<char> infoLog;
 
 		glGetShaderiv(glId, GL_INFO_LOG_LENGTH, &infoLen);
 		infoLog.resize(infoLen + 1);
@@ -374,7 +374,7 @@ std::string ShaderProgram::getShaderInfoString() const
 	ss << "Variables:\n";
 	BOOST_FOREACH(const ShaderProgramVariable& var, vars)
 	{
-		ss << var.getName() << " " << var.getLoc() << " ";
+		ss << var.getName() << " " << var.getLocation() << " ";
 		if(var.getType() == ShaderProgramVariable::T_ATTRIBUTE)
 		{
 			ss << "attribute";

+ 6 - 2
src/rsrc/ShaderProgram.h

@@ -5,12 +5,12 @@
 #include "util/Assert.h"
 #include "ShaderProgramUniformVariable.h"
 #include "ShaderProgramAttributeVariable.h"
-#include "util/Vec.h"
 #include "gl/GlStateMachine.h"
 #include "core/Globals.h"
 #include <boost/ptr_container/ptr_vector.hpp>
 #include <GL/glew.h>
 #include <limits>
+#include <vector>
 
 
 /// Shader program @ref Resource
@@ -29,7 +29,11 @@ class ShaderProgram
 		/// @name Accessors
 		/// @{
 		GLuint getGlId() const;
-		GETTER_R(boost::ptr_vector<ShaderProgramVariable>, vars, getVariables)
+
+		const boost::ptr_vector<ShaderProgramVariable>& getVariables() const
+		{
+			return vars;
+		}
 		/// @}
 
 		/// Resource load

+ 7 - 5
src/rsrc/ShaderProgramPrePreprocessor.cpp

@@ -49,7 +49,7 @@ void ShaderProgramPrePreprocessor::parseFileForPragmas(
 	}
 
 	// load file in lines
-	Vec<std::string> lines = util::getFileLines(filename.c_str());
+	std::vector<std::string> lines = util::getFileLines(filename.c_str());
 	if(lines.size() < 1)
 	{
 		throw EXCEPTION("File \"" + filename + "\": Cannot open or empty");
@@ -251,7 +251,8 @@ void ShaderProgramPrePreprocessor::parseFile(const char* filename)
 // parseStartPragma                                                            =
 //==============================================================================
 void ShaderProgramPrePreprocessor::parseStartPragma(scanner::Scanner& scanner,
-	const std::string& filename, uint depth, const Vec<std::string>& lines)
+	const std::string& filename, uint depth,
+	const std::vector<std::string>& lines)
 {
 	const scanner::Token* token = &scanner.getNextToken();
 
@@ -302,7 +303,7 @@ void ShaderProgramPrePreprocessor::parseStartPragma(scanner::Scanner& scanner,
 //==============================================================================
 void ShaderProgramPrePreprocessor::parseIncludePragma(
 	scanner::Scanner& scanner, const std::string& /*filename*/, uint depth,
-	const Vec<std::string>& lines)
+	const std::vector<std::string>& lines)
 {
 	const scanner::Token* token = &scanner.getNextToken();
 
@@ -330,7 +331,8 @@ void ShaderProgramPrePreprocessor::parseIncludePragma(
 // parseTrffbVarying                                                           =
 //==============================================================================
 void ShaderProgramPrePreprocessor::parseTrffbVarying(scanner::Scanner& scanner,
-	const std::string& filename, uint /*depth*/, const Vec<std::string>& lines)
+	const std::string& filename, uint /*depth*/,
+	const std::vector<std::string>& lines)
 {
 	const scanner::Token* token = &scanner.getNextToken();
 
@@ -339,7 +341,7 @@ void ShaderProgramPrePreprocessor::parseTrffbVarying(scanner::Scanner& scanner,
 		std::string varName = token->getValue().getString();
 
 		// check if already defined and for circular includance
-		Vec<TrffbVaryingPragma>::const_iterator var =
+		std::vector<TrffbVaryingPragma>::const_iterator var =
 			findNamed(output.trffbVaryings, varName);
 
 		// Throw the correct exception

+ 41 - 24
src/rsrc/ShaderProgramPrePreprocessor.h

@@ -1,17 +1,12 @@
 #ifndef SHADER_PROGRAM_PRE_PREPROCESSOR_H
 #define SHADER_PROGRAM_PRE_PREPROCESSOR_H
 
-#include "util/Vec.h"
 #include "util/StdTypes.h"
-#include "util/Accessors.h"
+#include "util/scanner/Forward.h"
 #include "ShaderProgramCommon.h"
 #include <limits>
 #include <boost/array.hpp>
-
-
-namespace scanner {
-class Scanner;
-}
+#include <vector>
 
 
 /// Helper class used for shader program loading
@@ -36,16 +31,25 @@ class ShaderProgramPrePreprocessor
 		/// @param[in] filename The file to load
 		/// @exception Exception
 		ShaderProgramPrePreprocessor(const char* filename)
-			{parseFile(filename);}
+		{
+			parseFile(filename);
+		}
 
 		/// Destructor does nothing
-		~ShaderProgramPrePreprocessor() {}
+		~ShaderProgramPrePreprocessor()
+		{}
 
 		/// @name Accessors
 		/// @{
-		GETTER_R(Vec<std::string>, trffbVaryings, getTranformFeedbackVaryings)
+		const std::vector<std::string>& getTranformFeedbackVaryings() const
+		{
+			return trffbVaryings;
+		}
+
 		const std::string& getShaderSource(ShaderType type)
-			{return output.shaderSources[type];}
+		{
+			return output.shaderSources[type];
+		}
 		/// @}
 
 	protected:
@@ -54,9 +58,17 @@ class ShaderProgramPrePreprocessor
 		{
 			std::string definedInFile;
 			int definedInLine;
-			Pragma(): definedInLine(-1) {}
+
+			Pragma()
+			:	definedInLine(-1)
+			{}
+
 			Pragma(const std::string& definedInFile_, int definedInLine_);
-			bool isDefined() const {return definedInLine != -1;}
+
+			bool isDefined() const
+			{
+				return definedInLine != -1;
+			}
 		};
 		
 		struct IncludePragma: Pragma
@@ -78,7 +90,9 @@ class ShaderProgramPrePreprocessor
 			/// file
 			int globalLine;
 
-			CodeBeginningPragma(): globalLine(-1) {}
+			CodeBeginningPragma()
+			:	globalLine(-1)
+			{}
 		};
 
 		/// The output of the class packed in this struct
@@ -87,13 +101,14 @@ class ShaderProgramPrePreprocessor
 			friend class PrePreprocessor;
 
 			/// Names and and ids for transform feedback varyings
-			Vec<TrffbVaryingPragma> trffbVaryings;
+			std::vector<TrffbVaryingPragma> trffbVaryings;
 			boost::array<std::string, ST_NUM> shaderSources;
 		};
 
 		Output output; ///< The most important variable
-		Vec<std::string> trffbVaryings;
-		Vec<std::string> sourceLines;  ///< The parseFileForPragmas fills this
+		std::vector<std::string> trffbVaryings;
+		/// The parseFileForPragmas fills this
+		std::vector<std::string> sourceLines;
 		boost::array<CodeBeginningPragma, ST_NUM> shaderStarts;
 		static boost::array<const char*, ST_NUM> startTokens; ///< XXX
 
@@ -115,17 +130,17 @@ class ShaderProgramPrePreprocessor
 		/// @todo
 		void parseStartPragma(scanner::Scanner& scanner,
 			const std::string& filename, uint depth,
-			const Vec<std::string>& lines);
+			const std::vector<std::string>& lines);
 
 		/// @todo
 		void parseIncludePragma(scanner::Scanner& scanner,
 			const std::string& filename, uint depth,
-			const Vec<std::string>& lines);
+			const std::vector<std::string>& lines);
 
 		/// @todo
 		void parseTrffbVarying(scanner::Scanner& scanner,
 			const std::string& filename, uint depth,
-			const Vec<std::string>& lines);
+			const std::vector<std::string>& lines);
 
 		/// Searches inside the Output::attributes or Output::trffbVaryings
 		/// vectors
@@ -133,7 +148,8 @@ class ShaderProgramPrePreprocessor
 		/// @param what The name of the varying or attrib
 		/// @return Iterator to the vector
 		template<typename Type>
-		typename Vec<Type>::const_iterator findNamed(const Vec<Type>& vec,
+		typename std::vector<Type>::const_iterator findNamed(
+			const std::vector<Type>& vec,
 			const std::string& what) const;
 
 		void printSourceLines() const;  ///< For debugging
@@ -163,10 +179,11 @@ inline ShaderProgramPrePreprocessor::TrffbVaryingPragma::TrffbVaryingPragma(
 
 
 template<typename Type>
-typename Vec<Type>::const_iterator ShaderProgramPrePreprocessor::findNamed(
-	const Vec<Type>& vec, const std::string& what) const
+typename std::vector<Type>::const_iterator
+	ShaderProgramPrePreprocessor::findNamed(
+	const std::vector<Type>& vec, const std::string& what) const
 {
-	typename Vec<Type>::const_iterator it = vec.begin();
+	typename std::vector<Type>::const_iterator it = vec.begin();
 	while(it != vec.end() && it->name != what)
 	{
 		++it;

+ 13 - 13
src/rsrc/ShaderProgramUniformVariable.cpp

@@ -9,11 +9,11 @@
 //==============================================================================
 void ShaderProgramUniformVariable::doSanityChecks() const
 {
-	ASSERT(getLoc() != -1);
+	ASSERT(getLocation() != -1);
 	ASSERT(GlStateMachineSingleton::get().getCurrentProgramGlId() ==
 		getFatherSProg().getGlId());
 	ASSERT(glGetUniformLocation(getFatherSProg().getGlId(),
-		getName().c_str()) == getLoc());
+		getName().c_str()) == getLocation());
 }
 
 
@@ -26,7 +26,7 @@ void ShaderProgramUniformVariable::set(const float f) const
 	doSanityChecks();
 	ASSERT(getGlDataType() == GL_FLOAT);
 
-	glUniform1f(getLoc(), f);
+	glUniform1f(getLocation(), f);
 }
 
 void ShaderProgramUniformVariable::set(const float f[], uint size) const
@@ -36,11 +36,11 @@ void ShaderProgramUniformVariable::set(const float f[], uint size) const
 
 	if(size == 1)
 	{
-		glUniform1f(getLoc(), f[0]);
+		glUniform1f(getLocation(), f[0]);
 	}
 	else
 	{
-		glUniform1fv(getLoc(), size, f);
+		glUniform1fv(getLocation(), size, f);
 	}
 }
 
@@ -51,11 +51,11 @@ void ShaderProgramUniformVariable::set(const Vec2 v2[], uint size) const
 	ASSERT(getGlDataType() == GL_FLOAT_VEC2);
 	if(size == 1)
 	{
-		glUniform2f(getLoc(), v2[0].x(), v2[0].y());
+		glUniform2f(getLocation(), v2[0].x(), v2[0].y());
 	}
 	else
 	{
-		glUniform2fv(getLoc(), size, &(const_cast<Vec2&>(v2[0]))[0]);
+		glUniform2fv(getLocation(), size, &(const_cast<Vec2&>(v2[0]))[0]);
 	}
 }
 
@@ -67,11 +67,11 @@ void ShaderProgramUniformVariable::set(const Vec3 v3[], uint size) const
 
 	if(size == 1)
 	{
-		glUniform3f(getLoc(), v3[0].x(), v3[0].y(), v3[0].z());
+		glUniform3f(getLocation(), v3[0].x(), v3[0].y(), v3[0].z());
 	}
 	else
 	{
-		glUniform3fv(getLoc(), size, &(const_cast<Vec3&>(v3[0]))[0]);
+		glUniform3fv(getLocation(), size, &(const_cast<Vec3&>(v3[0]))[0]);
 	}
 }
 
@@ -80,7 +80,7 @@ void ShaderProgramUniformVariable::set(const Vec4 v4[], uint size) const
 {
 	doSanityChecks();
 	ASSERT(getGlDataType() == GL_FLOAT_VEC4);
-	glUniform4fv(getLoc(), size, &(const_cast<Vec4&>(v4[0]))[0]);
+	glUniform4fv(getLocation(), size, &(const_cast<Vec4&>(v4[0]))[0]);
 }
 
 
@@ -88,7 +88,7 @@ void ShaderProgramUniformVariable::set(const Mat3 m3[], uint size) const
 {
 	doSanityChecks();
 	ASSERT(getGlDataType() == GL_FLOAT_MAT3);
-	glUniformMatrix3fv(getLoc(), size, true, &(m3[0])[0]);
+	glUniformMatrix3fv(getLocation(), size, true, &(m3[0])[0]);
 }
 
 
@@ -96,7 +96,7 @@ void ShaderProgramUniformVariable::set(const Mat4 m4[], uint size) const
 {
 	doSanityChecks();
 	ASSERT(getGlDataType() == GL_FLOAT_MAT4);
-	glUniformMatrix4fv(getLoc(), size, true, &(m4[0])[0]);
+	glUniformMatrix4fv(getLocation(), size, true, &(m4[0])[0]);
 }
 
 
@@ -106,5 +106,5 @@ void ShaderProgramUniformVariable::set(const Texture& tex, uint texUnit) const
 	ASSERT(getGlDataType() == GL_SAMPLER_2D ||
 		getGlDataType() == GL_SAMPLER_2D_SHADOW);
 	tex.bind(texUnit);
-	glUniform1i(getLoc(), texUnit);
+	glUniform1i(getLocation(), texUnit);
 }

+ 23 - 7
src/rsrc/ShaderProgramVariable.h

@@ -1,7 +1,6 @@
 #ifndef SHADER_PROGRAM_VARIABLE_H
 #define SHADER_PROGRAM_VARIABLE_H
 
-#include "util/Accessors.h"
 #include <GL/glew.h>
 #include <string>
 #include <boost/noncopyable.hpp>
@@ -27,13 +26,30 @@ class ShaderProgramVariable: public boost::noncopyable
 
 		/// @name Accessors
 		/// @{
+		const ShaderProgram& getFatherSProg() const
+		{
+			return fatherSProg;
+		}
+
+		GLint getLocation() const
+		{
+			return loc;
+		}
+
+		const std::string& getName() const
+		{
+			return name;
+		}
+
+		GLenum getGlDataType() const
+		{
+			return glDataType;
+		}
 
-		/// XXX: refactor
-		const ShaderProgram& getFatherSProg() const {return fatherSProg;}
-		GETTER_R(GLint, loc, getLoc)
-		GETTER_R(std::string, name, getName)
-		GETTER_R(GLenum, glDataType, getGlDataType)
-		GETTER_R(Type, type, getType)
+		Type getType() const
+		{
+			return type;
+		}
 		/// @}
 
 	private:

+ 31 - 11
src/rsrc/SkelAnim.h

@@ -2,8 +2,7 @@
 #define SKEL_ANIM_H
 
 #include "m/Math.h"
-#include "util/Vec.h"
-#include "util/Accessors.h"
+#include <vector>
 
 
 /// Bone pose
@@ -17,8 +16,15 @@ struct BonePose
 
 		/// @name Accessors
 		/// @{
-		GETTER_R(Quat, rotation, getRotation)
-		GETTER_R(Vec3, translation, getTranslation)
+		const Quat& getRotation() const
+		{
+			return rotation;
+		}
+
+		const Vec3& getTranslation() const
+		{
+			return translation;
+		}
 		/// @}
 
 	private:
@@ -47,13 +53,16 @@ class BoneAnim
 	public:
 		/// @name Accessors
 		/// @{
-		GETTER_R(Vec<BonePose>, bonePoses, getBonePoses)
+		const std::vector<BonePose>& getBonePoses() const
+		{
+			return bonePoses;
+		}
 		/// @}
 
 	private:
 		/// The poses for every keyframe. Its empty if the bone doesnt have
 		/// any animation
-		Vec<BonePose> bonePoses;
+		std::vector<BonePose> bonePoses;
 };
 
 
@@ -80,18 +89,29 @@ class SkelAnim
 	public:
 		/// @name Accessors
 		/// @{
-		GETTER_R(Vec<uint>, keyframes, getKeyframes)
-		GETTER_R_BY_VAL(uint, framesNum, getFramesNum)
-		GETTER_R(Vec<BoneAnim>, boneAnims, getBoneAnims)
+		const std::vector<uint>& getKeyframes() const
+		{
+			return keyframes;
+		}
+
+		uint getFramesNum() const
+		{
+			return framesNum;
+		}
+
+		const std::vector<BoneAnim>& getBoneAnimations() const
+		{
+			return boneAnims;
+		}
 		/// @}
 
 		/// Load
 		void load(const char* filename);
 
 	private:
-		Vec<uint> keyframes;
+		std::vector<uint> keyframes;
 		uint framesNum;
-		Vec<BoneAnim> boneAnims;
+		std::vector<BoneAnim> boneAnims;
 };
 
 

+ 60 - 16
src/rsrc/Skeleton.h

@@ -2,8 +2,7 @@
 #define SKELETON_H
 
 #include "m/Math.h"
-#include "util/Accessors.h"
-#include "util/Vec.h"
+#include <vector>
 
 
 /// Skeleton bone
@@ -22,18 +21,60 @@ struct Bone
 	public:
 		/// @name Accessors
 		/// @{
-		GETTER_R(std::string, name, getName)
-		GETTER_R(Vec3, head, getHead)
-		GETTER_R(Vec3, tail, getTail)
-		GETTER_R(uint, id, getPos)
-		GETTER_R_BY_VAL(Bone*, parent, getParent)
-		const Bone& getChild(uint i) const {return *childs[i];}
-		GETTER_R_BY_VAL(ushort, childsNum, getChildsNum)
-
-		GETTER_R(Mat3, rotSkelSpace, getRotSkelSpace)
-		GETTER_R(Vec3, tslSkelSpace, getTslSkelSpace)
-		GETTER_R(Mat3, rotSkelSpaceInv, getRotSkelSpaceInv)
-		GETTER_R(Vec3, tslSkelSpaceInv, getTslSkelSpaceInv)
+		const std::string& getName() const
+		{
+			return name;
+		}
+
+		const Vec3& getHead() const
+		{
+			return head;
+		}
+
+		const Vec3& getTail() const
+		{
+			return tail;
+		}
+
+		uint getId() const
+		{
+			return id;
+		}
+
+		const Bone* getParent() const
+		{
+			return parent;
+		}
+
+		const Bone& getChild(uint i) const
+		{
+			return *childs[i];
+		}
+
+		size_t getChildsNum() const
+		{
+			return childsNum;
+		}
+
+		const Mat3& getRotationSkeletonSpace() const
+		{
+			return rotSkelSpace;
+		}
+
+		const Vec3& getTranslationSkeletonSpace() const
+		{
+			return tslSkelSpace;
+		}
+
+		const Mat3& getRotationSkeletonSpaceInverted() const
+		{
+			return rotSkelSpaceInv;
+		}
+
+		const Vec3& getTranslationSkeletonSpaceInverted() const
+		{
+			return tslSkelSpaceInv;
+		}
 		/// @}
 
 	private:
@@ -83,11 +124,14 @@ class Skeleton
 
 		/// @name Accessors
 		/// @{
-		GETTER_R(Vec<Bone>, bones, getBones)
+		const std::vector<Bone>& getBones() const
+		{
+			return bones;
+		}
 		/// @}
 
 	private:
-		Vec<Bone> bones;
+		std::vector<Bone> bones;
 };
 
 

+ 2 - 1
src/rsrc/Skin.cpp

@@ -69,7 +69,8 @@ void Skin::load(const char* filename)
 		BOOST_FOREACH(const RsrcPtr<SkelAnim>& skelAnim, skelAnims)
 		{
 			// Bone number problem
-			if(skelAnim->getBoneAnims().size() != skeleton->getBones().size())
+			if(skelAnim->getBoneAnimations().size() !=
+				skeleton->getBones().size())
 			{
 				throw EXCEPTION("Skeleton animation \"" +
 					skelAnim.getRsrcName() + "\" and skeleton \"" +

+ 4 - 3
src/rsrc/Skin.h

@@ -35,7 +35,7 @@ class Skin
 		const Model& getModel() const;
 		const boost::ptr_vector<ModelPatch>& getModelPatches() const;
 		const Skeleton& getSkeleton() const;
-		const Vec<RsrcPtr<SkelAnim> >& getSkelAnims() const;
+		const std::vector<RsrcPtr<SkelAnim> >& getSkelAnims() const;
 		/// @}
 
 	private:
@@ -43,7 +43,8 @@ class Skin
 		/// @{
 		RsrcPtr<Model> model;
 		RsrcPtr<Skeleton> skeleton; ///< The skeleton
-		Vec<RsrcPtr<SkelAnim> > skelAnims; ///< The standard skeleton animations
+		/// The standard skeleton animations
+		std::vector<RsrcPtr<SkelAnim> > skelAnims;
 		/// @}
 };
 
@@ -66,7 +67,7 @@ inline const Skeleton& Skin::getSkeleton() const
 }
 
 
-inline const Vec<RsrcPtr<SkelAnim> >& Skin::getSkelAnims() const
+inline const std::vector<RsrcPtr<SkelAnim> >& Skin::getSkelAnims() const
 {
 	return skelAnims;
 }

+ 0 - 1
src/rsrc/Texture.h

@@ -3,7 +3,6 @@
 
 #include "util/StdTypes.h"
 #include "util/Assert.h"
-#include "util/Accessors.h"
 #include <limits>
 
 

+ 3 - 3
src/scene/Camera.h

@@ -1,12 +1,12 @@
 #ifndef CAMERA_H
 #define CAMERA_H
 
-#include <boost/array.hpp>
-#include <deque>
-#include "util/Vec.h"
 #include "cln/Collision.h"
 #include "SceneNode.h"
 #include "VisibilityInfo.h"
+#include <boost/array.hpp>
+#include <deque>
+#include <vector>
 
 
 class SpotLight;

+ 1 - 1
src/scene/MaterialRuntime.cpp

@@ -12,7 +12,7 @@ MaterialRuntime::MaterialRuntime(const Material& mtl_)
 {
 	// Copy props
 	MaterialProperties& me = *this;
-	const MaterialProperties& he = mtl.accessPropertiesBaseClass();
+	const MaterialProperties& he = mtl.getBaseClass();
 	me = he;
 
 	// Create vars

+ 25 - 7
src/scene/ModelNode.h

@@ -1,12 +1,13 @@
 #ifndef MODEL_NODE_H
 #define MODEL_NODE_H
 
-#include <boost/array.hpp>
 #include "SceneNode.h"
 #include "rsrc/RsrcPtr.h"
 #include "ModelPatchNode.h"
-#include "util/Vec.h"
 #include "cln/Obb.h"
+#include <boost/array.hpp>
+#include <vector>
+#include <boost/range/iterator_range.hpp>
 
 
 class Model;
@@ -16,18 +17,35 @@ class Model;
 class ModelNode: public SceneNode
 {
 	public:
+		typedef boost::iterator_range<std::vector<ModelPatchNode*>::
+			const_iterator> ConstRangeModelPatchNodes;
+
+		typedef boost::iterator_range<std::vector<ModelPatchNode*>::
+			iterator> MutableRangeModelPatchNodes;
+
 		ModelNode(Scene& scene, ulong flags, SceneNode* parent);
 		virtual ~ModelNode();
 
 		/// @name Accessors
 		/// @{
-		const Vec<ModelPatchNode*>& getModelPatchNodes() const {return patches;}
-		Vec<ModelPatchNode*>& getModelPatchNodes() {return patches;}
+		ConstRangeModelPatchNodes getModelPatchNodes() const
+		{
+			return ConstRangeModelPatchNodes(patches.begin(), patches.end());
+		}
+		MutableRangeModelPatchNodes getModelPatchNodes()
+		{
+			return MutableRangeModelPatchNodes(patches.begin(), patches.end());
+		}
 
-		const Model& getModel() const {return *model;}
+		const Model& getModel() const
+		{
+			return *model;
+		}
 
 		const Obb& getVisibilityShapeWSpace() const
-			{return visibilityShapeWSpace;}
+		{
+			return visibilityShapeWSpace;
+		}
 		/// @}
 
 		/// Initialize the node
@@ -39,7 +57,7 @@ class ModelNode: public SceneNode
 
 	private:
 		RsrcPtr<Model> model;
-		Vec<ModelPatchNode*> patches;
+		std::vector<ModelPatchNode*> patches;
 		Obb visibilityShapeWSpace;
 };
 

+ 1 - 1
src/scene/ParticleEmitterNode.h

@@ -27,7 +27,7 @@ class ParticleEmitterNode: public SceneNode, public ParticleEmitterRsrc
 
 	private:
 		boost::scoped_ptr<btCollisionShape> collShape;
-		Vec<Particle*> particles;
+		std::vector<Particle*> particles;
 		float timeLeftForNextEmission;
 		RsrcPtr<ParticleEmitterRsrc> particleEmitterProps; ///< The resource
 		static btTransform startingTrf;

+ 1 - 1
src/scene/Scene.cpp

@@ -107,7 +107,7 @@ void Scene::registerController(Controller* controller)
 
 void Scene::unregisterController(Controller* controller)
 {
-	Vec<Controller*>::iterator it = std::find(controllers.begin(),
+	std::vector<Controller*>::iterator it = std::find(controllers.begin(),
 		controllers.end(), controller);
 	ASSERT(it != controllers.end());
 	controllers.erase(it);

+ 1 - 1
src/scene/Scene.h

@@ -26,7 +26,7 @@ class Scene
 		class Types
 		{
 			public:
-				typedef Vec<T*> Container;
+				typedef std::vector<T*> Container;
 				typedef typename Container::iterator Iterator;
 				typedef typename Container::const_iterator ConstIterator;
 				typedef boost::iterator_range<Iterator> MutableRange;

+ 2 - 2
src/scene/SceneNode.cpp

@@ -113,8 +113,8 @@ void SceneNode::addChild(SceneNode& child)
 //==============================================================================
 void SceneNode::removeChild(SceneNode& child)
 {
-	Vec<SceneNode*>::iterator it = std::find(children.begin(), children.end(),
-		&child);
+	std::vector<SceneNode*>::iterator it = std::find(children.begin(),
+		children.end(), &child);
 
 	if(it == children.end())
 	{

+ 3 - 3
src/scene/SceneNode.h

@@ -3,7 +3,7 @@
 
 #include "m/Math.h"
 #include "cln/Obb.h"
-#include "util/Vec.h"
+#include <vector>
 #include <memory>
 #include <string>
 
@@ -80,7 +80,7 @@ class SceneNode
 
 		ulong getFlags() const {return flags;}
 
-		const Vec<SceneNode*>& getChildren() const {return children;}
+		const std::vector<SceneNode*>& getChildren() const {return children;}
 		/// @}
 
 		/// @name Flag manipulation
@@ -147,7 +147,7 @@ class SceneNode
 		ulong flags; ///< The state flags
 
 		SceneNode* parent; ///< Could not be nullptr
-		Vec<SceneNode*> children;
+		std::vector<SceneNode*> children;
 
 		Scene& scene;
 };

+ 15 - 12
src/scene/SkinNode.cpp

@@ -85,14 +85,14 @@ void SkinNode::frameUpdate(float /*prevUpdateTime*/, float /*crntTime*/)
 // interpolate                                                                 =
 //==============================================================================
 void SkinNode::interpolate(const SkelAnim& animation, float frame,
-	Vec<Vec3>& boneTranslations, Vec<Mat3>& boneRotations)
+	std::vector<Vec3>& boneTranslations, std::vector<Mat3>& boneRotations)
 {
 	ASSERT(frame < animation.getFramesNum());
 
 	// calculate the t (used in slerp and lerp) using the keyframs and the
 	// frame and calc the lPose and rPose witch indicate the pose IDs in witch
 	// the frame lies between
-	const Vec<uint>& keyframes = animation.getKeyframes();
+	const std::vector<uint>& keyframes = animation.getKeyframes();
 	float t = 0.0;
 	uint lPose = 0, rPose = 0;
 	for(uint j = 0; j < keyframes.size(); j++)
@@ -117,7 +117,7 @@ void SkinNode::interpolate(const SkelAnim& animation, float frame,
 	ASSERT(boneRotations.size() >= 1);
 	for(uint i=0; i < boneRotations.size(); i++)
 	{
-		const BoneAnim& banim = animation.getBoneAnims()[i];
+		const BoneAnim& banim = animation.getBoneAnimations()[i];
 
 		Mat3& localRot = boneRotations[i];
 		Vec3& localTransl = boneTranslations[i];
@@ -153,7 +153,7 @@ void SkinNode::interpolate(const SkelAnim& animation, float frame,
 // updateBoneTransforms                                                        =
 //==============================================================================
 void SkinNode::updateBoneTransforms(const Skeleton& skeleton,
-	Vec<Vec3>& boneTranslations, Vec<Mat3>& boneRotations)
+	std::vector<Vec3>& boneTranslations, std::vector<Mat3>& boneRotations)
 {
 	boost::array<uint, 128> queue;
 	uint head = 0, tail = 0;
@@ -163,7 +163,7 @@ void SkinNode::updateBoneTransforms(const Skeleton& skeleton,
 	{
 		if(bone.getParent() == NULL)
 		{
-			queue[tail++] = bone.getPos(); // queue push
+			queue[tail++] = bone.getId(); // queue push
 		}
 	}
 
@@ -178,11 +178,13 @@ void SkinNode::updateBoneTransforms(const Skeleton& skeleton,
 		// transformation.
 		Math::combineTransformations(
 			boneTranslations[boneId], boneRotations[boneId],
-			boned.getTslSkelSpaceInv(), boned.getRotSkelSpaceInv(),
+			boned.getTranslationSkeletonSpaceInverted(),
+			boned.getRotationSkeletonSpaceInverted(),
 			boneTranslations[boneId], boneRotations[boneId]);
 
 		Math::combineTransformations(
-			boned.getTslSkelSpace(), boned.getRotSkelSpace(),
+			boned.getTranslationSkeletonSpace(),
+			boned.getRotationSkeletonSpace(),
 			boneTranslations[boneId], boneRotations[boneId],
 			boneTranslations[boneId], boneRotations[boneId]);
 
@@ -191,8 +193,8 @@ void SkinNode::updateBoneTransforms(const Skeleton& skeleton,
 		{
 			// bone.final_final_transform = parent.transf * bone.final_transform
 			Math::combineTransformations(
-				boneTranslations[boned.getParent()->getPos()],
-				boneRotations[boned.getParent()->getPos()],
+				boneTranslations[boned.getParent()->getId()],
+				boneRotations[boned.getParent()->getId()],
 				boneTranslations[boneId],
 				boneRotations[boneId],
 				boneTranslations[boneId],
@@ -202,7 +204,7 @@ void SkinNode::updateBoneTransforms(const Skeleton& skeleton,
 		// now add the bone's children
 		for(uint i = 0; i < boned.getChildsNum(); i++)
 		{
-			queue[tail++] = boned.getChild(i).getPos();
+			queue[tail++] = boned.getChild(i).getId();
 		}
 	}
 }
@@ -212,8 +214,9 @@ void SkinNode::updateBoneTransforms(const Skeleton& skeleton,
 // deformHeadsTails                                                            =
 //==============================================================================
 void SkinNode::deformHeadsTails(const Skeleton& skeleton,
-    const Vec<Vec3>& boneTranslations, const Vec<Mat3>& boneRotations,
-    Vec<Vec3>& heads, Vec<Vec3>& tails)
+    const std::vector<Vec3>& boneTranslations,
+    const std::vector<Mat3>& boneRotations,
+    std::vector<Vec3>& heads, std::vector<Vec3>& tails)
 {
 	for(uint i = 0; i < skeleton.getBones().size(); i++)
 	{

+ 12 - 12
src/scene/SkinNode.h

@@ -3,10 +3,9 @@
 
 #include "SceneNode.h"
 #include "SkinPatchNode.h"
-#include "util/Vec.h"
 #include "m/Math.h"
-#include "util/Accessors.h"
 #include <boost/range/iterator_range.hpp>
+#include <vector>
 
 
 class Skin;
@@ -21,7 +20,7 @@ class SkinNode: public SceneNode
 		class Types
 		{
 			public:
-				typedef Vec<T> Container;
+				typedef std::vector<T> Container;
 				typedef typename Container::iterator Iterator;
 				typedef typename Container::const_iterator ConstIterator;
 				typedef boost::iterator_range<Iterator> MutableRange;
@@ -141,7 +140,7 @@ class SkinNode: public SceneNode
 
 	private:
 		RsrcPtr<Skin> skin; ///< The resource
-		Vec<SkinPatchNode*> patches;
+		std::vector<SkinPatchNode*> patches;
 		Obb visibilityShapeWSpace;
 
 		/// @name Animation stuff
@@ -153,10 +152,10 @@ class SkinNode: public SceneNode
 
 		/// @name Bone data
 		/// @{
-		Vec<Vec3> heads;
-		Vec<Vec3> tails;
-		Vec<Mat3> boneRotations;
-		Vec<Vec3> boneTranslations;
+		std::vector<Vec3> heads;
+		std::vector<Vec3> tails;
+		std::vector<Mat3> boneRotations;
+		std::vector<Vec3> boneTranslations;
 		/// @}
 
 		/// Interpolate
@@ -165,16 +164,17 @@ class SkinNode: public SceneNode
 		/// @param[out] translations Translations vector
 		/// @param[out] rotations Rotations vector
 		static void interpolate(const SkelAnim& animation, float frame,
-			Vec<Vec3>& translations, Vec<Mat3>& rotations);
+			std::vector<Vec3>& translations, std::vector<Mat3>& rotations);
 
 		/// Calculate the global pose
 		static void updateBoneTransforms(const Skeleton& skel,
-			Vec<Vec3>& translations, Vec<Mat3>& rotations);
+			std::vector<Vec3>& translations, std::vector<Mat3>& rotations);
 
 		/// Deform the heads and tails
 		static void deformHeadsTails(const Skeleton& skeleton,
-		    const Vec<Vec3>& boneTranslations, const Vec<Mat3>& boneRotations,
-		    Vec<Vec3>& heads, Vec<Vec3>& tails);
+		    const std::vector<Vec3>& boneTranslations,
+		    const std::vector<Mat3>& boneRotations,
+		    std::vector<Vec3>& heads, std::vector<Vec3>& tails);
 };
 
 

+ 35 - 11
src/scene/VisibilityInfo.h

@@ -2,7 +2,7 @@
 #define VISIBILITY_INFO_H
 
 #include <deque>
-#include "util/Vec.h"
+#include <vector>
 
 
 class RenderableNode;
@@ -16,25 +16,49 @@ class VisibilityInfo
 {
 	public:
 		typedef std::deque<const RenderableNode*> RContainer;
-		typedef Vec<const PointLight*> PLContainer;
-		typedef Vec<SpotLight*> SLContainer;
+		typedef std::vector<const PointLight*> PLContainer;
+		typedef std::vector<SpotLight*> SLContainer;
 
 		VisibilityInfo() {}
 		~VisibilityInfo();
 
 		/// @name Accessors
 		/// @{
-		const RContainer& getVisibleMsRenderableNodes() const {return msRNodes;}
-		RContainer& getVisibleMsRenderableNodes() {return msRNodes;}
+		const RContainer& getVisibleMsRenderableNodes() const
+		{
+			return msRNodes;
+		}
+		RContainer& getVisibleMsRenderableNodes()
+		{
+			return msRNodes;
+		}
 
-		const RContainer& getVisibleBsRenderableNodes() const {return bsRNodes;}
-		RContainer& getVisibleBsRenderableNodes() {return bsRNodes;}
+		const RContainer& getVisibleBsRenderableNodes() const
+		{
+			return bsRNodes;
+		}
+		RContainer& getVisibleBsRenderableNodes()
+		{
+			return bsRNodes;
+		}
 
-		const PLContainer& getVisiblePointLights() const {return pLights;}
-		PLContainer& getVisiblePointLights() {return pLights;}
+		const PLContainer& getVisiblePointLights() const
+		{
+			return pLights;
+		}
+		PLContainer& getVisiblePointLights()
+		{
+			return pLights;
+		}
 
-		const SLContainer& getVisibleSpotLights() const {return sLights;}
-		SLContainer& getVisibleSpotLights() {return sLights;}
+		const SLContainer& getVisibleSpotLights() const
+		{
+			return sLights;
+		}
+		SLContainer& getVisibleSpotLights()
+		{
+			return sLights;
+		}
 		/// @}
 
 	private:

+ 0 - 1
src/scene/VisibilityTester.h

@@ -1,7 +1,6 @@
 #ifndef VISIBILITY_TESTER_H
 #define VISIBILITY_TESTER_H
 
-#include "util/Accessors.h"
 #include "m/Math.h"
 #include "core/parallel/Job.h"
 #include <deque>

+ 1 - 4
src/script/scene/ModelNode.cpp

@@ -4,11 +4,8 @@
 
 WRAP(ModelNode)
 {
-	WRAP_CONTAINER(Vec<ModelPatchNode*>)
+	WRAP_CONTAINER(std::vector<ModelPatchNode*>)
 
 	class_<ModelNode, bases<SceneNode>, noncopyable>("ModelNode", no_init)
-		.def("getModelPatchNodes", (Vec<ModelPatchNode*>& (ModelNode::*)())(
-			&ModelNode::getModelPatchNodes),
-			return_value_policy<reference_existing_object>())
 	;
 }

+ 2 - 1
src/ui/UiFtFontLoader.cpp

@@ -109,7 +109,8 @@ void UiFtFontLoader::computeImageSize()
 //==============================================================================
 // createImage                                                                 =
 //==============================================================================
-void UiFtFontLoader::createImage(const char* filename, const FT_Vector& fontSize)
+void UiFtFontLoader::createImage(const char* filename,
+	const FT_Vector& fontSize)
 {
 	FT_Error error;
 

+ 6 - 5
src/ui/UiFtFontLoader.h

@@ -1,9 +1,9 @@
 #ifndef UI_FT_FONT_LOADER_H
 #define UI_FT_FONT_LOADER_H
 
-#include "util/Vec.h"
 #include "util/StdTypes.h"
 #include "m/Math.h"
+#include <vector>
 #include <boost/range/iterator_range.hpp>
 #include <ft2build.h>
 #include FT_FREETYPE_H
@@ -53,9 +53,10 @@ class UiFtFontLoader
 			return imgSize;
 		}
 
-		boost::iterator_range<Vec<Glyph>::const_iterator> getGlyphs() const
+		boost::iterator_range<std::vector<Glyph>::const_iterator>
+			getGlyphs() const
 		{
-			return boost::iterator_range<Vec<Glyph>::const_iterator>(
+			return boost::iterator_range<std::vector<Glyph>::const_iterator>(
 				glyphs.begin(), glyphs.end());
 		}
 
@@ -78,8 +79,8 @@ class UiFtFontLoader
 		/// @{
 		FT_Library library;
 		FT_Face face;
-		Vec<Glyph> glyphs;
-		Vec<uchar> img;
+		std::vector<Glyph> glyphs;
+		std::vector<uchar> img;
 		FT_Vector imgSize;
 		uint lineHeight; ///< Calculated as the max height among all glyphs
 		/// @}

+ 0 - 1
src/ui/UiPainterDevice.h

@@ -3,7 +3,6 @@
 
 #include "gl/Fbo.h"
 #include "m/Math.h"
-#include "util/Accessors.h"
 
 
 class Texture;

+ 0 - 49
src/util/Accessors.h

@@ -1,49 +0,0 @@
-#ifndef ACCESSORS_H
-#define ACCESSORS_H
-
-
-/// Read only getter, cause we are to bored to write
-#define GETTER_R(type__, var__, getter__) \
-	const type__& getter__() const {return var__;}
-
-
-/// Read only getter, cause we are to bored to write
-#define GETTER_R_BY_VAL(type__, var__, getter__) \
-	type__ getter__() const {return var__;}
-
-
-/// Read-write getter, cause we are to bored to write
-#define GETTER_RW(type__, var__, getter__) \
-	type__& getter__() {return var__;} \
-	GETTER_R(type__, var__, getter__)
-
-
-/// Read-write getter, cause we are to bored to write
-#define GETTER_RW_BY_VAL(type__, var__, getter__) \
-	type__& getter__() {return var__;} \
-	GETTER_R_BY_VAL(type__, var__, getter__)
-
-
-/// Setter, cause we are to bored to write
-#define SETTER(type__, var__, setter__) \
-	void setter__(const type__& x__) {var__ = x__;}
-
-
-/// Setter, cause we are to bored to write
-#define SETTER_BY_VAL(type__, var__, setter__) \
-	void setter__(const type__ x__) {var__ = x__;}
-
-
-/// The macro implies read write var
-#define GETTER_SETTER(type__, var__, getter__, setter__) \
-	GETTER_RW(type__, var__, getter__) \
-	SETTER(type__, var__, setter__)
-
-
-/// The macro implies read write var
-#define GETTER_SETTER_BY_VAL(type__, var__, getter__, setter__) \
-	GETTER_RW_BY_VAL(type__, var__, getter__) \
-	SETTER_BY_VAL(type__, var__, setter__)
-
-
-#endif

+ 2 - 2
src/util/Util.cpp

@@ -54,9 +54,9 @@ std::string readFile(const char* filename)
 //==============================================================================
 // getFileLines                                                                =
 //==============================================================================
-Vec<std::string> getFileLines(const char* filename)
+std::vector<std::string> getFileLines(const char* filename)
 {
-	Vec<std::string> lines;
+	std::vector<std::string> lines;
 	std::ifstream ifs(filename);
 	if(!ifs.is_open())
 	{

+ 11 - 4
src/util/Util.h

@@ -1,9 +1,9 @@
 #ifndef UTIL_H
 #define UTIL_H
 
-#include <string>
-#include "util/Vec.h"
 #include "util/StdTypes.h"
+#include <string>
+#include <vector>
 
 
 /// The namespace contains a few useful functions
@@ -27,10 +27,17 @@ extern float randFloat(float max);
 extern std::string readFile(const char* filename);
 
 /// Open a text file and return its lines into a string vector
-extern Vec<std::string> getFileLines(const char* filename);
-
+extern std::vector<std::string> getFileLines(const char* filename);
 
+/// Get the size in bytes of a vector
+template<typename Vec>
+size_t getVectorSizeInBytes(const Vec& v)
+{
+	return v.size() * sizeof(typename Vec::value_type);
 }
 
 
+} // end namespace
+
+
 #endif

+ 0 - 70
src/util/Vec.h

@@ -1,70 +0,0 @@
-#ifndef VEC_H
-#define VEC_H
-
-#include <vector>
-#include "util/Assert.h"
-
-
-/// This is a wrapper of std::vector that adds new functionality and assertions 
-/// in operator[]
-template<typename Type, typename Allocator = std::allocator<Type> >
-class Vec: public std::vector<Type, Allocator>
-{
-	public:
-		typedef std::vector<Type, Allocator> Base;
-
-		/// @name Constructors/destructors
-		/// @{
-		Vec(const Allocator& al = Allocator()): Base(al) {}
-		Vec(size_t size, const Type& value = Type(), 
-			const Allocator& al = Allocator()): Base(size, value, al) {}
-
-		template <typename InputIterator>
-		Vec(InputIterator first, InputIterator last, 
-			const Allocator& al = Allocator()): Base(first, last, al) {}
-
-		Vec(const Vec<Type, Allocator>& b): Base(b) {}
-		/// @}
-
-		/// @name Accessors
-		/// @{
-		Type& operator[](size_t n);
-		const Type& operator[](size_t n) const;
-		size_t getSizeInBytes() const;
-		/// @}
-};
-
-
-//==============================================================================
-// operator[]                                                                  =
-//==============================================================================
-template<typename Type, typename Allocator>
-Type& Vec<Type, Allocator>::operator[](size_t n)
-{
-	ASSERT(n < Base::size());
-	return Base::operator [](n);
-}
-
-
-//==============================================================================
-// operator[]                                                                  =
-//==============================================================================
-template<typename Type, typename Allocator>
-const Type& Vec<Type, Allocator>::operator[](size_t n) const
-{
-	ASSERT(n < Base::size());
-	return Base::operator [](n);
-}
-
-
-//==============================================================================
-// getSizeInBytes                                                              =
-//==============================================================================
-template<typename Type, typename Allocator>
-size_t Vec<Type, Allocator>::getSizeInBytes() const
-{
-	return Base::size() * sizeof(Type);
-}
-
-
-#endif