diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h index 884d46dd..2fb4fd0e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.h @@ -145,11 +145,8 @@ namespace PolyVox class LargeVolume : public Volume { public: -#if defined(_MSC_VER) //DIRTY HACK!!! - class Sampler : public Volume::Sampler< LargeVolume > -#else - class Sampler : public Volume::template Sampler< LargeVolume > -#endif + typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. See http://goo.gl/qu1wn + class Sampler : public VolumeOfVoxelType::template Sampler< LargeVolume > { public: Sampler(LargeVolume* volume); diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h index b2bee28c..d7d2b1bf 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolume.h @@ -38,11 +38,8 @@ namespace PolyVox { public: #ifndef SWIG -#if defined(_MSC_VER) //DIRTY HACK!!! - class Sampler : public Volume::Sampler< RawVolume > -#else - class Sampler : public Volume::template Sampler< RawVolume > -#endif + typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. See http://goo.gl/qu1wn + class Sampler : public VolumeOfVoxelType::template Sampler< RawVolume > { public: Sampler(RawVolume* volume); diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h index b9284e11..b75cd367 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.h @@ -60,11 +60,8 @@ namespace PolyVox uint8_t m_uSideLengthPower; }; -#if defined(_MSC_VER) //DIRTY HACK!!! - class Sampler : public Volume::Sampler< SimpleVolume > -#else - class Sampler : public Volume::template Sampler< SimpleVolume > -#endif + typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. See http://goo.gl/qu1wn + class Sampler : public VolumeOfVoxelType::template Sampler< SimpleVolume > { public: Sampler(SimpleVolume* volume); diff --git a/tests/TestVolumeSubclass.cpp b/tests/TestVolumeSubclass.cpp index dc6af74d..4ed1e4aa 100644 --- a/tests/TestVolumeSubclass.cpp +++ b/tests/TestVolumeSubclass.cpp @@ -37,21 +37,17 @@ template class VolumeSubclass : public Volume { public: - -#if defined(_MSC_VER) //DIRTY HACK!!! - class Sampler : public Volume::Sampler< VolumeSubclass > -#else - class Sampler : public Volume::template Sampler< VolumeSubclass > -#endif + typedef Volume VolumeOfVoxelType; //Workaround for GCC/VS2010 differences. See http://goo.gl/qu1wn + class Sampler : public VolumeOfVoxelType::template Sampler< VolumeSubclass > + { + public: + Sampler(VolumeSubclass* volume) + :Volume::template Sampler< VolumeSubclass >(volume) { - public: - Sampler(VolumeSubclass* volume) - :Volume::template Sampler< VolumeSubclass >(volume) - { - this->mVolume = volume; - } - //~Sampler(); - }; + this->mVolume = volume; + } + //~Sampler(); + }; /// Constructor for creating a fixed size volume. VolumeSubclass(const Region& regValid)