windows compilation fixes
parent
62851d28a4
commit
568baf1c89
|
@ -23,6 +23,9 @@
|
|||
MTS_NAMESPACE_BEGIN
|
||||
|
||||
struct AABB;
|
||||
class AbstractAnimationTrack;
|
||||
template <typename T> class AnimationTrack;
|
||||
class AnimatedTransform;
|
||||
class Appender;
|
||||
class Bitmap;
|
||||
class BlackBodySpectrum;
|
||||
|
@ -163,6 +166,11 @@ class WorkResult;
|
|||
class WorkUnit;
|
||||
class ZStream;
|
||||
|
||||
typedef AnimationTrack<Float> FloatTrack;
|
||||
typedef AnimationTrack<Quaternion> QuatTrack;
|
||||
typedef AnimationTrack<Vector> VectorTrack;
|
||||
typedef AnimationTrack<Point> PointTrack;
|
||||
|
||||
MTS_NAMESPACE_END
|
||||
|
||||
#if BOOST_VERSION >= 105000
|
||||
|
|
|
@ -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 <float.h>
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -324,7 +324,7 @@ template<> inline void AnimationTrack<Quaternion>::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<AbstractAnimationTrack *> &tracks)
|
||||
: m_tracks(tracks) {}
|
||||
|
|
|
@ -22,13 +22,6 @@
|
|||
|
||||
MTS_NAMESPACE_BEGIN
|
||||
|
||||
class AbstractAnimationTrack;
|
||||
template <typename T> class AnimationTrack;
|
||||
typedef AnimationTrack<Float> FloatTrack;
|
||||
typedef AnimationTrack<Quaternion> QuatTrack;
|
||||
typedef AnimationTrack<Vector> VectorTrack;
|
||||
typedef AnimationTrack<Point> PointTrack;
|
||||
class AnimatedTransform;
|
||||
class BlockedImageProcess;
|
||||
class BlockedRenderProcess;
|
||||
class BlockListener;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -191,15 +191,20 @@ template <typename T> struct FormatConverterImpl : public FormatConverter {
|
|||
|
||||
case Bitmap::EXYZ:
|
||||
for (size_t i=0; i<count; ++i) {
|
||||
DestFormat value = convertScalar<DestFormat>(*source++, sourceGamma, precomp, multiplier, invDestGamma);
|
||||
*dest++ = 0.950456f*value; *dest++ = value; *dest++ = 1.08875f*value;
|
||||
Float value = convertScalar<Float>(*source++, sourceGamma);
|
||||
*dest++ = convertScalar<DestFormat>(value * 0.950456f, 1.0f, NULL, multiplier, invDestGamma);
|
||||
*dest++ = convertScalar<DestFormat>(value, 1.0f, NULL, multiplier, invDestGamma);
|
||||
*dest++ = convertScalar<DestFormat>(value * 1.08875f, 1.0f, NULL, multiplier, invDestGamma);
|
||||
}
|
||||
break;
|
||||
|
||||
case Bitmap::EXYZA:
|
||||
for (size_t i=0; i<count; ++i) {
|
||||
DestFormat value = convertScalar<DestFormat>(*source++, sourceGamma, precomp, multiplier, invDestGamma);
|
||||
*dest++ = 0.950456f*value; *dest++ = value; *dest++ = 1.08875f*value; *dest++ = one;
|
||||
Float value = convertScalar<Float>(*source++, sourceGamma);
|
||||
*dest++ = convertScalar<DestFormat>(value * 0.950456f, 1.0f, NULL, multiplier, invDestGamma);
|
||||
*dest++ = convertScalar<DestFormat>(value, 1.0f, NULL, multiplier, invDestGamma);
|
||||
*dest++ = convertScalar<DestFormat>(value * 1.08875f, 1.0f, NULL, multiplier, invDestGamma);
|
||||
*dest++ = one;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -269,16 +274,20 @@ template <typename T> struct FormatConverterImpl : public FormatConverter {
|
|||
|
||||
case Bitmap::EXYZ:
|
||||
for (size_t i=0; i<count; ++i) {
|
||||
DestFormat value = convertScalar<DestFormat>(*source++, sourceGamma, precomp, multiplier, invDestGamma);
|
||||
*dest++ = 0.950456f*value; *dest++ = value; *dest++ = 1.08875f*value;
|
||||
source++;
|
||||
Float value = convertScalar<Float>(*source++, sourceGamma);
|
||||
*dest++ = convertScalar<DestFormat>(value * 0.950456f, 1.0f, NULL, multiplier, invDestGamma);
|
||||
*dest++ = convertScalar<DestFormat>(value, 1.0f, NULL, multiplier, invDestGamma);
|
||||
*dest++ = convertScalar<DestFormat>(value * 1.08875f, 1.0f, NULL, multiplier, invDestGamma);
|
||||
*source++;
|
||||
}
|
||||
break;
|
||||
|
||||
case Bitmap::EXYZA:
|
||||
for (size_t i=0; i<count; ++i) {
|
||||
DestFormat value = convertScalar<DestFormat>(*source++, sourceGamma, precomp, multiplier, invDestGamma);
|
||||
*dest++ = 0.950456f*value; *dest++ = value; *dest++ = 1.08875f*value;
|
||||
Float value = convertScalar<Float>(*source++, sourceGamma);
|
||||
*dest++ = convertScalar<DestFormat>(value * 0.950456f, 1.0f, NULL, multiplier, invDestGamma);
|
||||
*dest++ = convertScalar<DestFormat>(value, 1.0f, NULL, multiplier, invDestGamma);
|
||||
*dest++ = convertScalar<DestFormat>(value * 1.08875f, 1.0f, NULL, multiplier, invDestGamma);
|
||||
*dest++ = convertScalar<DestFormat>(*source++);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -258,7 +258,7 @@ void AnimatedTransform::collectKeyframes(std::set<Float> &result) const {
|
|||
}
|
||||
|
||||
if (result.size() == 0)
|
||||
result.insert(0);
|
||||
result.insert((Float) 0);
|
||||
}
|
||||
|
||||
void AnimatedTransform::serialize(Stream *stream) const {
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include <sys/sysctl.h>
|
||||
#include <mach/mach.h>
|
||||
#elif defined(__WINDOWS__)
|
||||
#include <windows.h>
|
||||
#include <direct.h>
|
||||
#include <psapi.h>
|
||||
#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;
|
||||
|
|
Loading…
Reference in New Issue