[Bf-blender-cvs] [81f23ad57a0] master: Cleanup: Move tracking constants to be printable enums
Sergey Sharybin
noreply at git.blender.org
Thu May 12 11:37:09 CEST 2022
Commit: 81f23ad57a0156ee8fed44e372ff81d69d022e7b
Author: Sergey Sharybin
Date: Thu May 12 10:04:02 2022 +0200
Branches: master
https://developer.blender.org/rB81f23ad57a0156ee8fed44e372ff81d69d022e7b
Cleanup: Move tracking constants to be printable enums
Replace old-style define with an enumerator values. Also move to the
top of the file preparing for making those stronger typed.
===================================================================
M source/blender/blenkernel/BKE_tracking.h
===================================================================
diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h
index 2d115cfb351..c6388c186f0 100644
--- a/source/blender/blenkernel/BKE_tracking.h
+++ b/source/blender/blenkernel/BKE_tracking.h
@@ -28,6 +28,32 @@ struct Scene;
struct bGPDlayer;
struct rcti;
+/* --------------------------------------------------------------------
+ * Common types and constants.
+ */
+
+enum {
+ TRACK_CLEAR_UPTO = 0,
+ TRACK_CLEAR_REMAINED = 1,
+ TRACK_CLEAR_ALL = 2,
+};
+
+enum {
+ CLAMP_PAT_DIM = 1,
+ CLAMP_PAT_POS = 2,
+ CLAMP_SEARCH_DIM = 3,
+ CLAMP_SEARCH_POS = 4,
+};
+
+typedef enum eTrackArea {
+ TRACK_AREA_POINT = (1 << 0),
+ TRACK_AREA_PAT = (1 << 1),
+ TRACK_AREA_SEARCH = (1 << 2),
+
+ TRACK_AREA_NONE = 0,
+ TRACK_AREA_ALL = (TRACK_AREA_POINT | TRACK_AREA_PAT | TRACK_AREA_SEARCH),
+} eTrackArea;
+
/* --------------------------------------------------------------------
* Common functions.
*/
@@ -787,22 +813,6 @@ void BKE_tracking_get_rna_path_prefix_for_plane_track(
(((marker)->flag & MARKER_DISABLED) == 0 || ((sc)->flag & SC_HIDE_DISABLED) == 0 || \
((sc)->clip->tracking.act_track == track))
-#define TRACK_CLEAR_UPTO 0
-#define TRACK_CLEAR_REMAINED 1
-#define TRACK_CLEAR_ALL 2
-
-#define CLAMP_PAT_DIM 1
-#define CLAMP_PAT_POS 2
-#define CLAMP_SEARCH_DIM 3
-#define CLAMP_SEARCH_POS 4
-
-#define TRACK_AREA_NONE -1
-#define TRACK_AREA_POINT 1
-#define TRACK_AREA_PAT 2
-#define TRACK_AREA_SEARCH 4
-
-#define TRACK_AREA_ALL (TRACK_AREA_POINT | TRACK_AREA_PAT | TRACK_AREA_SEARCH)
-
#ifdef __cplusplus
}
#endif
More information about the Bf-blender-cvs
mailing list