Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-03-30 06:03:30 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-03-30 08:04:20 +0400
commita6e8137983d74ebff785ee134f635e1a08f58237 (patch)
tree6526fc6a6be6aa964d0df416922881d7421f8839
parentcc439f683b2b1603e94e9d27f420692b17b79f41 (diff)
Convenience macro for print_ funcs, saves passing id each time
-rw-r--r--source/blender/blenlib/BLI_math_matrix.h3
-rw-r--r--source/blender/blenlib/BLI_math_rotation.h2
-rw-r--r--source/blender/blenlib/BLI_math_vector.h5
-rw-r--r--source/blender/blenlib/BLI_rect.h3
4 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h
index e59c557b327..e3d9e40d272 100644
--- a/source/blender/blenlib/BLI_math_matrix.h
+++ b/source/blender/blenlib/BLI_math_matrix.h
@@ -215,6 +215,9 @@ bool is_zero_m4(float mat[4][4]);
void print_m3(const char *str, float M[3][3]);
void print_m4(const char *str, float M[3][4]);
+#define print_m3_id(M) print_m3(STRINGIFY(M), M)
+#define print_m4_id(M) print_m4(STRINGIFY(M), M)
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenlib/BLI_math_rotation.h b/source/blender/blenlib/BLI_math_rotation.h
index 477b3280d09..eb4579887f7 100644
--- a/source/blender/blenlib/BLI_math_rotation.h
+++ b/source/blender/blenlib/BLI_math_rotation.h
@@ -97,6 +97,8 @@ void mat3_to_quat_is_ok(float q[4], float mat[3][3]);
/* other */
void print_qt(const char *str, const float q[4]);
+#define print_qt_id(q) print_qt(STRINGIFY(q), q)
+
/******************************** Axis Angle *********************************/
/* conversion */
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index 9b73ca553d6..e6e46a4d8cd 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -266,6 +266,11 @@ void print_v3(const char *str, const float a[3]);
void print_v4(const char *str, const float a[4]);
void print_vn(const char *str, const float v[], const int n);
+#define print_v2_id(v) print_v2(STRINGIFY(v), v)
+#define print_v3_id(v) print_v3(STRINGIFY(v), v)
+#define print_v4_id(v) print_v4(STRINGIFY(v), v)
+#define print_vn_id(v, n) print_vn(STRINGIFY(v), v, n)
+
MINLINE void normal_short_to_float_v3(float r[3], const short n[3]);
MINLINE void normal_float_to_short_v3(short r[3], const float n[3]);
diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h
index b86a5bc51b0..a132ac40206 100644
--- a/source/blender/blenlib/BLI_rect.h
+++ b/source/blender/blenlib/BLI_rect.h
@@ -92,6 +92,9 @@ void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src);
void print_rctf(const char *str, const struct rctf *rect);
void print_rcti(const char *str, const struct rcti *rect);
+#define print_rctf_id(rect) print_rctf(STRINGIFY(rect), rect)
+#define print_rcti_id(rect) print_rcti(STRINGIFY(rect), rect)
+
BLI_INLINE float BLI_rcti_cent_x_fl(const struct rcti *rct) { return (float)(rct->xmin + rct->xmax) / 2.0f; }
BLI_INLINE float BLI_rcti_cent_y_fl(const struct rcti *rct) { return (float)(rct->ymin + rct->ymax) / 2.0f; }
BLI_INLINE int BLI_rcti_cent_x(const struct rcti *rct) { return (rct->xmin + rct->xmax) / 2; }