Changes to hopefully fix Linux compile problems.
This commit is contained in:
		| @@ -57,7 +57,7 @@ namespace PolyVox | |||||||
| 	template <typename DerivedVolumeType> | 	template <typename DerivedVolumeType> | ||||||
| 	VoxelType BaseVolume<VoxelType>::Sampler<DerivedVolumeType>::getVoxel(void) const | 	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> | 	template <typename VoxelType> | ||||||
| @@ -350,13 +350,13 @@ namespace PolyVox | |||||||
| 		switch(m_eWrapMode) | 		switch(m_eWrapMode) | ||||||
| 		{ | 		{ | ||||||
| 		case WrapModes::None: | 		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: | 		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: | 		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: | 		case WrapModes::DontCheck: | ||||||
| 			return mVolume->getVoxel<WrapModes::DontCheck>(uXPos, uYPos, uZPos, m_tBorder); | 			return mVolume->getVoxel(uXPos, uYPos, uZPos, WrapModes::DontCheck, m_tBorder); | ||||||
| 		default: | 		default: | ||||||
| 			// Should never happen | 			// Should never happen | ||||||
| 			POLYVOX_ASSERT(false, "Invalid wrap mode"); | 			POLYVOX_ASSERT(false, "Invalid wrap mode"); | ||||||
|   | |||||||
| @@ -71,6 +71,22 @@ public: | |||||||
| 	/// Gets a voxel at the position given by <tt>x,y,z</tt> coordinates | 	/// Gets a voxel at the position given by <tt>x,y,z</tt> coordinates | ||||||
| 	template <WrapMode eWrapMode> | 	template <WrapMode eWrapMode> | ||||||
| 	VoxelType getVoxel(int32_t uXPos, int32_t uYPos, int32_t uZPos, VoxelType tBorder = VoxelType()) const | 	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) | 		switch(eWrapMode) | ||||||
| 		{ | 		{ | ||||||
| @@ -118,34 +134,6 @@ public: | |||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	/// 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 | 	/// Gets a voxel at the position given by a 3D vector | ||||||
| 	VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::None, VoxelType tBorder = VoxelType()) const | 	VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::None, VoxelType tBorder = VoxelType()) const | ||||||
| 	{ | 	{ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user