Browse Source

Removing exceptions

Panagiotis Christopoulos Charitos 11 years ago
parent
commit
fabb678b31

+ 1 - 1
include/anki/resource/Material.h

@@ -108,7 +108,7 @@ template<typename TData>
 class MaterialVariableTemplate: public MaterialVariable
 class MaterialVariableTemplate: public MaterialVariable
 {
 {
 public:
 public:
-	typedef TData Type;
+	using Type = TData;
 
 
 	/// @name Constructors/Destructor
 	/// @name Constructors/Destructor
 	/// @{
 	/// @{

+ 10 - 7
include/anki/scene/FrustumComponent.h

@@ -114,22 +114,25 @@ public:
 
 
 	/// Called when the component gets updated. It should be overriden, by 
 	/// Called when the component gets updated. It should be overriden, by 
 	/// default it does nothing.
 	/// default it does nothing.
-	virtual void onFrustumComponentUpdate(
+	virtual ANKI_USE_RESULT Error onFrustumComponentUpdate(
 		SceneNode& node, F32 prevTime, F32 crntTime)
 		SceneNode& node, F32 prevTime, F32 crntTime)
-	{}
+	{
+		return ErrorCode::NONE;
+	}
 
 
 	/// @name SceneComponent overrides
 	/// @name SceneComponent overrides
 	/// @{
 	/// @{
-	Bool update(SceneNode&, F32, F32) override
+	ANKI_USE_RESULT Error update(SceneNode&, F32, F32, Bool& updated) override
 	{
 	{
-		Bool out = m_markedForUpdate;
+		updated = m_markedForUpdate;
 		m_markedForUpdate = false;
 		m_markedForUpdate = false;
-		return out;
+		return ErrorCode::NONE;
 	}
 	}
 
 
-	void onUpdate(SceneNode& node, F32 prevTime, F32 crntTime) final
+	ANKI_USE_RESULT Error onUpdate(
+		SceneNode& node, F32 prevTime, F32 crntTime) final
 	{
 	{
-		onFrustumComponentUpdate(node, prevTime, crntTime);
+		return onFrustumComponentUpdate(node, prevTime, crntTime);
 	}
 	}
 
 
 	void reset() override
 	void reset() override

+ 8 - 5
include/anki/scene/MoveComponent.h

@@ -101,9 +101,11 @@ public:
 	}
 	}
 
 
 	/// Called when there is an update in the world transformation.
 	/// Called when there is an update in the world transformation.
-	virtual void onMoveComponentUpdate(
+	virtual ANKI_USE_RESULT Error onMoveComponentUpdate(
 		SceneNode& node, F32 prevTime, F32 crntTime)
 		SceneNode& node, F32 prevTime, F32 crntTime)
-	{}
+	{
+		return ErrorCode::NONE;
+	}
 
 
 	/// @name SceneComponent overrides
 	/// @name SceneComponent overrides
 	/// @{
 	/// @{
@@ -113,11 +115,12 @@ public:
 	/// @note Don't update if child because we start from roots and go to
 	/// @note Don't update if child because we start from roots and go to
 	///       children and we don't want a child to be updated before the
 	///       children and we don't want a child to be updated before the
 	///       parent
 	///       parent
-	Bool update(SceneNode&, F32, F32) override;
+	ANKI_USE_RESULT Error update(SceneNode&, F32, F32, Bool& updated) override;
 
 
-	void onUpdate(SceneNode& node, F32 prevTime, F32 crntTime) final
+	ANKI_USE_RESULT Error onUpdate(
+		SceneNode& node, F32 prevTime, F32 crntTime) final
 	{
 	{
-		onMoveComponentUpdate(node, prevTime, crntTime);
+		return onMoveComponentUpdate(node, prevTime, crntTime);
 	}
 	}
 	/// @}
 	/// @}
 
 

+ 16 - 10
include/anki/scene/RenderComponent.h

