Browse Source

Adding STBI_IMAGE_NO_ATOMIC for including stb image write without Atomic dependency

Josh Engebretson 8 years ago
parent
commit
6a6c233c9b

+ 4 - 0
Source/ThirdParty/CMakeLists.txt

@@ -70,6 +70,10 @@ if (NOT IOS AND NOT ANDROID AND NOT WEB)
     add_subdirectory(Poco)
     add_subdirectory(nativefiledialog)
     add_subdirectory(libsquish)
+    add_subdirectory(thekla)
+    if (ATOMIC_GLOW)
+        add_subdirectory(embree)
+    endif()
 endif ()
 
 if (ATOMIC_DATABASE_SQLITE)

+ 4 - 1
Source/ThirdParty/STB/stb_image_write.h

@@ -116,7 +116,9 @@ LICENSE
 #define INCLUDE_STB_IMAGE_WRITE_H
 
 // ATOMIC BEGIN
+#ifndef STBI_IMAGE_NO_ATOMIC
 #include "../../Atomic/Container/Str.h"
+#endif
 // ATOMIC END
 
 #ifdef __cplusplus
@@ -228,7 +230,8 @@ static void stbi__stdio_write(void *context, void *data, int size)
 static int stbi__start_write_file(stbi__write_context *s, const char *filename)
 {
    // Urho3D: proper UTF8 handling for Windows, requires Urho3D WString class
-#ifndef _WIN32
+   // ATOMIC: added STBI_IMAGE_NO_ATOMIC
+#ifndef _WIN32 || defined(STBI_IMAGE_NO_ATOMIC)
    FILE *f = fopen(filename, "wb");
 #else
     Atomic::WString wstr(filename);

+ 2 - 2
Source/ThirdParty/thekla/thekla_atlas.cpp

@@ -19,8 +19,8 @@
 
 #include "nvcore/Array.inl"
 
-#define STB_IMAGE_WRITE_IMPLEMENTATION
-#include <stb_image_write.h>
+#define STBI_IMAGE_NO_ATOMIC
+#include "../../STB/stb_image_write.h"
 
 using namespace Thekla;
 using namespace nv;