From 0566645c9e05e9b7ebbe4ffb96f316fb53e23513 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Sat, 17 Nov 2012 13:04:12 +0000 Subject: [PATCH] Mostly revert bb87e9e6280b321708f631f286b57a67343c769e to fix crash Using const references seemed to be causing a crash so have changed back to just passing the function by value. --- .../include/PolyVoxCore/AmbientOcclusionCalculator.h | 4 ++-- .../include/PolyVoxCore/AmbientOcclusionCalculator.inl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h index b2d65475..696d21e1 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h +++ b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.h @@ -60,7 +60,7 @@ namespace PolyVox return func; } - const IsVoxelTransparentCallback& mIsVoxelTransparentCallback; + IsVoxelTransparentCallback mIsVoxelTransparentCallback; }; // NOTE: The callback needs to be a functor not a function. I haven't been @@ -74,7 +74,7 @@ namespace PolyVox /// Calculate the ambient occlusion for the volume template - void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, const IsVoxelTransparentCallback& isVoxelTransparentCallback); + void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, IsVoxelTransparentCallback isVoxelTransparentCallback); } #include "PolyVoxCore/AmbientOcclusionCalculator.inl" diff --git a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl index 8659cadf..80184824 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/AmbientOcclusionCalculator.inl @@ -32,7 +32,7 @@ namespace PolyVox * \param isVoxelTransparentCallback A callback which takes a \a VoxelType and returns a \a bool whether the voxel is transparent */ template - void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, const IsVoxelTransparentCallback& isVoxelTransparentCallback) + void calculateAmbientOcclusion(VolumeType* volInput, Array<3, uint8_t>* arrayResult, Region region, float fRayLength, uint8_t uNoOfSamplesPerOutputElement, IsVoxelTransparentCallback isVoxelTransparentCallback) { typename VolumeType::Sampler m_sampVolume(volInput);