@@ -121,7 +121,7 @@ public:
 	}
 	}
 
 
 	/// A custom cleanup method
 	/// A custom cleanup method
-	virtual void cleanup(SceneAllocator<U8> alloc) = 0;
+	virtual void destroy(SceneAllocator<U8> alloc) = 0;
 
 
 protected:
 protected:
 	const MaterialVariable* m_mvar = nullptr;
 	const MaterialVariable* m_mvar = nullptr;
@@ -195,7 +195,7 @@ public:
 	}
 	}
 
 
 	/// Call that manually
 	/// Call that manually
-	void cleanup(SceneAllocator<U8> alloc)
+	void destroy(SceneAllocator<U8> alloc)
 	{
 	{
 		if(m_copy)
 		if(m_copy)
 		{
 		{
@@ -223,18 +223,19 @@ public:
 class RenderComponent: public SceneComponent
 class RenderComponent: public SceneComponent
 {
 {
 public:
 public:
-	typedef SceneVector<RenderComponentVariable*> Variables;
+	typedef SceneDArray<RenderComponentVariable*> Variables;
 
 
 	/// @param node Pass node to steal it's allocator
 	/// @param node Pass node to steal it's allocator
 	RenderComponent(SceneNode* node);
 	RenderComponent(SceneNode* node);
 
 
 	~RenderComponent();
 	~RenderComponent();
 
 
-	Variables::iterator getVariablesBegin()
+	Variables::Iterator getVariablesBegin()
 	{
 	{
 		return m_vars.begin();
 		return m_vars.begin();
 	}
 	}
-	Variables::iterator getVariablesEnd()
+
+	Variables::Iterator getVariablesEnd()
 	{
 	{
 		return m_vars.end();
 		return m_vars.end();
 	}
 	}
@@ -242,7 +243,7 @@ public:
 	/// Build up the rendering.
 	/// Build up the rendering.
 	/// Given an array of submeshes that are visible append jobs to the GL
 	/// Given an array of submeshes that are visible append jobs to the GL
 	/// job chain
 	/// job chain
-	virtual void buildRendering(RenderingBuildData& data) = 0;
+	virtual ANKI_USE_RESULT Error buildRendering(RenderingBuildData& data) = 0;
 
 
 	/// Access the material
 	/// Access the material
 	virtual const Material& getMaterial() = 0;
 	virtual const Material& getMaterial() = 0;
@@ -271,12 +272,16 @@ public:
 
 
 	/// Iterate variables using a lambda
 	/// Iterate variables using a lambda
 	template<typename Func>
 	template<typename Func>
-	void iterateVariables(Func func)
+	ANKI_USE_RESULT Error iterateVariables(Func func)
 	{
 	{
-		for(auto var : m_vars)
+		Error err = ErrorCode::NONE;
+		Variables::Iterator it = m_vars.getBegin();
+		for(; it != m_vars.getEnd() && !err; it++)
 		{
 		{
-			func(*var);
+			err = func(*(*it));
 		}
 		}
+
+		return err;
 	}
 	}
 
 
 	static constexpr Type getClassType()
 	static constexpr Type getClassType()
@@ -285,9 +290,10 @@ public:
 	}
 	}
 
 
 protected:
 protected:
-	void init();
+	ANKI_USE_RESULT Error create();
 
 
 private:
 private:
+	SceneAllocator<U8> m_alloc;
 	Variables m_vars;
 	Variables m_vars;
 };
 };
 /// @}
 /// @}

+ 1 - 7
include/anki/scene/SceneObject.h

@@ -36,7 +36,7 @@ struct SceneObjectCallbackCollection
 
 
 /// The base of all scene related objects
 /// The base of all scene related objects
 class SceneObject: 
 class SceneObject: 
-	private Object<SceneObject, SceneAllocator<SceneObject>, 
+	public Object<SceneObject, SceneAllocator<SceneObject>, 
 	SceneObjectCallbackCollection>
 	SceneObjectCallbackCollection>
 {
 {
 public:
 public:
@@ -57,12 +57,6 @@ public:
 
 
 	virtual ~SceneObject();
 	virtual ~SceneObject();
 
 
-	// Methods that SceneObject can use from it's base.
-	using Base::getParent;
-	using Base::visitChildren;
-	using Base::visitThisAndChildren;
-	using Base::visitChildrenMaxDepth;
-
 	Type getType() const
 	Type getType() const
 	{
 	{
 		return m_bits & Type::_TYPE_MASK;
 		return m_bits & Type::_TYPE_MASK;

+ 8 - 5
include/anki/scene/SpatialComponent.h

@@ -87,17 +87,20 @@ public:
 
 
 	/// Called when the component gets updated. It should be overriden, by 
 	/// Called when the component gets updated. It should be overriden, by 
 	/// default it does nothing.
 	/// default it does nothing.
-	virtual void onSpatialComponentUpdate(
+	virtual ANKI_USE_RESULT Error onSpatialComponentUpdate(
 		SceneNode& node, F32 prevTime, F32 crntTime)
 		SceneNode& node, F32 prevTime, F32 crntTime)
-	{}
+	{
+		return ErrorCode::NONE;
+	}
 
 
 	/// @name SceneComponent overrides
 	/// @name SceneComponent overrides
 	/// @{
 	/// @{
-	Bool update(SceneNode&, F32, F32) override;
+	ANKI_USE_RESULT Error update(SceneNode&, F32, F32, Bool& updated) override;
 
 
-	void onUpdate(SceneNode& node, F32 prevTime, F32 crntTime) final
+	ANKI_USE_RESULT Error onUpdate(
+		SceneNode& node, F32 prevTime, F32 crntTime) final
 	{
 	{
-		onSpatialComponentUpdate(node, prevTime, crntTime);
+		return onSpatialComponentUpdate(node, prevTime, crntTime);
 	}
 	}
 
 
 	/// Disable some flags
 	/// Disable some flags

+ 36 - 12
include/anki/util/DArray.h

@@ -68,51 +68,75 @@ public:
 	}
 	}
 
 
 	/// Make it compatible with the C++11 range based for loop.
 	/// Make it compatible with the C++11 range based for loop.
-	Iterator begin()
+	Iterator getBegin()
 	{
 	{
 		return &m_data[0];
 		return &m_data[0];
 	}
 	}
 
 
 	/// Make it compatible with the C++11 range based for loop.
 	/// Make it compatible with the C++11 range based for loop.
-	ConstIterator begin() const
+	ConstIterator getBegin() const
 	{
 	{
 		return &m_data[0];
 		return &m_data[0];
 	}
 	}
 
 
 	/// Make it compatible with the C++11 range based for loop.
 	/// Make it compatible with the C++11 range based for loop.
-	Iterator end()
+	Iterator getEnd()
 	{
 	{
 		return &m_data[0] + m_size;
 		return &m_data[0] + m_size;
 	}
 	}
 
 
 	/// Make it compatible with the C++11 range based for loop.
 	/// Make it compatible with the C++11 range based for loop.
-	ConstIterator end() const
+	ConstIterator getEnd() const
 	{
 	{
 		return &m_data[0] + m_size;
 		return &m_data[0] + m_size;
 	}
 	}
 
 
-	/// Make it compatible with STL.
-	Reference front() 
+	/// Make it compatible with the C++11 range based for loop.
+	Iterator begin()
+	{
+		return getBegin();
+	}
+
+	/// Make it compatible with the C++11 range based for loop.
+	ConstIterator begin() const
+	{
+		return getBegin();
+	}
+
+	/// Make it compatible with the C++11 range based for loop.
+	Iterator end()
+	{
+		return getEnd();
+	}
+
+	/// Make it compatible with the C++11 range based for loop.
+	ConstIterator end() const
+	{
+		return getEnd();
+	}
+
+	/// Get first element.
+	Reference getFront() 
 	{
 	{
 		return m_data[0];
 		return m_data[0];
 	}
 	}
 
 
-	/// Make it compatible with STL.
-	ConstReference front() const
+	/// Get first element.
+	ConstReference getFront() const
 	{
 	{
 		return m_data[0];
 		return m_data[0];
 	}
 	}
 
 
-	/// Make it compatible with STL.
-	Reference back() 
+	/// Get last element.
+	Reference getBack() 
 	{
 	{
 		return m_data[m_size - 1];
 		return m_data[m_size - 1];
 	}
 	}
 
 
-	/// Make it compatible with STL.
+	/// Get last element.
 	ConstReference back() const
 	ConstReference back() const
 	{
 	{
-		return m_data[m_size - 1];
+		return getBack[m_size - 1];
 	}
 	}
 
 
 	PtrSize getSize() const
 	PtrSize getSize() const

+ 28 - 14
include/anki/util/Visitor.h

@@ -254,18 +254,18 @@ public:
 
 
 	/// Apply mutable visitor
 	/// Apply mutable visitor
 	template<typename TVisitor>
 	template<typename TVisitor>
-	void acceptVisitor(TVisitor& v)
+	ANKI_USE_RESULT Error acceptVisitor(TVisitor& v)
 	{
 	{
 		ANKI_ASSERT(m_what != -1);
 		ANKI_ASSERT(m_what != -1);
-		acceptVisitorInternal<TVisitor, Types...>(v);
+		return acceptVisitorInternal<TVisitor, Types...>(v);
 	}
 	}
 
 
 	/// Apply const visitor
 	/// Apply const visitor
 	template<typename TVisitor>
 	template<typename TVisitor>
-	void acceptVisitor(TVisitor& v) const
+	ANKI_USE_RESULT Error acceptVisitor(TVisitor& v) const
 	{
 	{
 		ANKI_ASSERT(m_what != -1);
 		ANKI_ASSERT(m_what != -1);
-		acceptVisitorInternalConst<TVisitor, Types...>(v);
+		return acceptVisitorInternalConst<TVisitor, Types...>(v);
 	}
 	}
 
 
 	/// Setup the type ID
 	/// Setup the type ID
@@ -282,8 +282,10 @@ private:
 	/// @name Accept visitor template methods
 	/// @name Accept visitor template methods
 	/// @{
 	/// @{
 	template<typename TVisitor, typename TFirst>
 	template<typename TVisitor, typename TFirst>
-	void acceptVisitorInternal(TVisitor& v)
+	ANKI_USE_RESULT Error acceptVisitorInternal(TVisitor& v)
 	{
 	{
+		Error err = ErrorCode::NONE;
+
 		switch(m_what)
 		switch(m_what)
 		{
 		{
 		case 0:
 		case 0:
@@ -294,19 +296,22 @@ private:
 #else
 #else
 				TFirst* base = static_cast<TFirst*>(this);
 				TFirst* base = static_cast<TFirst*>(this);
 #endif
 #endif
-				v.template visit(*base);
+				err = v.template visit(*base);
 			}
 			}
 			break;
 			break;
 		default:
 		default:
 			ANKI_ASSERT(0 && "Wrong type ID");
 			ANKI_ASSERT(0 && "Wrong type ID");
 			break;
 			break;
 		}
 		}
+
+		return err;
 	}
 	}
 
 
 	template<typename TVisitor, typename TFirst, typename TSecond, 
 	template<typename TVisitor, typename TFirst, typename TSecond, 
 		typename... Types_>
 		typename... Types_>
-	void acceptVisitorInternal(TVisitor& v)
+	ANKI_USE_RESULT Error acceptVisitorInternal(TVisitor& v)
 	{
 	{
+		Error err = ErrorCode::NONE;
 		constexpr I i = sizeof...(Types) - sizeof...(Types_) - 1;
 		constexpr I i = sizeof...(Types) - sizeof...(Types_) - 1;
 
 
 		switch(m_what)
 		switch(m_what)
@@ -319,18 +324,22 @@ private:
 #else
 #else
 				TSecond* base = static_cast<TSecond*>(this);
 				TSecond* base = static_cast<TSecond*>(this);
 #endif
 #endif
-				v.template visit(*base);
+				err = v.template visit(*base);
 			}
 			}
 			break;
 			break;
 		default:
 		default:
-			acceptVisitorInternal<TVisitor, TFirst, Types_...>(v);
+			err = acceptVisitorInternal<TVisitor, TFirst, Types_...>(v);
 			break;
 			break;
 		}
 		}
