Cleanup: clarify ED_markers_make_cfra_list only selected argument
The argument read as if it might be a flag (callers passed in SELECT), but it was in fact used as a boolean.
This commit is contained in:
@@ -257,12 +257,12 @@ static bool region_position_is_over_marker(View2D *v2d, ListBase *markers, float
|
||||
/* --------------------------------- */
|
||||
|
||||
/* Adds a marker to list of cfra elems */
|
||||
static void add_marker_to_cfra_elem(ListBase *lb, TimeMarker *marker, short only_sel)
|
||||
static void add_marker_to_cfra_elem(ListBase *lb, TimeMarker *marker, const bool only_selected)
|
||||
{
|
||||
CfraElem *ce, *cen;
|
||||
|
||||
/* should this one only be considered if it is selected? */
|
||||
if ((only_sel) && ((marker->flag & SELECT) == 0)) {
|
||||
if (only_selected && ((marker->flag & SELECT) == 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ static void add_marker_to_cfra_elem(ListBase *lb, TimeMarker *marker, short only
|
||||
cen->sel = marker->flag;
|
||||
}
|
||||
|
||||
void ED_markers_make_cfra_list(ListBase *markers, ListBase *lb, short only_sel)
|
||||
void ED_markers_make_cfra_list(ListBase *markers, ListBase *lb, const bool only_selected)
|
||||
{
|
||||
if (lb) {
|
||||
/* Clear the list first, since callers have no way of knowing
|
||||
@@ -310,7 +310,7 @@ void ED_markers_make_cfra_list(ListBase *markers, ListBase *lb, short only_sel)
|
||||
}
|
||||
|
||||
LISTBASE_FOREACH (TimeMarker *, marker, markers) {
|
||||
add_marker_to_cfra_elem(lb, marker, only_sel);
|
||||
add_marker_to_cfra_elem(lb, marker, only_selected);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1765,7 +1765,7 @@ static float find_last_key(ListBase *pflinks)
|
||||
static void get_selected_marker_positions(Scene *scene, ListBase /*FrameLink*/ *target_frames)
|
||||
{
|
||||
ListBase selected_markers = {nullptr, nullptr};
|
||||
ED_markers_make_cfra_list(&scene->markers, &selected_markers, SELECT);
|
||||
ED_markers_make_cfra_list(&scene->markers, &selected_markers, true);
|
||||
LISTBASE_FOREACH (CfraElem *, marker, &selected_markers) {
|
||||
FrameLink *link = static_cast<FrameLink *>(MEM_callocN(sizeof(FrameLink), "Marker Key Link"));
|
||||
link->frame = marker->cfra;
|
||||
|
||||
@@ -74,7 +74,7 @@ void ED_markers_get_minmax(ListBase *markers, short sel, float *r_first, float *
|
||||
* argument is used to specify whether only the selected markers
|
||||
* are added.
|
||||
*/
|
||||
void ED_markers_make_cfra_list(ListBase *markers, ListBase *lb, short only_sel);
|
||||
void ED_markers_make_cfra_list(ListBase *markers, ListBase *lb, bool only_selected);
|
||||
|
||||
void ED_markers_deselect_all(ListBase *markers, int action);
|
||||
|
||||
|
||||
@@ -1200,7 +1200,7 @@ static void columnselect_action_keys(bAnimContext *ac, short mode)
|
||||
break;
|
||||
|
||||
case ACTKEYS_COLUMNSEL_MARKERS_COLUMN: /* list of selected markers */
|
||||
ED_markers_make_cfra_list(ac->markers, &ked.list, SELECT);
|
||||
ED_markers_make_cfra_list(ac->markers, &ked.list, true);
|
||||
break;
|
||||
|
||||
default: /* invalid option */
|
||||
|
||||
@@ -1252,7 +1252,7 @@ static void columnselect_graph_keys(bAnimContext *ac, short mode)
|
||||
break;
|
||||
|
||||
case GRAPHKEYS_COLUMNSEL_MARKERS_COLUMN: /* list of selected markers */
|
||||
ED_markers_make_cfra_list(ac->markers, &ked.list, SELECT);
|
||||
ED_markers_make_cfra_list(ac->markers, &ked.list, true);
|
||||
break;
|
||||
|
||||
default: /* invalid option */
|
||||
|
||||
Reference in New Issue
Block a user