Browse Source

Fix Android build

Panagiotis Christopoulos Charitos 10 months ago
parent
commit
b8296ee4fc

+ 0 - 2
AnKi/Physics2/PhysicsPlayerController.cpp

@@ -3,8 +3,6 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#pragma once
-
 #include <AnKi/Physics2/PhysicsPlayerController.h>
 #include <AnKi/Physics2/PhysicsWorld.h>
 #include <AnKi/Physics2/PhysicsCollisionShape.h>

+ 3 - 0
AnKi/Physics2/PhysicsWorld.cpp

@@ -7,6 +7,7 @@
 #include <AnKi/Util/System.h>
 
 #include <Jolt/Renderer/DebugRendererSimple.h>
+#include <Jolt/ConfigurationString.h>
 
 namespace anki {
 namespace v2 {
@@ -310,6 +311,8 @@ PhysicsWorld::~PhysicsWorld()
 
 Error PhysicsWorld::init(AllocAlignedCallback allocCb, void* allocCbData)
 {
+	ANKI_PHYS_LOGI("Initializing physics. Jolt config: %s", JPH::GetConfigurationString());
+
 	PhysicsMemoryPool::allocateSingleton(allocCb, allocCbData);
 
 	JPH::Allocate = [](PtrSize size) -> void* {

+ 0 - 10
AnKi/Physics2/PhysicsWorld.h

@@ -88,16 +88,6 @@ private:
 	class MyContactListener;
 	class MyDebugRenderer;
 
-	template<U32 kElementsPerBlock>
-	class BlockArrayConfig
-	{
-	public:
-		static constexpr U32 getElementCountPerBlock()
-		{
-			return kElementsPerBlock;
-		}
-	};
-
 	template<typename T, U32 kElementsPerBlock>
 	class ObjArray
 	{

+ 9 - 5
AnKi/Util/BlockArray.h

@@ -16,17 +16,21 @@ namespace anki {
 /// @{
 
 /// Config options for a BlockArray.
-/// @tparam T The type of the array.
-template<typename T>
-class BlockArrayDefaultConfig
+template<U32 kElementCountPerBlock>
+class BlockArrayConfig
 {
 public:
 	static constexpr U32 getElementCountPerBlock()
 	{
-		return 64;
+		return kElementCountPerBlock;
 	}
 };
 
+/// Config options for a BlockArray.
+class BlockArrayDefaultConfig : public BlockArrayConfig<64>
+{
+};
+
 /// BlockArray iterator.
 template<typename TValuePointer, typename TValueReference, typename TBlockArrayPtr>
 class BlockArrayIterator
@@ -130,7 +134,7 @@ private:
 };
 
 /// It's a type of dynamic array that unlike DynamicArray doesn't move elements around when it shrinks or grows the storage.
-template<typename T, typename TMemoryPool = SingletonMemoryPoolWrapper<DefaultMemoryPool>, typename TConfig = BlockArrayDefaultConfig<T>>
+template<typename T, typename TMemoryPool = SingletonMemoryPoolWrapper<DefaultMemoryPool>, typename TConfig = BlockArrayDefaultConfig>
 class BlockArray
 {
 	template<typename, typename, typename>

+ 1 - 2
AnKi/Util/Forward.h

@@ -39,7 +39,6 @@ class List;
 template<typename T, typename TMemoryPool, typename TConfig>
 class SparseArray;
 
-template<typename T>
 class BlockArrayDefaultConfig;
 
 template<typename T, typename TMemoryPool, typename TConfig>
@@ -93,7 +92,7 @@ class XmlDocument;
 	using submoduleName##XmlDocument = XmlDocument<submoduleName##MemPoolWrapper>; \
 	template<typename T> \
 	using submoduleName##Hierarchy = Hierarchy<T, submoduleName##MemPoolWrapper>; \
-	template<typename T, typename TConfig = BlockArrayDefaultConfig<T>> \
+	template<typename T, typename TConfig = BlockArrayDefaultConfig> \
 	using submoduleName##BlockArray = BlockArray<T, submoduleName##MemPoolWrapper, TConfig>;
 
 } // end namespace anki