+		
+		return err;
 	}
 	}
 
 
 	template<typename TVisitor, typename TFirst>
 	template<typename TVisitor, typename TFirst>
-	void acceptVisitorInternalConst(TVisitor& v) const
+	ANKI_USE_RESULT Error acceptVisitorInternalConst(TVisitor& v) const
 	{
 	{
+		Error err = ErrorCode::NONE;
+
 		switch(m_what)
 		switch(m_what)
 		{
 		{
 		case 0:
 		case 0:
@@ -341,19 +350,22 @@ private:
 #else
 #else
 				const TFirst* base = static_cast<const TFirst*>(this);
 				const TFirst* base = static_cast<const TFirst*>(this);
 #endif
 #endif
-				v.template visit(*base);
+				err = v.template visit(*base);
 			}
 			}
 			break;
 			break;
 		default:
 		default:
 			ANKI_ASSERT(0 && "Wrong type ID");
 			ANKI_ASSERT(0 && "Wrong type ID");
 			break;
 			break;
 		}
 		}
+		
+		return err;
 	}
 	}
 
 
 	template<typename TVisitor, typename TFirst, typename TSecond, 
 	template<typename TVisitor, typename TFirst, typename TSecond, 
 		typename... Types_>
 		typename... Types_>
-	void acceptVisitorInternalConst(TVisitor& v) const
+	ANKI_USE_RESULT Error acceptVisitorInternalConst(TVisitor& v) const
 	{
 	{
+		Error err = ErrorCode::NONE;
 		constexpr I i = sizeof...(Types) - sizeof...(Types_) - 1;
 		constexpr I i = sizeof...(Types) - sizeof...(Types_) - 1;
 
 
 		switch(m_what)
 		switch(m_what)
@@ -366,13 +378,15 @@ private:
 #else
 #else
 				const TSecond* base = static_cast<const TSecond*>(this);
 				const TSecond* base = static_cast<const TSecond*>(this);
 #endif
 #endif
-				v.template visit(*base);
+				err = v.template visit(*base);
 			}
 			}
 			break;
 			break;
 		default:
 		default:
