[Bf-blender-cvs] [1ec88c9] temp-cycles-microdisplacement: Fix some build errors in patch table code

Mai Lavelle noreply at git.blender.org
Mon Jul 18 00:09:32 CEST 2016


Commit: 1ec88c9a8f7f4f28a2e73a8767f5c79ac93b8bba
Author: Mai Lavelle
Date:   Sun Jul 17 18:05:52 2016 -0400
Branches: temp-cycles-microdisplacement
https://developer.blender.org/rB1ec88c9a8f7f4f28a2e73a8767f5c79ac93b8bba

Fix some build errors in patch table code

===================================================================

M	intern/cycles/subd/subd_patch_table.cpp
M	intern/cycles/subd/subd_patch_table.h

===================================================================

diff --git a/intern/cycles/subd/subd_patch_table.cpp b/intern/cycles/subd/subd_patch_table.cpp
index 91c7726..a32533b 100644
--- a/intern/cycles/subd/subd_patch_table.cpp
+++ b/intern/cycles/subd/subd_patch_table.cpp
@@ -28,6 +28,8 @@
 #include "subd_patch_table.h"
 #include "kernel_types.h"
 
+#include "util_math.h"
+
 #ifdef WITH_OPENSUBDIV
 #include <opensubdiv/far/patchTable.h>
 #endif
@@ -95,7 +97,7 @@ static void build_patch_map(PackedPatchTable& table, OpenSubdiv::Far::PatchTable
 		Far::ConstPatchParamArray params = patch_table->GetPatchParams(array);
 
 		for(int j = 0; j < patch_table->GetNumPatches(array); j++) {
-			num_faces = std::max(num_faces, (int)params[j].GetFaceId());
+			num_faces = max(num_faces, (int)params[j].GetFaceId());
 		}
 	}
 	num_faces++;
diff --git a/intern/cycles/subd/subd_patch_table.h b/intern/cycles/subd/subd_patch_table.h
index fd7ca89..da613d3 100644
--- a/intern/cycles/subd/subd_patch_table.h
+++ b/intern/cycles/subd/subd_patch_table.h
@@ -20,11 +20,18 @@
 #include "util_types.h"
 #include "util_vector.h"
 
+#ifdef WITH_OPENSUBDIV
 #include <opensubdiv/far/patchTable.h>
+#endif
 
 CCL_NAMESPACE_BEGIN
 
+#ifdef WITH_OPENSUBDIV
 using namespace OpenSubdiv;
+#else
+/* forward declare for when OpenSubdiv is unavailable */
+namespace Far { struct PatchTable; }
+#endif
 
 #define PATCH_ARRAY_SIZE 4
 #define PATCH_PARAM_SIZE 2




More information about the Bf-blender-cvs mailing list