From d6a67480c749ea554447795158a62f1b0330b6a4 Mon Sep 17 00:00:00 2001 From: Ed Kelly Date: Tue, 7 Feb 2006 15:35:26 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r4564, which included commits to RCS files with non-trunk default branches. svn path=/trunk/externals/ekext/; revision=4565 --- zeroxpos~/zeroxpos~.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'zeroxpos~/zeroxpos~.c') diff --git a/zeroxpos~/zeroxpos~.c b/zeroxpos~/zeroxpos~.c index adccc14..d6c15c5 100644 --- a/zeroxpos~/zeroxpos~.c +++ b/zeroxpos~/zeroxpos~.c @@ -29,34 +29,28 @@ t_int *zeroxpos_tilde_perform(t_int *w) int i = 0; x->i_pol = 0; x->i_ndx = -1; - int prev = ctl->final_pol; + int prev = ctl->final_pol == 0 ? in[0] : ctl->final_pol; for(i=0;i= 0 ? 1 : -1; - while(i>0) + if((polarity < prev || polarity > prev) && count == number && x->i_bang == 1) { - if((polarity < prev || polarity > prev) && count == number && x->i_bang == 1) - { - x->i_ndx = i; - x->i_pol = polarity; - count++; - x->i_bang = 0; - } - if((polarity < prev || polarity > prev) && count < number) - { - count++; - } - if(i==n-1) - { - ctl->final_pol = polarity; - x->i_count = count; - } + x->i_ndx = i; + x->i_pol = polarity; + count += 1e+06; + x->i_bang = 0; + outlet_float(x->f_pol, (float)x->i_pol); + outlet_float(x->f_pos, (float)x->i_ndx); + } + if((polarity < prev || polarity > prev) && count < number) count++; + if(i==n-1) + { + ctl->final_pol = polarity; + x->i_count = count; } prev = polarity; } - outlet_float(x->f_pol, (float)x->i_pol); - outlet_float(x->f_pos, (float)x->i_ndx); return(w+4); } -- cgit v1.2.1