diff --git a/src/ambientocclusionbaker.cpp b/src/ambientocclusionbaker.cpp index d2714c4d..5e935472 100644 --- a/src/ambientocclusionbaker.cpp +++ b/src/ambientocclusionbaker.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #define LIGHTMAPPER_IMPLEMENTATION #include "qtlightmapper.h" #include "ambientocclusionbaker.h" @@ -15,8 +16,9 @@ AmbientOcclusionBaker::AmbientOcclusionBaker(QScreen *targetScreen) : m_bakeHeight(256), m_ambientOcclusionImage(nullptr) { +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) m_useCore = QSurfaceFormat::defaultFormat().profile() == QSurfaceFormat::CoreProfile; - +#endif create(); m_context = new QOpenGLContext(); @@ -62,6 +64,7 @@ void AmbientOcclusionBaker::setRenderThread(QThread *thread) void AmbientOcclusionBaker::bake() { +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) if (m_meshResultContext.parts().empty()) return; @@ -213,4 +216,5 @@ void AmbientOcclusionBaker::bake() free(sceneNormals); m_context->doneCurrent(); +#endif } diff --git a/src/ambientocclusionbaker.h b/src/ambientocclusionbaker.h index 7a6edfc6..38437c64 100644 --- a/src/ambientocclusionbaker.h +++ b/src/ambientocclusionbaker.h @@ -10,7 +10,11 @@ #include "meshresultcontext.h" #include "meshloader.h" +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) class AmbientOcclusionBaker : QOffscreenSurface, public QtLightMapper +#else +class AmbientOcclusionBaker : QOffscreenSurface +#endif { public: AmbientOcclusionBaker(QScreen *targetScreen = Q_NULLPTR); diff --git a/src/gltffile.cpp b/src/gltffile.cpp index 2383ecf7..12070731 100644 --- a/src/gltffile.cpp +++ b/src/gltffile.cpp @@ -6,7 +6,7 @@ #include #include "gltffile.h" #include "version.h" -#include "util.h" +#include "dust3dutil.h" // Play with glTF online: // https://gltf-viewer.donmccurdy.com/ diff --git a/src/qtlightmapper.h b/src/qtlightmapper.h index 7754b8f4..ae594c0a 100644 --- a/src/qtlightmapper.h +++ b/src/qtlightmapper.h @@ -15,6 +15,8 @@ * you are granted a perpetual, irrevocable license to copy * * and modify this file however you want. * ***********************************************************/ +#include +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) #ifndef QT_LIGHTMAPPER_H #define QT_LIGHTMAPPER_H @@ -166,10 +168,10 @@ GLuint loadShader(GLenum type, const char *source); #include #include -#include #include #include #include +#include #define LM_SWAP(type, a, b) { type tmp = (a); (a) = (b); (b) = tmp; } @@ -180,7 +182,7 @@ GLuint loadShader(GLenum type, const char *source); #if defined(_MSC_VER) && (_MSC_VER <= 1700) static inline lm_bool lm_finite(float a) { return _finite(a); } #else -static inline lm_bool lm_finite(float a) { return isfinite(a); } +static inline lm_bool lm_finite(float a) { return std::isfinite(a); } #endif static inline int lm_mini (int a, int b) { return a < b ? a : b; } @@ -2087,3 +2089,5 @@ void QtLightMapper::destroyScene(scene_t *scene) } #endif // LIGHTMAPPER_IMPLEMENTATION + +#endif diff --git a/thirdparty/thekla_atlas/src/nvcore/Memory.cpp b/thirdparty/thekla_atlas/src/nvcore/Memory.cpp index 0ebd009d..03b05dfc 100755 --- a/thirdparty/thekla_atlas/src/nvcore/Memory.cpp +++ b/thirdparty/thekla_atlas/src/nvcore/Memory.cpp @@ -5,6 +5,10 @@ #include "Utils.h" #include +#if defined(__APPLE__) +#else +#include +#endif #define USE_EFENCE 0 diff --git a/thirdparty/thekla_atlas/src/nvmath/Box.h b/thirdparty/thekla_atlas/src/nvmath/Box.h index a7c8b15e..bec04784 100755 --- a/thirdparty/thekla_atlas/src/nvmath/Box.h +++ b/thirdparty/thekla_atlas/src/nvmath/Box.h @@ -99,7 +99,7 @@ namespace nv } // nv namespace -#include "box.inl" +#include "Box.inl" #endif // NV_MATH_BOX_H