diff --git a/include/mitsuba/core/fwd.h b/include/mitsuba/core/fwd.h index 476d33af..91ebc7ec 100644 --- a/include/mitsuba/core/fwd.h +++ b/include/mitsuba/core/fwd.h @@ -23,6 +23,9 @@ MTS_NAMESPACE_BEGIN struct AABB; +class AbstractAnimationTrack; +template class AnimationTrack; +class AnimatedTransform; class Appender; class Bitmap; class BlackBodySpectrum; @@ -163,6 +166,11 @@ class WorkResult; class WorkUnit; class ZStream; +typedef AnimationTrack FloatTrack; +typedef AnimationTrack QuatTrack; +typedef AnimationTrack VectorTrack; +typedef AnimationTrack PointTrack; + MTS_NAMESPACE_END #if BOOST_VERSION >= 105000 diff --git a/include/mitsuba/core/platform.h b/include/mitsuba/core/platform.h index e949545e..03d5ea55 100644 --- a/include/mitsuba/core/platform.h +++ b/include/mitsuba/core/platform.h @@ -196,7 +196,7 @@ MTS_NAMESPACE_END /// \cond // Try to make MSVC++ behave a bit more like C++ // with an underlying C99 implementation -// (and dn't include this in the documentation) +// (and don't include this in the documentation) #if defined(_MSC_VER) #include @@ -204,8 +204,13 @@ MTS_NAMESPACE_END #define snprintf _snprintf #define vsnprintf _vsnprintf -namespace std { +#if defined(__64BIT__) +typedef long long ssize_t; +#else +typedef long ssize_t; +#endif +namespace std { inline char tolower(char c) { return ::tolower(c); } diff --git a/include/mitsuba/core/track.h b/include/mitsuba/core/track.h index b996ec9b..35bafb4c 100644 --- a/include/mitsuba/core/track.h +++ b/include/mitsuba/core/track.h @@ -324,7 +324,7 @@ template<> inline void AnimationTrack::serialize(Stream *stream, con class MTS_EXPORT_CORE AnimatedTransform : public Object { private: /// Internal functor used by \ref eval() and \ref SimpleCache - struct MTS_EXPORT_RENDER TransformFunctor { + struct MTS_EXPORT_CORE TransformFunctor { public: inline TransformFunctor(const std::vector &tracks) : m_tracks(tracks) {} diff --git a/include/mitsuba/render/fwd.h b/include/mitsuba/render/fwd.h index 3e36d5e6..03a17ae0 100644 --- a/include/mitsuba/render/fwd.h +++ b/include/mitsuba/render/fwd.h @@ -22,13 +22,6 @@ MTS_NAMESPACE_BEGIN -class AbstractAnimationTrack; -template class AnimationTrack; -typedef AnimationTrack FloatTrack; -typedef AnimationTrack QuatTrack; -typedef AnimationTrack VectorTrack; -typedef AnimationTrack PointTrack; -class AnimatedTransform; class BlockedImageProcess; class BlockedRenderProcess; class BlockListener; diff --git a/src/libcore/CMakeLists.txt b/src/libcore/CMakeLists.txt index 5a36927a..45afb3f9 100644 --- a/src/libcore/CMakeLists.txt +++ b/src/libcore/CMakeLists.txt @@ -145,7 +145,7 @@ set(LIBS ${ZLIB_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${ILMBASE_LIBRARIES} ${OPENEXR_LIBRARIES} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) if(WIN32) - list(APPEND LIBS ws2_32) + list(APPEND LIBS ws2_32 psapi) elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") list(APPEND LIBS rt) elseif (APPLE) diff --git a/src/libcore/SConscript b/src/libcore/SConscript index bc403cd8..57e69154 100644 --- a/src/libcore/SConscript +++ b/src/libcore/SConscript @@ -24,6 +24,11 @@ if coreEnv.has_key('JPEGLIB'): coreEnv.Prepend(LIBS=env['JPEGLIB']) coreEnv.Prepend(CPPDEFINES = [['MTS_BUILD_MODULE', 'MTS_MODULE_CORE']]) + + +if sys.platform == 'win32': + coreEnv.Append(LIBS=['psapi']) + libcore_objects = [ 'class.cpp', 'object.cpp', 'statistics.cpp', 'thread.cpp', 'brent.cpp', 'logger.cpp', 'appender.cpp', 'formatter.cpp', 'lock.cpp', 'qmc.cpp', diff --git a/src/libcore/fmtconv.cpp b/src/libcore/fmtconv.cpp index 7f8d3b73..6fac2ee1 100644 --- a/src/libcore/fmtconv.cpp +++ b/src/libcore/fmtconv.cpp @@ -191,15 +191,20 @@ template struct FormatConverterImpl : public FormatConverter { case Bitmap::EXYZ: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); - *dest++ = 0.950456f*value; *dest++ = value; *dest++ = 1.08875f*value; + Float value = convertScalar(*source++, sourceGamma); + *dest++ = convertScalar(value * 0.950456f, 1.0f, NULL, multiplier, invDestGamma); + *dest++ = convertScalar(value, 1.0f, NULL, multiplier, invDestGamma); + *dest++ = convertScalar(value * 1.08875f, 1.0f, NULL, multiplier, invDestGamma); } break; case Bitmap::EXYZA: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); - *dest++ = 0.950456f*value; *dest++ = value; *dest++ = 1.08875f*value; *dest++ = one; + Float value = convertScalar(*source++, sourceGamma); + *dest++ = convertScalar(value * 0.950456f, 1.0f, NULL, multiplier, invDestGamma); + *dest++ = convertScalar(value, 1.0f, NULL, multiplier, invDestGamma); + *dest++ = convertScalar(value * 1.08875f, 1.0f, NULL, multiplier, invDestGamma); + *dest++ = one; } break; @@ -269,16 +274,20 @@ template struct FormatConverterImpl : public FormatConverter { case Bitmap::EXYZ: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); - *dest++ = 0.950456f*value; *dest++ = value; *dest++ = 1.08875f*value; - source++; + Float value = convertScalar(*source++, sourceGamma); + *dest++ = convertScalar(value * 0.950456f, 1.0f, NULL, multiplier, invDestGamma); + *dest++ = convertScalar(value, 1.0f, NULL, multiplier, invDestGamma); + *dest++ = convertScalar(value * 1.08875f, 1.0f, NULL, multiplier, invDestGamma); + *source++; } break; case Bitmap::EXYZA: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); - *dest++ = 0.950456f*value; *dest++ = value; *dest++ = 1.08875f*value; + Float value = convertScalar(*source++, sourceGamma); + *dest++ = convertScalar(value * 0.950456f, 1.0f, NULL, multiplier, invDestGamma); + *dest++ = convertScalar(value, 1.0f, NULL, multiplier, invDestGamma); + *dest++ = convertScalar(value * 1.08875f, 1.0f, NULL, multiplier, invDestGamma); *dest++ = convertScalar(*source++); } break; diff --git a/src/libcore/track.cpp b/src/libcore/track.cpp index 1e8a64a6..e444fcb9 100644 --- a/src/libcore/track.cpp +++ b/src/libcore/track.cpp @@ -258,7 +258,7 @@ void AnimatedTransform::collectKeyframes(std::set &result) const { } if (result.size() == 0) - result.insert(0); + result.insert((Float) 0); } void AnimatedTransform::serialize(Stream *stream) const { diff --git a/src/libcore/util.cpp b/src/libcore/util.cpp index 17214c62..c0cbb270 100644 --- a/src/libcore/util.cpp +++ b/src/libcore/util.cpp @@ -30,6 +30,7 @@ #include #include #elif defined(__WINDOWS__) +#include #include #include #else @@ -174,7 +175,7 @@ int getCoreCount() { size_t getPrivateMemoryUsage() { #if defined(__WINDOWS__) PROCESS_MEMORY_COUNTERS_EX pmc; - GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc)); + GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS *) &pmc, sizeof(pmc)); return (size_t) pmc.PrivateUsage; /* Process-private memory usage (RAM + swap) */ #elif defined(__OSX__) struct task_basic_info_64 t_info;