Cycles: move clew into cycles namespace to avoid conflicts, and fix mesh
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 15 Nov 2011 19:23:35 +0000 (19:23 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 15 Nov 2011 19:23:35 +0000 (19:23 +0000)
displacement panel showing with blender internal.

intern/cycles/SConscript
intern/cycles/blender/addon/ui.py
intern/cycles/util/CMakeLists.txt
intern/cycles/util/util_opencl.cpp [moved from intern/cycles/util/util_opencl.c with 99% similarity]
intern/cycles/util/util_opencl.h

index 1acb7321f0981646dce8cc44c325f6094094ce6a..4d45a6875a97f097b0c5d1912a09fd7f88c5ead4 100644 (file)
@@ -6,7 +6,7 @@ cycles = env.Clone()
 
 cycles.Depends('../../source/blender/makesrna/intern/RNA_blender_cpp.h', 'makesrna')
 
-sources = cycles.Glob('bvh/*.cpp') + cycles.Glob('device/*.cpp') + cycles.Glob('kernel/*.cpp') + cycles.Glob('render/*.cpp') + cycles.Glob('subd/*.cpp') + cycles.Glob('util/*.cpp') + cycles.Glob('util/*.c') + cycles.Glob('blender/*.cpp')
+sources = cycles.Glob('bvh/*.cpp') + cycles.Glob('device/*.cpp') + cycles.Glob('kernel/*.cpp') + cycles.Glob('render/*.cpp') + cycles.Glob('subd/*.cpp') + cycles.Glob('util/*.cpp') + cycles.Glob('blender/*.cpp')
 
 sources.remove(path.join('util', 'util_view.cpp'))
 sources.remove(path.join('render', 'film_response.cpp'))
index 6cebe3d24e4cfee8960e6ff489f61b1b9694f49e..d96efe93cf8d73ba68d4f4d0b24d6393a7870fca 100644 (file)
@@ -295,7 +295,7 @@ class Cycles_PT_mesh_displacement(CyclesButtonsPanel, Panel):
 
     @classmethod
     def poll(cls, context):
-        return context.mesh or context.curve or context.meta_ball
+        return CyclesButtonsPanel.poll(context) and context.mesh or context.curve or context.meta_ball
 
     def draw(self, context):
         layout = self.layout
index 76e948504ebb1fc2888080f792e2cc3a47d68085..9182ee4cbe1aa0e44bf5d074f0568f0babb30491 100644 (file)
@@ -11,7 +11,7 @@ set(SRC
        util_dynlib.cpp
        util_md5.cpp
        util_memarena.cpp
-       util_opencl.c
+       util_opencl.cpp
        util_path.cpp
        util_string.cpp
        util_system.cpp
similarity index 99%
rename from intern/cycles/util/util_opencl.c
rename to intern/cycles/util/util_opencl.cpp
index 10429ffcd809b9fe58039c9948521cc555e65f71..1d05b0b687a4b86712699377a861e833b1d7e20a 100755 (executable)
@@ -7,6 +7,8 @@
 //  Extracted from the CLCC project - http://clcc.sourceforge.net/
 //////////////////////////////////////////////////////////////////////////
 
+#include <stdlib.h>
+
 #include "util_opencl.h"
 
 #ifndef CLCC_GENERATE_DOCUMENTATION
@@ -36,7 +38,7 @@
     //#define CLCC_DYNLIB_IMPORT      implementation_defined
 #endif
 
-#include <stdlib.h>
+CCL_NAMESPACE_BEGIN
 
 //! \brief module handle
 static CLCC_DYNLIB_HANDLE module = NULL;
@@ -315,3 +317,5 @@ const char *clErrorString(cl_int error)
     return strings[-error];
 }
 
+CCL_NAMESPACE_END
+
index 08694874ac193e56d10d0c1025339e8e16244d30..2e97097ef369c7e01fc4e41737f3d46de67de759 100755 (executable)
@@ -10,6 +10,8 @@
 #ifndef __UTIL_OPENCL_H__
 #define __UTIL_OPENCL_H__
 
+CCL_NAMESPACE_BEGIN
+
 //! This file contains a copy of the contents of CL.H and CL_PLATFORM.H from the 
 //! official OpenCL spec. The purpose of this code is to load the OpenCL dynamic
 //! library at run-time and thus allow the executable to function on many
 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 ******************************************************************************/
 
-#ifdef __APPLE__
-/* Contains #defines for AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER below */
-#include <AvailabilityMacros.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #ifndef CLCC_GENERATE_DOCUMENTATION
 
 #if defined(_WIN32)
@@ -1312,9 +1305,7 @@ CLEW_FUN_EXPORT     PFNCLGETEXTENSIONFUNCTIONADDRESS    __clewGetExtensionFuncti
 int clLibraryInit(void);
 const char *clErrorString(cl_int error);
 
-#ifdef __cplusplus
-}
-#endif
+CCL_NAMESPACE_END
 
 #endif /*  __UTIL_OPENCL_H__ */