| VarStruct varstr[]= { {LABEL|FLO,"led VX.X bb ",0, 0, 0, ""}, {NUM|INT, "Digits", 4.0, 1., 8, "No. of digits"}, {NUM|INT, "Thickness", 1.0, 0., 2.0, "Thickness of the segments"}, {NUM|FLO, "Skew", 0.1, 0., 0.5, "Skew of the digits"}, {NUM|FLO, "Size", 1.0, 0.01, 100, "Size of the digits"}, {NUM|FLO, "Light", 1.0, 0., 1., "Value for active segments"}, {NUM|FLO, "Dark", 0.0, 0., 1., "Value for inactive segments"}, {NUM|INT, "Value", 8888, 0, 99999999., "Value to display"}, {NUM|INT, "LZeros", 8.0, 0., 8., "Display leading zeros"}, {TOG|INT, "12/24", 0.0, 0.0, 1.0, "Change mode from 12h to 24h"}, {NUM|FLO, "Delta", 0.0, -10000.,10000., "Change per Frame"}, {TOG|INT, "Invert", 0.0, 0.0, 1.0, "Change mode from delta*frame to frames/delta"}, {TOG|INT, "No AAlias", 0.0, 0.0, 1.0, "Turn antialias off (independent from render settings)"}, }; |
| /* The cast struct is for input in the main doit function Varstr and Cast must have the same variables in the same order */ typedef struct Cast { float dummy; int digits; int thickness; float skew; float size; float light; float dark; int value; int zeros; int m_12_24; float delta; int invert; int noaalias; } Cast; |
| void calc_value(int stype,Cast *cast,float x,float y) { int val=cast->value,i,delta; int digit; int zeros=cast->zeros; float space=1.3; if (cast->invert && fabs(cast->delta)>EPS) delta=(int)(cfra/cast->delta); else delta=(int)(cfra*cast->delta); if (stype==COUNTER) { val+=delta; } else { int h,m,s; ..... |