Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 11 Jul 2017 10:30:30 +0000 (12:30 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 11 Jul 2017 10:30:30 +0000 (12:30 +0200)
1  2 
intern/opensubdiv/opensubdiv_capi.cc
source/blender/blenkernel/intern/node.c
source/blender/editors/interface/interface_utils.c

index aed5d4fbd14dd628ccc1920568ddcc3b495b7c55,0a55a432cc69431ff86b00c8e193256bf45ad500..bb865bc0e0f1e950cf37590f8f5b5e3e57998140
@@@ -370,7 -412,42 +412,29 @@@ const struct OpenSubdiv_TopologyRefiner
        return gl_mesh->topology_refiner;
  }
  
 -int openSubdiv_supportGPUDisplay(void)
 -{
 -      // TODO: simplify extension check once Blender adopts GL 3.2
 -      return openSubdiv_gpu_legacy_support() &&
 -             (GLEW_VERSION_3_2 ||
 -             (GLEW_VERSION_3_1 && GLEW_EXT_geometry_shader4) ||
 -             (GLEW_VERSION_3_0 &&
 -              GLEW_EXT_geometry_shader4 &&
 -              GLEW_ARB_uniform_buffer_object &&
 -              (GLEW_ARB_texture_buffer_object || GLEW_EXT_texture_buffer_object)));
 -      /* also ARB_explicit_attrib_location? */
 -}
 -
  int openSubdiv_getVersionHex(void)
  {
+ #if defined(OPENSUBDIV_VERSION_NUMBER)
        return OPENSUBDIV_VERSION_NUMBER;
+ #elif defined(OPENSUBDIV_VERSION_MAJOR)
+       return OPENSUBDIV_VERSION_MAJOR * 10000 +
+              OPENSUBDIV_VERSION_MINOR * 100 +
+              OPENSUBDIV_VERSION_PATCH;
+ #elif defined(OPENSUBDIV_VERSION)
+       const char* version = STRINGIFY(OPENSUBDIV_VERSION);
+       if (version[0] == 'v') {
+               version += 1;
+       }
+       int major = 0, minor = 0, patch = 0;
+       vector<string> tokens;
+       stringSplit(&tokens, version, "_", true);
+       if (tokens.size() == 3) {
+               major = atoi(tokens[0].c_str());
+               minor = atoi(tokens[1].c_str());
+               patch = atoi(tokens[2].c_str());
+       }
+       return major * 10000 + minor * 100 + patch;
+ #else
+       return 0;
+ #endif
  }