From c43c5e409fbba3f22bf9cc60a196dc862a605199 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 25 Jul 2014 09:29:50 -0700 Subject: [PATCH 1/2] quenched some warnings (windows) --- include/mitsuba/core/half.h | 4 ++-- include/mitsuba/core/rfilter.h | 4 ++-- src/libcore/bitmap.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/mitsuba/core/half.h b/include/mitsuba/core/half.h index a022d6a6..56f15897 100644 --- a/include/mitsuba/core/half.h +++ b/include/mitsuba/core/half.h @@ -221,8 +221,8 @@ class MTS_EXPORT_CORE half unsigned short _h; - static MTS_EXPORT_CORE uif _toFloat[1 << 16]; - static MTS_EXPORT_CORE unsigned short _eLut[1 << 9]; + static uif _toFloat[1 << 16]; + static unsigned short _eLut[1 << 9]; }; //----------- diff --git a/include/mitsuba/core/rfilter.h b/include/mitsuba/core/rfilter.h index 81e3617d..1c3dab41 100644 --- a/include/mitsuba/core/rfilter.h +++ b/include/mitsuba/core/rfilter.h @@ -179,9 +179,9 @@ template struct Resampler { m_weights = new Scalar[m_taps]; Float sum = 0; for (int i=0; ieval((Float) (i-m_halfTaps)); + Scalar weight = (Scalar) rfilter->eval((Float) (i-m_halfTaps)); m_weights[i] = weight; - sum += weight; + sum += (Float) weight; } Float normalization = 1.0f / sum; for (int i=0; i Bitmap::split() const { ChannelMap channels; for (size_t i=0; i Bitmap::split() const { channels.erase(prefix + "y"); } else { extractFormat = ELuminance; - extractChannels.push_back(i); + extractChannels.push_back((int) i); channels.erase(name); } @@ -1989,7 +1989,7 @@ ref Bitmap::extractChannels(EPixelFormat fmt, const std::vector &ch Log(EError, "Bitmap::extractChannel(%i): channel index " "must be between 0 and %i", channels[i], channelCount-1); - ref result = new Bitmap(fmt, m_componentFormat, m_size, channels.size()); + ref result = new Bitmap(fmt, m_componentFormat, m_size, (int) channels.size()); result->setMetadata(m_metadata); result->setGamma(m_gamma); @@ -2851,7 +2851,7 @@ void Bitmap::readOpenEXR(Stream *stream, const std::string &_prefix) { if (multichannel) { for (Imf::ChannelList::ConstIterator it = channels.begin(); it != channels.end(); ++it) sourceChannels.push_back(it.name()); - m_channelCount = sourceChannels.size(); + m_channelCount = (int) sourceChannels.size(); m_pixelFormat = EMultiChannel; formatString = "Multichannel"; } else if (spectral) { From d00b238f932cca5e61ab95cf7f68ccda299da6e5 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Mon, 28 Jul 2014 02:20:10 -0700 Subject: [PATCH 2/2] windows compilation fix --- src/libpython/render.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libpython/render.cpp b/src/libpython/render.cpp index e3ae9c6a..7d498aba 100644 --- a/src/libpython/render.cpp +++ b/src/libpython/render.cpp @@ -53,6 +53,10 @@ static AABB shapekdtree_getAABB(const ShapeKDTree *kdtree) { return kdtree->getAABB(); } +static bool shapekdtree_isBuilt(const ShapeKDTree *kdtree) { + return kdtree->isBuilt(); +} + static bp::object shapekdtree_rayIntersect(const ShapeKDTree *kdtree, const Ray &ray) { Intersection its; @@ -330,7 +334,7 @@ void export_render() { .def("getPrimitiveCount", &ShapeKDTree::getPrimitiveCount) .def("addShape", &ShapeKDTree::addShape) .def("build", &ShapeKDTree::build) - .def("isBuilt", &ShapeKDTree::isBuilt) + .def("isBuilt", &shapekdtree_isBuilt) .def("getAABB", &shapekdtree_getAABB, BP_RETURN_VALUE) .def("getShapes", &shapekdtree_getShapes) .def("rayIntersect", &shapekdtree_rayIntersect);