From 768bacccdc7e8559edb89cb4c9bd0d6131abce69 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 14 Sep 2010 15:53:11 -0700 Subject: [PATCH] windows compilation bugfixes, removed many warnings --- config/config-msvc2005-win32.py | 3 +- config/config-msvc2005-win64.py | 3 +- include/mitsuba/core/pdf.h | 2 +- include/mitsuba/core/platform.h | 2 ++ include/mitsuba/core/point.h | 50 +++++++++++++++++------------- include/mitsuba/core/spectrum.h | 6 ++-- include/mitsuba/core/stl.h | 2 -- include/mitsuba/core/transform.h | 4 +-- include/mitsuba/core/util.h | 4 +-- include/mitsuba/core/vector.h | 36 +++++++++++++++------ include/mitsuba/render/fwd.h | 4 +-- include/mitsuba/render/kdtree.h | 2 ++ src/converter/collada.cpp | 9 ++---- src/converter/mtsimport.cpp | 2 +- src/libcore/bitmap.cpp | 2 +- src/libcore/fstream.cpp | 2 +- src/libcore/plugin.cpp | 2 +- src/libcore/shvector.cpp | 18 +++++------ src/libcore/util.cpp | 4 +-- src/libhw/device.cpp | 2 +- src/libhw/glrenderer.cpp | 2 +- src/libhw/vpl.cpp | 2 +- src/libhw/wgldevice.cpp | 4 +-- src/librender/kdtree.cpp | 1 - src/librender/kdtree_coherent.cpp | 1 - src/librender/kdtree_compiler.cpp | 1 - src/librender/kdtree_traversal.cpp | 1 - src/qtgui/preview.h | 2 +- src/qtgui/sceneloader.h | 2 +- src/volume/gridvolume.cpp | 8 ++--- 30 files changed, 102 insertions(+), 81 deletions(-) diff --git a/config/config-msvc2005-win32.py b/config/config-msvc2005-win32.py index 6782b395..c3db84ab 100644 --- a/config/config-msvc2005-win32.py +++ b/config/config-msvc2005-win32.py @@ -13,8 +13,9 @@ OEXRINCLUDE = ['#tools/windows/include/OpenEXR'] OEXRFLAGS = ['/D', 'OPENEXR_DLL'] OEXRLIB = ['IlmImf', 'IlmThread', 'Iex', 'zlib1', 'Half'] BOOSTINCLUDE = ['#tools/boost'] +BOOSTLIB = ['libboost_system', 'libboost_filesystem'] COLLADAINCLUDE = ['#tools/windows/include/colladadom', '#tools/windows/include/colladadom/1.4'] -COLLADALIB = ['libcollada14dom21', 'libboost_system', 'libboost_filesystem'] +COLLADALIB = ['libcollada14dom21'] XERCESLIB = ['xerces-c_3'] PNGLIB = ['libpng13'] JPEGLIB = ['jpeg62'] diff --git a/config/config-msvc2005-win64.py b/config/config-msvc2005-win64.py index ac802dc5..a42603a5 100644 --- a/config/config-msvc2005-win64.py +++ b/config/config-msvc2005-win64.py @@ -13,8 +13,9 @@ OEXRINCLUDE = ['#tools/windows/include/OpenEXR'] OEXRFLAGS = ['/D', 'OPENEXR_DLL'] OEXRLIB = ['IlmImf', 'IlmThread', 'Iex', 'zlib1', 'Half'] BOOSTINCLUDE = ['#tools/boost'] +BOOSTLIB = ['libboost_system', 'libboost_filesystem'] COLLADAINCLUDE = ['#tools/windows/include/colladadom', '#tools/windows/include/colladadom/1.4'] -COLLADALIB = ['libcollada14dom21', 'libboost_system', 'libboost_filesystem'] +COLLADALIB = ['libcollada14dom21'] XERCESLIB = ['xerces-c_3'] PNGLIB = ['libpng13'] JPEGLIB = ['jpeg62'] diff --git a/include/mitsuba/core/pdf.h b/include/mitsuba/core/pdf.h index 6a4bbe45..491e4e1d 100644 --- a/include/mitsuba/core/pdf.h +++ b/include/mitsuba/core/pdf.h @@ -27,7 +27,7 @@ MTS_NAMESPACE_BEGIN * This class can be used to transform uniformly distributed samples * so that they match the stored distribution. */ -class DiscretePDF { +struct DiscretePDF { public: /// Allocate a PDF with the given number of entries explicit inline DiscretePDF(int nEntries = 0) : m_ready(false) { diff --git a/include/mitsuba/core/platform.h b/include/mitsuba/core/platform.h index 0dbf0914..994449f6 100644 --- a/include/mitsuba/core/platform.h +++ b/include/mitsuba/core/platform.h @@ -90,6 +90,8 @@ #endif #define SIZE_T_FMT "%Iu" + #define BOOST_FILESYSTEM_NO_LIB + #define BOOST_SYSTEM_NO_LIB #else #define MTS_EXPORT #define MTS_EXPORT_CORE diff --git a/include/mitsuba/core/point.h b/include/mitsuba/core/point.h index ea41a75b..fcc18243 100644 --- a/include/mitsuba/core/point.h +++ b/include/mitsuba/core/point.h @@ -44,8 +44,13 @@ template struct TPoint2 { /// Initialize the point with the specified X, Y and Z components TPoint2(T x, T y) : x(x), y(y) { } - /// Initialize the point from a point data structure - TPoint2(const TVector2 &vec) : x(vec.x), y(vec.y) { } + /// Initialize the point with the components of another point + template explicit TPoint2(const TPoint2 &p) + : x((T) p.x), y((T) p.y) { } + + /// Initialize the point with the components of a vector data structure + template explicit TPoint2(const TVector2 &v) + : x((T) v.x), y((T) v.y) { } /// Initialize all components of the the point with the specified value explicit TPoint2(T val) : x(val), y(val) { } @@ -110,7 +115,7 @@ template struct TPoint2 { return TPoint2(-x, -y); } - /// Divide the point's coordinates by the given scalar + /// Divide the point's coordinates by the given scalar and return the result TPoint2 operator/(T f) const { #ifdef MTS_DEBUG if (f == 0) @@ -120,6 +125,7 @@ template struct TPoint2 { return TPoint2(x * recip, y * recip); } + /// Divide the point's coordinates by the given scalar TPoint2 &operator/=(T f) { #ifdef MTS_DEBUG if (f == 0) @@ -173,10 +179,6 @@ template inline TPoint2 operator*(T f, const TPoint2 &v) { return v*f; } -template inline TVector2::TVector2(const TPoint2 &p) - : x(p.x), y(p.y) { } - - template inline T distance(const TPoint2 &p1, const TPoint2 &p2) { return (p1-p2).length(); } @@ -224,8 +226,13 @@ template struct TPoint3 { /// Initialize the point with the specified X, Y and Z components TPoint3(T x, T y, T z) : x(x), y(y), z(z) { } - /// Initialize the point from a point data structure - TPoint3(const TVector3 &vec) : x(vec.x), y(vec.y), z(vec.z) { } + /// Initialize the point with the components of another point + template explicit TPoint3(const TPoint3 &p) + : x((T) p.x), y((T) p.y), z((T) p.z) { } + + /// Initialize the point with the components of a vector data structure + template explicit TPoint3(const TVector3 &v) + : x((T) v.x), y((T) v.y), z((T) v.z) { } /// Initialize all components of the the point with the specified value explicit TPoint3(T val) : x(val), y(val), z(val) { } @@ -291,7 +298,7 @@ template struct TPoint3 { return TPoint3(-x, -y, -z); } - /// Divide the point's coordinates by the given scalar + /// Divide the point's coordinates by the given scalar and return the result TPoint3 operator/(T f) const { #ifdef MTS_DEBUG if (f == 0) @@ -301,6 +308,7 @@ template struct TPoint3 { return TPoint3(x * recip, y * recip, z * recip); } + /// Divide the point's coordinates by the given scalar TPoint3 &operator/=(T f) { #ifdef MTS_DEBUG if (f == 0) @@ -355,10 +363,6 @@ template inline TPoint3 operator*(T f, const TPoint3 &v) { return v*f; } -template inline TVector3::TVector3(const TPoint3 &p) - : x(p.x), y(p.y), z(p.z) { } - - template inline T distance(const TPoint3 &p1, const TPoint3 &p2) { return (p1-p2).length(); } @@ -406,9 +410,14 @@ template struct TPoint4 { /// Initialize the point with the specified X, Y and Z components TPoint4(T x, T y, T z, T w) : x(x), y(y), z(z), w(w) { } - - /// Initialize the point from a point data structure - TPoint4(const TVector4 &vec) : x(vec.x), y(vec.y), z(vec.z), w(vec.w) { } + + /// Initialize the point with the components of another point + template explicit TPoint4(const TPoint4 &p) + : x((T) p.x), y((T) p.y), z((T) p.z), w((T) p.w) { } + + /// Initialize the point with the components of a vector data structure + template explicit TPoint4(const TVector4 &v) + : x((T) v.x), y((T) v.y), z((T) v.z), w((T) v.w) { } /// Initialize all components of the the point with the specified value explicit TPoint4(T val) : x(val), y(val), z(val), w(val) { } @@ -475,7 +484,7 @@ template struct TPoint4 { return TPoint4(-x, -y, -z, -w); } - /// Divide the point's coordinates by the given scalar + /// Divide the point's coordinates by the given scalar and return the result TPoint4 operator/(T f) const { #ifdef MTS_DEBUG if (f == 0) @@ -485,6 +494,7 @@ template struct TPoint4 { return TPoint4(x * recip, y * recip, z * recip, w * recip); } + /// Divide the point's coordinates by the given scalar TPoint4 &operator/=(T f) { #ifdef MTS_DEBUG if (f == 0) @@ -540,10 +550,6 @@ template inline TPoint4 operator*(T f, const TPoint4 &v) { return v*f; } -template inline TVector4::TVector4(const TPoint4 &p) - : x(p.x), y(p.y), z(p.z), w(p.w) { } - - template inline T distance(const TPoint4 &p1, const TPoint4 &p2) { return (p1-p2).length(); } diff --git a/include/mitsuba/core/spectrum.h b/include/mitsuba/core/spectrum.h index fa431505..19f628ff 100644 --- a/include/mitsuba/core/spectrum.h +++ b/include/mitsuba/core/spectrum.h @@ -101,7 +101,7 @@ private: * When SPECTRUM_SAMPLES is set to 3 (the default), this class * falls back to linear RGB as its internal representation. */ -class MTS_EXPORT_CORE Spectrum { +struct MTS_EXPORT_CORE Spectrum { public: /// Create a new spectral power distribution, but don't initialize the contents inline Spectrum() { } @@ -446,7 +446,9 @@ protected: static const int CIE_end = 830; static const int CIE_count = CIE_end - CIE_start + 1; static const Float CIE_normalization; - static const Float CIE_X[CIE_count], CIE_Y[CIE_count], CIE_Z[CIE_count]; + static const Float CIE_X[CIE_count]; + static const Float CIE_Y[CIE_count]; + static const Float CIE_Z[CIE_count]; /// @} }; diff --git a/include/mitsuba/core/stl.h b/include/mitsuba/core/stl.h index 1d689e9d..2278d982 100644 --- a/include/mitsuba/core/stl.h +++ b/include/mitsuba/core/stl.h @@ -62,8 +62,6 @@ namespace std { /// @endcond #if defined(_MSC_VER) - #define _USE_MATH_DEFINES - #include #include #define snprintf _snprintf diff --git a/include/mitsuba/core/transform.h b/include/mitsuba/core/transform.h index 9d90e03d..b1ae6d52 100644 --- a/include/mitsuba/core/transform.h +++ b/include/mitsuba/core/transform.h @@ -76,12 +76,10 @@ protected: virtual ~Matrix4x4() { } }; -struct Frame; - /** * \brief Encapsulates a 4x4 linear transformation and its inverse */ -class MTS_EXPORT_CORE Transform { +struct MTS_EXPORT_CORE Transform { public: /// Create an identity transformation Transform(); diff --git a/include/mitsuba/core/util.h b/include/mitsuba/core/util.h index f022b04f..c8eb9f79 100644 --- a/include/mitsuba/core/util.h +++ b/include/mitsuba/core/util.h @@ -164,12 +164,12 @@ extern MTS_EXPORT_CORE Point2 squareToTriangle(const Point2 &sample); /// Convert radians to degrees inline Float radToDeg(Float rad) { - return 180.0f*rad/M_PI; + return 180.0f * rad / M_PI; } /// Convert degrees to radians inline Float degToRad(Float deg) { - return deg*M_PI/180.0f; + return deg * M_PI / 180.0f; } /// Simple floating point clamping function diff --git a/include/mitsuba/core/vector.h b/include/mitsuba/core/vector.h index 24107c08..f061d258 100644 --- a/include/mitsuba/core/vector.h +++ b/include/mitsuba/core/vector.h @@ -48,8 +48,13 @@ public: /// Initialize all components of the the vector with the specified value explicit TVector2(T val) : x(val), y(val) { } - /// Initialize a vector with the components of a point data structure - explicit TVector2(const TPoint2 &point); + /// Initialize the vector with the components of a point data structure + template explicit TVector2(const TVector2 &v) + : x((T) v.x), y((T) v.y) { } + + /// Initialize the vector with the components of another vector data structure + template explicit TVector2(const TPoint2 &p) + : x((T) p.x), y((T) p.y) { } /// Unserialize a vector from a binary data stream TVector2(Stream *stream) { @@ -95,7 +100,7 @@ public: return TVector2(-x, -y); } - /// Divide the vector by the given scalar + /// Divide the vector by the given scalar and return the result TVector2 operator/(T f) const { #ifdef MTS_DEBUG if (f == 0) @@ -105,6 +110,7 @@ public: return TVector2(x * recip, y * recip); } + /// Divide the vector by the given scalar TVector2 &operator/=(T f) { #ifdef MTS_DEBUG if (f == 0) @@ -224,8 +230,13 @@ public: /// Initialize all components of the the vector with the specified value explicit TVector3(T val) : x(val), y(val), z(val) { } - /// Initialize a vector with the components of a point data structure - explicit TVector3(const TPoint3 &point); + /// Initialize the vector with the components of a point data structure + template explicit TVector3(const TVector3 &v) + : x((T) v.x), y((T) v.y), z((T) v.z) { } + + /// Initialize the vector with the components of another vector data structure + template explicit TVector3(const TPoint3 &p) + : x((T) p.x), y((T) p.y), z((T) p.z) { } /// Unserialize a vector from a binary data stream TVector3(Stream *stream) { @@ -272,7 +283,7 @@ public: return TVector3(-x, -y, -z); } - /// Divide the vector by the given scalar + /// Divide the vector by the given scalar and return the result TVector3 operator/(T f) const { #ifdef MTS_DEBUG if (f == 0) @@ -282,6 +293,7 @@ public: return TVector3(x * recip, y * recip, z * recip); } + /// Divide the vector by the given scalar TVector3 &operator/=(T f) { #ifdef MTS_DEBUG if (f == 0) @@ -413,8 +425,13 @@ public: /// Initialize all components of the the vector with the specified value explicit TVector4(T val) : x(val), y(val), z(val), w(val) { } - /// Initialize a vector with the components of a point data structure - explicit TVector4(const TPoint4 &point); + /// Initialize the vector with the components of a point data structure + template explicit TVector4(const TVector4 &v) + : x((T) v.x), y((T) v.y), z((T) v.z), w((T) v.w) { } + + /// Initialize the vector with the components of another vector data structure + template explicit TVector4(const TPoint4 &p) + : x((T) p.x), y((T) p.y), z((T) p.z), w((T) p.w) { } /// Unserialize a vector from a binary data stream TVector4(Stream *stream) { @@ -462,7 +479,7 @@ public: return TVector4(-x, -y, -z, -w); } - /// Divide the vector by the given scalar + /// Divide the vector by the given scalar and return the result TVector4 operator/(T f) const { #ifdef MTS_DEBUG if (f == 0) @@ -472,6 +489,7 @@ public: return TVector4(x * recip, y * recip, z * recip, w * recip); } + /// Divide the vector by the given scalar TVector4 &operator/=(T f) { #ifdef MTS_DEBUG if (f == 0) diff --git a/include/mitsuba/render/fwd.h b/include/mitsuba/render/fwd.h index 5c40444a..ec1dc50a 100644 --- a/include/mitsuba/render/fwd.h +++ b/include/mitsuba/render/fwd.h @@ -51,7 +51,7 @@ class PhaseFunction; class PhotonMap; class PreviewWorker; class ProjectiveCamera; -class RadianceQueryRecord; +struct RadianceQueryRecord; class Random; class RangeWorkUnit; class ReconstructionFilter; @@ -65,7 +65,7 @@ class Scene; class SceneHandler; class Shader; class Shape; -class ShapeSamplingRecord; +struct ShapeSamplingRecord; class SparseMipmap3D; class Spiral; class Subsurface; diff --git a/include/mitsuba/render/kdtree.h b/include/mitsuba/render/kdtree.h index 9a38ef36..09103de7 100644 --- a/include/mitsuba/render/kdtree.h +++ b/include/mitsuba/render/kdtree.h @@ -53,6 +53,8 @@ #define MTS_USE_MT 1 #endif +#include + /** * Pre-defined max. stack size for the ray traversal algorithm */ diff --git a/src/converter/collada.cpp b/src/converter/collada.cpp index def1fdae..8dada928 100644 --- a/src/converter/collada.cpp +++ b/src/converter/collada.cpp @@ -16,9 +16,6 @@ along with this program. If not, see . */ -#define BOOST_FILESYSTEM_NO_LIB -#define BOOST_SYSTEM_NO_LIB - #include #include #include @@ -154,9 +151,9 @@ VertexData *fetchVertexData(Transform transform, std::ostream &os, domAccessor *accessor = techniqueCommon->getAccessor(); if (!accessor) SLog(EError, "Data source does not have a tag!"); - unsigned int nParams = accessor->getParam_array().getCount(), - stride = accessor->getStride(); - size_t size = accessor->getCount(); + unsigned int nParams = (unsigned int) accessor->getParam_array().getCount(), + stride = (unsigned int) accessor->getStride(); + size_t size = (size_t) accessor->getCount(); SAssert(nParams <= 4); Vec4 *target = new Vec4[size]; diff --git a/src/converter/mtsimport.cpp b/src/converter/mtsimport.cpp index 5b8584ec..7fa466f1 100644 --- a/src/converter/mtsimport.cpp +++ b/src/converter/mtsimport.cpp @@ -100,7 +100,7 @@ int colladaMain(int argc, char **argv) { logLevel = EDebug; break; case 'f': - fov = strtod(optarg, &end_ptr); + fov = (Float) strtod(optarg, &end_ptr); if (*end_ptr != '\0') SLog(EError, "Invalid field of view value!"); break; diff --git a/src/libcore/bitmap.cpp b/src/libcore/bitmap.cpp index 60d90237..85745fca 100644 --- a/src/libcore/bitmap.cpp +++ b/src/libcore/bitmap.cpp @@ -21,7 +21,7 @@ #if defined(WIN32) #undef _CRT_SECURE_NO_WARNINGS -#define _USE_MATH_DEFINES +#define _MATH_DEFINES_DEFINED #endif #include diff --git a/src/libcore/fstream.cpp b/src/libcore/fstream.cpp index 91e5a8a1..a65d0083 100644 --- a/src/libcore/fstream.cpp +++ b/src/libcore/fstream.cpp @@ -90,7 +90,7 @@ void FileStream::open(const fs::path &path, EFileMode mode) { break; } - m_file = CreateFile(filename.c_str(), dwDesiredAccess, + m_file = CreateFile(path.file_string().c_str(), dwDesiredAccess, FILE_SHARE_WRITE | FILE_SHARE_READ, 0, dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, 0); diff --git a/src/libcore/plugin.cpp b/src/libcore/plugin.cpp index fc3410ee..e4319154 100644 --- a/src/libcore/plugin.cpp +++ b/src/libcore/plugin.cpp @@ -65,7 +65,7 @@ Plugin::Plugin(const std::string &shortName, const fs::path &path) try { m_createInstance = (CreateInstanceFunc) getSymbol("CreateInstance"); - } catch (const std::exception &ex) { + } catch (const std::exception &) { m_createUtility = (CreateUtilityFunc) getSymbol("CreateUtility"); m_isUtility = true; } diff --git a/src/libcore/shvector.cpp b/src/libcore/shvector.cpp index 4786c60d..7953b75f 100644 --- a/src/libcore/shvector.cpp +++ b/src/libcore/shvector.cpp @@ -73,7 +73,7 @@ Float SHVector::eval(Float theta, Float phi) const { } Float SHVector::findMinimum(int res = 32) const { - Float hExt = M_PI / res, hInt = (2*M_PI)/(res*2); + Float hExt = (Float) M_PI / res, hInt = (2 * (Float) M_PI)/(res*2); Float minimum = std::numeric_limits::infinity(); for (int i=0; i<=res; ++i) { @@ -88,7 +88,7 @@ Float SHVector::findMinimum(int res = 32) const { } void SHVector::offset(Float value) { - operator()(0, 0) += 2 * value * std::sqrt(M_PI); + operator()(0, 0) += 2 * value * (Float) std::sqrt(M_PI); } Float SHVector::eval(const Vector &v) const { @@ -160,7 +160,7 @@ Float SHVector::legendre(int l, int m, Float x) { } void SHVector::normalize() { - Float correction = 1/(2*std::sqrt(M_PI)*operator()(0,0)); + Float correction = 1/(2 * (Float) std::sqrt(M_PI)*operator()(0,0)); for (size_t i=0; i SHVector::mu2() const { result(2, 2) += 2*sqrto3*operator()(2,0); } - return result * (2*std::sqrt(M_PI/15)); + return result * (2*std::sqrt((Float) M_PI / 15)); } std::string SHVector::toString() const { @@ -225,7 +225,7 @@ Float SHVector::computeNormalization(int l, int m) { SAssert(m>=0); return std::sqrt( ((2*l+1) * boost::math::factorial(l-m)) - / (4*M_PI * boost::math::factorial(l+m))); + / (4 * (Float) M_PI * boost::math::factorial(l+m))); } void SHVector::staticInitialization() { @@ -392,7 +392,7 @@ SHSampler::SHSampler(int bands, int depth) : m_bands(bands), m_depth(depth) { for (int i=0; i<=depth; ++i) { int res = 1 << i; Float zStep = -2 / (Float) res; - Float phiStep = 2*M_PI / (Float) res; + Float phiStep = 2 * (Float) M_PI / (Float) res; m_phiMap[i] = new Float*[res]; m_legendreMap[i] = new Float*[res]; @@ -406,7 +406,7 @@ SHSampler::SHSampler(int bands, int depth) : m_bands(bands), m_depth(depth) { for (int m=0; m<=l; ++m) { Float normFactor = boost::math::tgamma_delta_ratio( (Float) (l - m + 1), (Float) (2 * m), boost::math::policies::policy<>()); - normFactor = std::sqrt(normFactor * (2 * l + 1) / (4 * M_PI)); + normFactor = std::sqrt(normFactor * (2 * l + 1) / (4 * (Float) M_PI)); if (m != 0) normFactor *= SQRT_TWO; m_normalization[I(l, m)] = normFactor; @@ -461,7 +461,7 @@ Float SHSampler::warp(const SHVector &f, Point2 &sample) const { } Float zStep = -2 / (Float) (1 << m_depth); - Float phiStep = 2 * M_PI / (Float) (1 << m_depth); + Float phiStep = 2 * (Float) M_PI / (Float) (1 << m_depth); i >>= 1; j >>= 1; Float z = 1 + zStep * i + zStep * sample.x; diff --git a/src/libcore/util.cpp b/src/libcore/util.cpp index f9355b00..839bbacf 100644 --- a/src/libcore/util.cpp +++ b/src/libcore/util.cpp @@ -583,13 +583,13 @@ Point2 squareToDiskConcentric(const Point2 &sample) { } Float squareToConePdf(Float cosCutoff) { - return 1 / (2 * (Float) M_PI * (1 - cosCutoff)); + return 1 / (2 * M_PI * (1 - cosCutoff)); } Vector squareToCone(Float cosCutoff, const Point2 &sample) { Float cosTheta = (1-sample.x) + sample.x * cosCutoff; Float sinTheta = std::sqrt(1 - cosTheta * cosTheta); - Float phi = sample.y * (2 * (Float) M_PI); + Float phi = sample.y * (2 * M_PI); return Vector(std::cos(phi) * sinTheta, std::sin(phi) * sinTheta, cosTheta); } diff --git a/src/libhw/device.cpp b/src/libhw/device.cpp index eedfadb2..ef4b314c 100644 --- a/src/libhw/device.cpp +++ b/src/libhw/device.cpp @@ -38,7 +38,7 @@ Device::Device(Session *name) { m_fullscreen = false; m_fsaa = 1; m_dimension = Vector2i(640, 480); - m_position = Vector2i(0, 0); + m_position = Point2i(0, 0); m_center = true; m_session = name; m_showFPS = true; diff --git a/src/libhw/glrenderer.cpp b/src/libhw/glrenderer.cpp index 00090545..b74dac20 100644 --- a/src/libhw/glrenderer.cpp +++ b/src/libhw/glrenderer.cpp @@ -385,7 +385,7 @@ void GLRenderer::blitTexture(const GPUTexture *tex, bool flipVertically, if (flipVertically) std::swap(upperLeft.y, lowerRight.y); - const Float zDepth = -1.0f; // just before the far plane + const float zDepth = -1.0f; // just before the far plane glTexCoord2f(0.0f, 0.0f); glVertex3f(upperLeft.x, upperLeft.y, zDepth); glTexCoord2f(1.0f, 0.0f); diff --git a/src/libhw/vpl.cpp b/src/libhw/vpl.cpp index 877031a4..10bc21d4 100644 --- a/src/libhw/vpl.cpp +++ b/src/libhw/vpl.cpp @@ -409,7 +409,7 @@ void VPLShaderManager::configure(const VPL &vpl, const BSDF *bsdf, const Luminai program->setSource(GPUProgram::EFragmentProgram, oss.str()); try { program->init(); - } catch (const std::exception &ex) { + } catch (const std::exception &) { Log(EWarn, "Unable to compile the following VPL program:\n%s", oss.str().c_str()); throw; } diff --git a/src/libhw/wgldevice.cpp b/src/libhw/wgldevice.cpp index 30384c0a..36aadd7c 100644 --- a/src/libhw/wgldevice.cpp +++ b/src/libhw/wgldevice.cpp @@ -66,7 +66,7 @@ LONG WINAPI WGLDevice::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara device->initPixelFormat(hWnd); break; case WM_SIZE: - device->m_dimension = Point2i(LOWORD(lParam), HIWORD(lParam)); + device->m_dimension = Vector2i(LOWORD(lParam), HIWORD(lParam)); break; case WM_PAINT: BeginPaint(hWnd, &ps); @@ -424,7 +424,7 @@ bool WGLDevice::translateMouse(UINT uMsg, WPARAM wParam, DeviceEvent &event) { if (m_mouse != Point2i(-1, -1)) { event.setMouseRelative(event.getMousePosition() - m_mouse); } else { - event.setMouseRelative(Point2i(0, 0)); + event.setMouseRelative(Vector2i(0, 0)); } m_mouse = event.getMousePosition(); diff --git a/src/librender/kdtree.cpp b/src/librender/kdtree.cpp index cfbca4e2..4f23d3a5 100644 --- a/src/librender/kdtree.cpp +++ b/src/librender/kdtree.cpp @@ -18,7 +18,6 @@ #include #include -#include MTS_NAMESPACE_BEGIN diff --git a/src/librender/kdtree_coherent.cpp b/src/librender/kdtree_coherent.cpp index 8eee0e85..863fa45b 100644 --- a/src/librender/kdtree_coherent.cpp +++ b/src/librender/kdtree_coherent.cpp @@ -19,7 +19,6 @@ #include #include #include -#include MTS_NAMESPACE_BEGIN diff --git a/src/librender/kdtree_compiler.cpp b/src/librender/kdtree_compiler.cpp index b1c297e2..86df27f4 100644 --- a/src/librender/kdtree_compiler.cpp +++ b/src/librender/kdtree_compiler.cpp @@ -17,7 +17,6 @@ */ #include -#include #include MTS_NAMESPACE_BEGIN diff --git a/src/librender/kdtree_traversal.cpp b/src/librender/kdtree_traversal.cpp index 2cbe011e..b3317080 100644 --- a/src/librender/kdtree_traversal.cpp +++ b/src/librender/kdtree_traversal.cpp @@ -19,7 +19,6 @@ #include #include #include -#include MTS_NAMESPACE_BEGIN diff --git a/src/qtgui/preview.h b/src/qtgui/preview.h index 636e76ec..6f0cd36c 100644 --- a/src/qtgui/preview.h +++ b/src/qtgui/preview.h @@ -28,7 +28,7 @@ using namespace mitsuba; -class SceneContext; +struct SceneContext; /** * Asynchronous preview rendering thread diff --git a/src/qtgui/sceneloader.h b/src/qtgui/sceneloader.h index f5d8e9b3..04b5ccc1 100644 --- a/src/qtgui/sceneloader.h +++ b/src/qtgui/sceneloader.h @@ -22,7 +22,7 @@ #include #include -class SceneContext; +struct SceneContext; using namespace mitsuba; diff --git a/src/volume/gridvolume.cpp b/src/volume/gridvolume.cpp index a27846bf..f563e814 100644 --- a/src/volume/gridvolume.cpp +++ b/src/volume/gridvolume.cpp @@ -187,7 +187,7 @@ public: m_res.x, m_res.y, m_res.z, m_channels, nEntries*sizeof(float)/1024, m_originalAABB.toString().c_str()); stream->close(); - m_file = CreateFile(resolved.c_str(), GENERIC_READ, + m_file = CreateFile(resolved.file_string().c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (m_file == INVALID_HANDLE_VALUE) @@ -213,9 +213,9 @@ public: } /** - * This is needed since Mitsuba might be - * compiled with either single/double precision - */ + * This is needed since Mitsuba might be + * compiled with either single/double precision + */ struct float3 { float value[3];