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>2012-10-23 20:21:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-23 20:21:55 +0400
commitfec81d9b56075f46f6dde196ac85140872cff74e (patch)
tree6ee12fcc0b04ba3041f1b7e4d17281136375beb1 /source/blender/blenkernel
parentc623ba5e4b2aa68a5717ba17500c14217bc417aa (diff)
use min_ max_ functions in more places.
also fix minor error in MOD decimate when the modifier did nothing the reported face count would be wrong.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/action.c8
-rw-r--r--source/blender/blenkernel/intern/mask_evaluate.c2
-rw-r--r--source/blender/blenkernel/intern/sequencer.c8
-rw-r--r--source/blender/blenkernel/intern/tracking.c12
4 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index aee7714538f..e95451252d0 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -906,8 +906,8 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_
calc_fcurve_range(fcu, &nmin, &nmax, FALSE, TRUE);
/* compare to the running tally */
- min = MIN2(min, nmin);
- max = MAX2(max, nmax);
+ min = min_ff(min, nmin);
+ max = max_ff(max, nmax);
foundvert = 1;
}
@@ -925,10 +925,10 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_
FMod_Limits *fmd = (FMod_Limits *)fcm->data;
if (fmd->flag & FCM_LIMIT_XMIN) {
- min = MIN2(min, fmd->rect.xmin);
+ min = min_ff(min, fmd->rect.xmin);
}
if (fmd->flag & FCM_LIMIT_XMAX) {
- max = MAX2(max, fmd->rect.xmax);
+ max = max_ff(max, fmd->rect.xmax);
}
}
break;
diff --git a/source/blender/blenkernel/intern/mask_evaluate.c b/source/blender/blenkernel/intern/mask_evaluate.c
index 50be5b8a112..e67df9c6419 100644
--- a/source/blender/blenkernel/intern/mask_evaluate.c
+++ b/source/blender/blenkernel/intern/mask_evaluate.c
@@ -131,7 +131,7 @@ unsigned int BKE_mask_spline_feather_resolution(MaskSpline *spline, int width, i
if (u_diff > FLT_EPSILON) {
float jump = fabsf(w_diff / u_diff);
- max_jump = MAX2(max_jump, jump);
+ max_jump = max_ff(max_jump, jump);
}
prev_u = point->uw[j].u;
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index e52fa3498a9..cf8569ec3d8 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -2826,7 +2826,7 @@ ImBuf *BKE_sequencer_give_ibuf(SeqRenderData context, float cfra, int chanshown)
count = BLI_countlist(&ed->metastack);
if ((chanshown < 0) && (count > 0)) {
- count = MAX2(count + chanshown, 0);
+ count = max_ii(count + chanshown, 0);
seqbasep = ((MetaStack *)BLI_findlink(&ed->metastack, count))->oldbasep;
}
else {
@@ -3458,7 +3458,7 @@ int BKE_sequence_base_shuffle(ListBase *seqbasep, Sequence *test, Scene *evil_sc
for (seq = seqbasep->first; seq; seq = seq->next) {
if (seq->machine == orig_machine)
- new_frame = MAX2(new_frame, seq->enddisp);
+ new_frame = max_ii(new_frame, seq->enddisp);
}
test->machine = orig_machine;
@@ -3483,10 +3483,10 @@ static int shuffle_seq_time_offset_test(ListBase *seqbasep, char dir)
for (seq_other = seqbasep->first; seq_other; seq_other = seq_other->next) {
if (!seq_other->tmp && seq_overlap(seq, seq_other)) {
if (dir == 'L') {
- offset = MIN2(offset, seq_other->startdisp - seq->enddisp);
+ offset = min_ii(offset, seq_other->startdisp - seq->enddisp);
}
else {
- offset = MAX2(offset, seq_other->enddisp - seq->startdisp);
+ offset = max_ii(offset, seq_other->enddisp - seq->startdisp);
}
}
}
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 4fcaed66f6b..e6904a23d51 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -221,7 +221,7 @@ void BKE_tracking_get_projection_matrix(MovieTracking *tracking, MovieTrackingOb
float viewfac, pixsize, left, right, bottom, top, clipsta, clipend;
float winmat[4][4];
float ycor = 1.0f / tracking->camera.pixel_aspect;
- float shiftx, shifty, winside = MAX2(winx, winy);
+ float shiftx, shifty, winside = (float)min_ii(winx, winy);
BKE_tracking_camera_shift_get(tracking, winx, winy, &shiftx, &shifty);
@@ -2848,10 +2848,10 @@ MovieReconstructContext *BKE_tracking_reconstruction_context_new(MovieTracking *
}
if (first < track->markersnr - 1)
- sfra = MIN2(sfra, first_marker->framenr);
+ sfra = min_ii(sfra, first_marker->framenr);
if (last >= 0)
- efra = MAX2(efra, last_marker->framenr);
+ efra = max_ii(efra, last_marker->framenr);
tracks_map_insert(context->tracks_map, track, NULL);
@@ -3198,8 +3198,8 @@ static float stabilization_calculate_autoscale_factor(MovieTracking *tracking, i
if (track->flag & TRACK_USE_2D_STAB ||
((stab->flag & TRACKING_STABILIZE_ROTATION) && track == stab->rot_track))
{
- sfra = MIN2(sfra, track->markers[0].framenr);
- efra = MAX2(efra, track->markers[track->markersnr - 1].framenr);
+ sfra = min_ii(sfra, track->markers[0].framenr);
+ efra = max_ii(efra, track->markers[track->markersnr - 1].framenr);
}
track = track->next;
@@ -3643,7 +3643,7 @@ static void channels_segments_calc(MovieTrackingDopesheetChannel *channel)
channel->segments[2 * segment] = start_marker->framenr;
channel->segments[2 * segment + 1] = start_marker->framenr + len;
- channel->max_segment = MAX2(channel->max_segment, len);
+ channel->max_segment = max_ii(channel->max_segment, len);
segment++;
}