Commits

David Williams committed 6e8030f

Changes to hopefully fix Linux compile problems.

Comments (0)

Files changed (2)

library/PolyVoxCore/include/PolyVoxCore/BaseVolumeSampler.inl

 	template <typename DerivedVolumeType>
 	VoxelType BaseVolume<VoxelType>::Sampler<DerivedVolumeType>::getVoxel(void) const
 	{
-		return mVolume->getVoxel<WrapModes::None>(mXPosInVolume, mYPosInVolume, mZPosInVolume);
+		return mVolume->getVoxel(mXPosInVolume, mYPosInVolume, mZPosInVolume, WrapModes::None); // FIXME - Use templatised version instead but watch for Linux compile errors.
 	}
 
 	template <typename VoxelType>
 		switch(m_eWrapMode)
 		{
 		case WrapModes::None:
-			return mVolume->getVoxel<WrapModes::None>(uXPos, uYPos, uZPos, m_tBorder);
+			return mVolume->getVoxel(uXPos, uYPos, uZPos, WrapModes::None, m_tBorder);
 		case WrapModes::Clamp:
-			return mVolume->getVoxel<WrapModes::Clamp>(uXPos, uYPos, uZPos, m_tBorder);
+			return mVolume->getVoxel(uXPos, uYPos, uZPos, WrapModes::Clamp, m_tBorder);
 		case WrapModes::Border:
-			return mVolume->getVoxel<WrapModes::Border>(uXPos, uYPos, uZPos, m_tBorder);
+			return mVolume->getVoxel(uXPos, uYPos, uZPos, WrapModes::Border, m_tBorder);
 		case WrapModes::DontCheck:
-			return mVolume->getVoxel<WrapModes::DontCheck>(uXPos, uYPos, uZPos, m_tBorder);
+			return mVolume->getVoxel(uXPos, uYPos, uZPos, WrapModes::DontCheck, m_tBorder);
 		default:
 			// Should never happen
 			POLYVOX_ASSERT(false, "Invalid wrap mode");

tests/TestVolumeSubclass.cpp

 	template <WrapMode eWrapMode>
 	VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder = VoxelType()) const
 	{
+		// FIXME: This templatised version is implemented in terms of the not template version. This is strange
+		// from a peformance point of view but it's just because we were encountering some compile issues on GCC.
+		return getVoxel(uXPos, uYPos, uZPos, eWrapMode, tBorder);
+	}
+
+	/// Gets a voxel at the position given by a 3D vector
+	template <WrapMode eWrapMode>
+	VoxelType getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder = VoxelType()) const
+	{
+		// Simply call through to the real implementation
+		return getVoxel<eWrapMode>(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tBorder);
+	}
+
+	/// Gets a voxel at the position given by <tt>x,y,z</tt> coordinates
+	VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode = WrapModes::None, VoxelType tBorder = VoxelType()) const
+	{
 		switch(eWrapMode)
 		{
 		case WrapModes::None:
 	}
 
 	/// Gets a voxel at the position given by a 3D vector
-	template <WrapMode eWrapMode>
-	VoxelType getVoxel(const Vector3DInt32& v3dPos, VoxelType tBorder = VoxelType()) const
-	{
-		// Simply call through to the real implementation
-		return getVoxel<eWrapMode>(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), tBorder);
-	}
-
-	/// Gets a voxel at the position given by <tt>x,y,z</tt> coordinates
-	VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, WrapMode eWrapMode = WrapModes::None, VoxelType tBorder = VoxelType()) const
-	{
-		switch(eWrapMode)
-		{
-		case WrapModes::None:
-			return getVoxel(uXPos, uYPos, uZPos, WrapModes::None, tBorder);
-		case WrapModes::Clamp:
-			return getVoxel(uXPos, uYPos, uZPos, WrapModes::Clamp, tBorder);
-		case WrapModes::Border:
-			return getVoxel(uXPos, uYPos, uZPos, WrapModes::Border, tBorder);
-		case WrapModes::DontCheck:
-			return getVoxel(uXPos, uYPos, uZPos, WrapModes::DontCheck, tBorder);
-		default:
-			// Should never happen
-			POLYVOX_ASSERT(false, "Invalid wrap mode");
-			return VoxelType();
-		}
-	}
-
-	/// Gets a voxel at the position given by a 3D vector
 	VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::None, VoxelType tBorder = VoxelType()) const
 	{
 		return getVoxel(v3dPos.getX(), v3dPos.getY(), v3dPos.getZ(), eWrapMode, tBorder);