Commit: 2a34d36f4453051de30dc9871a4d51232eb98dff
Author: Nicholas Bishop
Date:   Wed Feb 11 16:57:17 2015 +0100
Branches: cycles-ptex-49
https://developer.blender.org/rB2a34d36f4453051de30dc9871a4d51232eb98dff

Code cleanup: shuffling some Ptex declarations around

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

M       extern/ptex/BPX_ptex.h
A       extern/ptex/BPX_rect.h
M       extern/ptex/bpx_c_api.cpp

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

diff --git a/extern/ptex/BPX_ptex.h b/extern/ptex/BPX_ptex.h
index 9d8f4df..15dcae2 100644
--- a/extern/ptex/BPX_ptex.h
+++ b/extern/ptex/BPX_ptex.h
@@ -1,6 +1,8 @@
 #ifndef __BPX_PTEX_H__
 #define __BPX_PTEX_H__
 
+#include "BPX_rect.h"
+
 #ifdef __cplusplus
 extern "C"{
 #endif
@@ -13,29 +15,6 @@ typedef struct BPXImageBuf BPXImageBuf;
 typedef struct BPXImageInput BPXImageInput;
 
 typedef struct {
-       int xbegin;
-       int ybegin;
-       int xend;
-       int yend;
-} BPXRect;
-
-/*
- * 01______11
- *  |      |
- *  |      |
- *  |______|
- * 00      10
- */
-typedef enum {
-       BPX_SIDE_BOTTOM = 0,  /* 00 -> 10 */
-       BPX_SIDE_RIGHT  = 1,  /* 10 -> 11 */
-       BPX_SIDE_TOP    = 2,  /* 11 -> 01 */
-       BPX_SIDE_LEFT   = 3,  /* 01 -> 00 */
-
-       BPX_NUM_SIDES   = 4
-} BPXSide;
-
-typedef struct {
        BPXSide side;
        bool reverse;
 } BPXEdge;
diff --git a/extern/ptex/BPX_rect.h b/extern/ptex/BPX_rect.h
new file mode 100644
index 0000000..5702265
--- /dev/null
+++ b/extern/ptex/BPX_rect.h
@@ -0,0 +1,40 @@
+#ifndef __BPX_RECT_H__
+#define __BPX_RECT_H__
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+/* TODO(nicholasbishop): this is yet another 2D integer rect
+ * structure. Would be better to reuse rcti. */
+
+typedef struct BPXRect {
+       int xbegin;
+       int xend;
+
+       int ybegin;
+       int yend;
+} BPXRect;
+
+/*                   Top
+ *    (xbegin, yend)______(xend, yend)
+ *                 |      |
+ *            Left |      | Right
+ *                 |______|
+ * (xbegin, ybegin)        (xend, ybegin)
+ *                  Bottom
+ */
+typedef enum {
+       BPX_SIDE_BOTTOM = 0,
+       BPX_SIDE_RIGHT  = 1,
+       BPX_SIDE_TOP    = 2,
+       BPX_SIDE_LEFT   = 3,
+
+       BPX_NUM_SIDES   = 4
+} BPXSide;
+
+#ifdef __cplusplus
+}  /* extern "C" */
+#endif
+
+#endif
diff --git a/extern/ptex/bpx_c_api.cpp b/extern/ptex/bpx_c_api.cpp
index 9dde3d9..253cc75 100644
--- a/extern/ptex/bpx_c_api.cpp
+++ b/extern/ptex/bpx_c_api.cpp
@@ -11,34 +11,6 @@ OIIO_NAMESPACE_USING
 // TODO
 static const int nthreads = 1;
 
-/* Directed edges (uv1 -> uv2)
- *
- * 01______11
- *  |      |
- *  |      |
- *  |______|
- * 00      10
- */
-#if 0
-typedef enum {
-       /* Bottom */
-       BPX_EDGE_00_10 = 0,
-       BPX_EDGE_10_00 = 1,
-
-       /* Right */
-       BPX_EDGE_10_11 = 2,
-       BPX_EDGE_11_10 = 3,
-
-       /* Top */
-       BPX_EDGE_11_01 = 4,
-       BPX_EDGE_01_11 = 5,
-
-       /* Left */
-       BPX_EDGE_01_00 = 6,
-       BPX_EDGE_00_01 = 7,
-} BPXEdge;
-#endif
-
 static TypeDesc bpx_type_desc_to_oiio_type_desc(const BPXTypeDesc type_desc)
 {
        switch (type_desc) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to