Cleanup: use enum typedef for manipulator drawstep
This commit is contained in:
@@ -206,7 +206,8 @@ struct wmManipulatorMap *WM_manipulatormap_new_from_type(
|
||||
const struct wmManipulatorMapType_Params *mmap_params);
|
||||
const struct ListBase *WM_manipulatormap_group_list(struct wmManipulatorMap *mmap);
|
||||
void WM_manipulatormap_tag_refresh(struct wmManipulatorMap *mmap);
|
||||
void WM_manipulatormap_draw(struct wmManipulatorMap *mmap, const struct bContext *C, const int drawstep);
|
||||
void WM_manipulatormap_draw(
|
||||
struct wmManipulatorMap *mmap, const struct bContext *C, const eWM_ManipulatorMapDrawStep drawstep);
|
||||
void WM_manipulatormap_add_handlers(struct ARegion *ar, struct wmManipulatorMap *mmap);
|
||||
bool WM_manipulatormap_select_all(struct bContext *C, struct wmManipulatorMap *mmap, const int action);
|
||||
bool WM_manipulatormap_cursor_set(const struct wmManipulatorMap *mmap, struct wmWindow *win);
|
||||
|
||||
@@ -367,7 +367,7 @@ typedef struct wmManipulatorGroup {
|
||||
/**
|
||||
* Pass a value of this enum to #WM_manipulatormap_draw to tell it what to draw.
|
||||
*/
|
||||
enum {
|
||||
typedef enum eWM_ManipulatorMapDrawStep {
|
||||
/* Draw 2D manipulator-groups (ManipulatorGroupType.is_3d == false) */
|
||||
WM_MANIPULATORMAP_DRAWSTEP_2D = 0,
|
||||
/* Draw 3D manipulator-groups (ManipulatorGroupType.is_3d == true) */
|
||||
@@ -375,6 +375,6 @@ enum {
|
||||
/* Draw only depth culled manipulators (WM_MANIPULATOR_SCENE_DEPTH flag).
|
||||
* Note that these are expected to be 3D manipulators too. */
|
||||
WM_MANIPULATORMAP_DRAWSTEP_IN_SCENE,
|
||||
};
|
||||
} eWM_ManipulatorMapDrawStep;
|
||||
|
||||
#endif /* __WM_MANIPULATOR_TYPES_H__ */
|
||||
|
||||
@@ -200,7 +200,8 @@ bool wm_manipulatorgroup_is_visible(const wmManipulatorGroup *mgroup, const bCon
|
||||
return (!mgroup->type->poll || mgroup->type->poll(C, mgroup->type));
|
||||
}
|
||||
|
||||
bool wm_manipulatorgroup_is_visible_in_drawstep(const wmManipulatorGroup *mgroup, const int drawstep)
|
||||
bool wm_manipulatorgroup_is_visible_in_drawstep(
|
||||
const wmManipulatorGroup *mgroup, const eWM_ManipulatorMapDrawStep drawstep)
|
||||
{
|
||||
switch (drawstep) {
|
||||
case WM_MANIPULATORMAP_DRAWSTEP_2D:
|
||||
|
||||
@@ -76,7 +76,8 @@ void wm_manipulatorgroup_intersectable_manipulators_to_list(
|
||||
const struct wmManipulatorGroup *mgroup, struct ListBase *listbase);
|
||||
void wm_manipulatorgroup_ensure_initialized(struct wmManipulatorGroup *mgroup, const struct bContext *C);
|
||||
bool wm_manipulatorgroup_is_visible(const struct wmManipulatorGroup *mgroup, const struct bContext *C);
|
||||
bool wm_manipulatorgroup_is_visible_in_drawstep(const struct wmManipulatorGroup *mgroup, const int drawstep);
|
||||
bool wm_manipulatorgroup_is_visible_in_drawstep(
|
||||
const struct wmManipulatorGroup *mgroup, const eWM_ManipulatorMapDrawStep drawstep);
|
||||
|
||||
void wm_manipulatorgrouptype_setup_keymap(
|
||||
struct wmManipulatorGroupType *wgt, struct wmKeyConfig *keyconf);
|
||||
|
||||
@@ -294,7 +294,8 @@ static bool manipulator_prepare_drawing(
|
||||
* should be drawn to list \a draw_manipulators, note that added items need freeing.
|
||||
*/
|
||||
static void manipulatormap_prepare_drawing(
|
||||
wmManipulatorMap *mmap, const bContext *C, ListBase *draw_manipulators, const int drawstep)
|
||||
wmManipulatorMap *mmap, const bContext *C, ListBase *draw_manipulators,
|
||||
const eWM_ManipulatorMapDrawStep drawstep)
|
||||
{
|
||||
if (!mmap || BLI_listbase_is_empty(&mmap->groups))
|
||||
return;
|
||||
@@ -401,7 +402,9 @@ static void manipulators_draw_list(const wmManipulatorMap *mmap, const bContext
|
||||
}
|
||||
}
|
||||
|
||||
void WM_manipulatormap_draw(wmManipulatorMap *mmap, const bContext *C, const int drawstep)
|
||||
void WM_manipulatormap_draw(
|
||||
wmManipulatorMap *mmap, const bContext *C,
|
||||
const eWM_ManipulatorMapDrawStep drawstep)
|
||||
{
|
||||
ListBase draw_manipulators = {NULL};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user