Changes to hopefully fix Linux compile problems.

This commit is contained in:
Daviw Williams 2013-06-13 15:55:15 +02:00
parent 62f273bd74
commit 6e8030f4b5
2 changed files with 21 additions and 33 deletions

View File

@ -57,7 +57,7 @@ namespace PolyVox
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>
@ -350,13 +350,13 @@ namespace PolyVox
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");

View File

@ -71,6 +71,22 @@ public:
/// Gets a voxel at the position given by <tt>x,y,z</tt> coordinates
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)
{
@ -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
VoxelType getVoxel(const Vector3DInt32& v3dPos, WrapMode eWrapMode = WrapModes::None, VoxelType tBorder = VoxelType()) const
{