-			acceptVisitorInternalConst<TVisitor, TFirst, Types_...>(v);
+			err = acceptVisitorInternalConst<TVisitor, TFirst, Types_...>(v);
 			break;
 			break;
 		}
 		}
+		
+		return err;
 	}
 	}
 	/// @}
 	/// @}
 };
 };

+ 7 - 5
src/scene/MoveComponent.cpp

@@ -22,10 +22,10 @@ MoveComponent::~MoveComponent()
 {}
 {}
 
 
 //==============================================================================
 //==============================================================================
-Bool MoveComponent::update(SceneNode& node, F32, F32)
+Error MoveComponent::update(SceneNode& node, F32, F32, Bool& updated)
 {
 {
-	Bool updated = updateWorldTransform(node);
-	return updated;
+	updated = updateWorldTransform(node);
+	return ErrorCode::NONE;
 }
 }
 
 
 //==============================================================================
 //==============================================================================
@@ -79,8 +79,8 @@ Bool MoveComponent::updateWorldTransform(SceneNode& node)
 	// whole tree because you will re-walk it later
 	// whole tree because you will re-walk it later
 	if(dirty)
 	if(dirty)
 	{
 	{
-		node.visitChildrenMaxDepth(1, [](SceneObject& obj) -> Error
-		{
+		Error err = node.visitChildrenMaxDepth(1, [](SceneObject& obj) -> Error
+		{ 
 			if(obj.getType() == SceneNode::getClassType())
 			if(obj.getType() == SceneNode::getClassType())
 			{
 			{
 				SceneNode& childNode = obj.downCast<SceneNode>();
 				SceneNode& childNode = obj.downCast<SceneNode>();
@@ -94,6 +94,8 @@ Bool MoveComponent::updateWorldTransform(SceneNode& node)
 
 
 			return ErrorCode::NONE;
 			return ErrorCode::NONE;
 		});
 		});
+
+		(void)err;
 	}
 	}
 
 
 	return dirty;
 	return dirty;

+ 30 - 16
src/scene/RenderComponent.cpp

@@ -18,19 +18,25 @@ namespace anki {
 struct CreateNewRenderComponentVariableVisitor
 struct CreateNewRenderComponentVariableVisitor
 {
 {
 	const MaterialVariable* m_mvar = nullptr;
 	const MaterialVariable* m_mvar = nullptr;
-	RenderComponent::Variables* m_vars = nullptr;
+	mutable RenderComponent::Variables* m_vars = nullptr;
+	mutable U32* m_count = nullptr;
+	mutable SceneAllocator<U8> m_alloc;
 
 
 	template<typename TMaterialVariableTemplate>
 	template<typename TMaterialVariableTemplate>
-	void visit(const TMaterialVariableTemplate&) const
+	Error visit(const TMaterialVariableTemplate&) const
 	{
 	{
-		typedef typename TMaterialVariableTemplate::Type Type;
-
-		SceneAllocator<U8> alloc = m_vars->get_allocator();
+		using Type = typename TMaterialVariableTemplate::Type;
 
 
 		RenderComponentVariableTemplate<Type>* rvar =
 		RenderComponentVariableTemplate<Type>* rvar =
-			alloc.newInstance<RenderComponentVariableTemplate<Type>>(m_mvar);
+			m_alloc.newInstance<RenderComponentVariableTemplate<Type>>(m_mvar);
+
+		if(rvar)
+		{
+			(*m_vars)[(*m_count)++] = rvar;
+			return ErrorCode::NONE;
+		}
 
 
-		m_vars->push_back(rvar);
+		return ErrorCode::OUT_OF_MEMORY;
 	}
 	}
 };
 };
 
 
@@ -90,37 +96,45 @@ RenderComponentVariable::~RenderComponentVariable()
 //==============================================================================
 //==============================================================================
 RenderComponent::RenderComponent(SceneNode* node)
 RenderComponent::RenderComponent(SceneNode* node)
 :	SceneComponent(Type::RENDER, node), 
 :	SceneComponent(Type::RENDER, node), 
-	m_vars(node->getSceneAllocator())
+	m_alloc(node->getSceneAllocator())
 {}
 {}
 
 
 //==============================================================================
 //==============================================================================
 RenderComponent::~RenderComponent()
 RenderComponent::~RenderComponent()
 {
 {
-	SceneAllocator<U8> alloc = m_vars.get_allocator();
-
 	for(RenderComponentVariable* var : m_vars)
 	for(RenderComponentVariable* var : m_vars)
 	{
 	{
-		var->cleanup(alloc);
-		alloc.deleteInstance(var);
+		var->destroy(m_alloc);
+		m_alloc.deleteInstance(var);
 	}
 	}
+
+	m_vars.destroy(m_alloc);
 }
 }
 
 
 //==============================================================================
 //==============================================================================
-void RenderComponent::init()
+Error RenderComponent::create()
 {
 {
 	const Material& mtl = getMaterial();
 	const Material& mtl = getMaterial();
 
 
 	// Create the material variables using a visitor
 	// Create the material variables using a visitor
 	CreateNewRenderComponentVariableVisitor vis;
 	CreateNewRenderComponentVariableVisitor vis;
+	U32 count = 0;
 	vis.m_vars = &m_vars;
 	vis.m_vars = &m_vars;
+	vis.m_count = &count;
+	vis.m_alloc = m_alloc;
 
 
-	m_vars.reserve(mtl.getVariables().getSize());
+	Error err = m_vars.create(m_alloc, mtl.getVariables().getSize());
 
 
-	for(const MaterialVariable* mv : mtl.getVariables())
+	auto it = mtl.getVariables().getBegin();
+	auto end = mtl.getVariables().getEnd();
+	for(; !err && it != end; it++)
 	{
 	{
+		const MaterialVariable* mv = (*it);
 		vis.m_mvar = mv;
 		vis.m_mvar = mv;
-		mv->acceptVisitor(vis);
+		err = mv->acceptVisitor(vis);
 	}
 	}
+
+	return err;
 }
 }
 
 
 }  // end namespace anki
 }  // end namespace anki

+ 5 - 3
src/scene/SceneObject.cpp

@@ -12,7 +12,7 @@ namespace anki {
 SceneObject::SceneObject(Type type, SceneGraph* scene)
 SceneObject::SceneObject(Type type, SceneGraph* scene)
 :	Base(),
 :	Base(),
 	m_scene(scene),
 	m_scene(scene),
-	m_bits(static_cast<U8>(type))
+	m_bits(type)
 {
 {
 	ANKI_ASSERT(m_scene);
 	ANKI_ASSERT(m_scene);
 }
 }
@@ -44,15 +44,17 @@ void SceneObject::markForDeletion()
 	// want to increase the counter again
 	// want to increase the counter again
 	if(!isMarkedForDeletion())
 	if(!isMarkedForDeletion())
 	{
 	{
-		m_bits |= enumToType(Flag::MARKED_FOR_DELETION);
+		m_bits |= Type::_MARKED_FOR_DELETION	;
 		m_scene->increaseObjectsMarkedForDeletion();
 		m_scene->increaseObjectsMarkedForDeletion();
 	}
 	}
 
 
-	visitChildren([](SceneObject& obj) -> Error
+	Error err = visitChildren([](SceneObject& obj) -> Error
 	{
 	{
 		obj.markForDeletion();
 		obj.markForDeletion();
 		return ErrorCode::NONE;
 		return ErrorCode::NONE;
 	});
 	});
+
+	(void)err;
 }
 }
 
 
 } // end namespace anki
 } // end namespace anki

+ 3 - 3
src/scene/SpatialComponent.cpp

@@ -21,9 +21,9 @@ SpatialComponent::~SpatialComponent()
 {}
 {}
 
 
 //==============================================================================
 //==============================================================================
-Bool SpatialComponent::update(SceneNode&, F32, F32)
+Error SpatialComponent::update(SceneNode&, F32, F32, Bool& updated)
 {
 {
-	Bool updated = false;
+	updated = false;
 
 
 	updated = bitsEnabled(Flag::MARKED_FOR_UPDATE);
 	updated = bitsEnabled(Flag::MARKED_FOR_UPDATE);
 	if(updated)
 	if(updated)
@@ -32,7 +32,7 @@ Bool SpatialComponent::update(SceneNode&, F32, F32)
 		disableBits(Flag::MARKED_FOR_UPDATE);
 		disableBits(Flag::MARKED_FOR_UPDATE);
 	}
 	}
 
 
-	return updated;
+	return ErrorCode::NONE;
 }
 }
 
 
 //==============================================================================
 //==============================================================================