diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-07-01 18:32:56 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-07-01 18:33:10 +0300 |
commit | 6781cf0049bf2297eadb264227fb9a84e79ecf46 (patch) | |
tree | b1089484f44e769aab76dc36d0bf5dd54eccea07 | |
parent | 607dca070587f4d8bc4afa3c4a49e0f9a74873cd (diff) |
Refactoring:
Make sure SEQ_TYPE_EFFECT is only used as a flag, not as number
comparison.
This should allow us to add new non-effect types in between
effect types (every 8 indices).
Dirty, but alternative of separating type/subtype means we lose
forward compatibility.
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 18 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tree.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 2 |
3 files changed, 10 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 19124ddc549..6b6839d870a 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -1125,7 +1125,7 @@ const char *BKE_sequence_give_name(Sequence *seq) const char *name = give_seqname_by_type(seq->type); if (!name) { - if (seq->type < SEQ_TYPE_EFFECT) { + if (!(seq->type & SEQ_TYPE_EFFECT)) { return seq->strip->dir; } else { @@ -4214,7 +4214,7 @@ void BKE_sequence_single_fix(Sequence *seq) bool BKE_sequence_tx_test(Sequence *seq) { - return (seq->type < SEQ_TYPE_EFFECT) || (BKE_sequence_effect_get_num_inputs(seq->type) == 0); + return !(seq->type & SEQ_TYPE_EFFECT) || (BKE_sequence_effect_get_num_inputs(seq->type) == 0); } static bool seq_overlap(Sequence *seq1, Sequence *seq2) @@ -5237,13 +5237,11 @@ static Sequence *seq_dupli(Scene *scene, Scene *scene_to, Sequence *seq, int dup seqn->strip->stripdata = MEM_dupallocN(seq->strip->stripdata); } - else if (seq->type >= SEQ_TYPE_EFFECT) { - if (seq->type & SEQ_TYPE_EFFECT) { - struct SeqEffectHandle sh; - sh = BKE_sequence_get_effect(seq); - if (sh.copy) - sh.copy(seq, seqn); - } + else if (seq->type & SEQ_TYPE_EFFECT) { + struct SeqEffectHandle sh; + sh = BKE_sequence_get_effect(seq); + if (sh.copy) + sh.copy(seq, seqn); seqn->strip->stripdata = NULL; @@ -5266,7 +5264,7 @@ static void seq_new_fix_links_recursive(Sequence *seq) { SequenceModifierData *smd; - if (seq->type >= SEQ_TYPE_EFFECT) { + if (seq->type & SEQ_TYPE_EFFECT) { if (seq->seq1 && seq->seq1->tmp) seq->seq1 = seq->seq1->tmp; if (seq->seq2 && seq->seq2->tmp) seq->seq2 = seq->seq2->tmp; if (seq->seq3 && seq->seq3->tmp) seq->seq3 = seq->seq3->tmp; diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index d4bef06cca9..0c1d6318638 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -988,7 +988,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i te->directdata = seq; te->name = seq->name + 2; - if (seq->type < SEQ_TYPE_EFFECT) { + if (!(seq->type & SEQ_TYPE_EFFECT)) { /* * This work like the sequence. * If the sequence have a name (not default name) diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 27eb28bec8f..38107fa69cb 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -395,7 +395,7 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, const float handsize_cla } /* draw! */ - if (seq->type < SEQ_TYPE_EFFECT || + if (!(seq->type & SEQ_TYPE_EFFECT) || BKE_sequence_effect_get_num_inputs(seq->type) == 0) { glEnable(GL_BLEND); |