Fixed invert default behaviour for radial, closes #111

This commit is contained in:
Jarcode
2019-04-02 18:47:04 -07:00
parent a15292be64
commit bf2c5cfcbd
3 changed files with 3 additions and 3 deletions

View File

@@ -182,7 +182,7 @@ static const char* help_str =
" appropriate backend will be used for the underlying windowing\n" " appropriate backend will be used for the underlying windowing\n"
" system.\n" " system.\n"
"-a, --audio=BACKEND specifies an audio input backend to use.\n" "-a, --audio=BACKEND specifies an audio input backend to use.\n"
"-p, --pipe=[BIND[:TYPE]] binds value(s) to be read from stdin. The input my be read using\n" "-p, --pipe[=BIND[:TYPE]] binds value(s) to be read from stdin. The input my be read using\n"
" `@name` or `@name:default` syntax within shader sources.\n" " `@name` or `@name:default` syntax within shader sources.\n"
" A stream of inputs (each overriding the previous) must be\n" " A stream of inputs (each overriding the previous) must be\n"
" assigned with the `name = value` syntax and separated by\n" " assigned with the `name = value` syntax and separated by\n"

View File

@@ -19,7 +19,7 @@
#define COLOR (#cc3333 * ((d / 40) + 1)) #define COLOR (#cc3333 * ((d / 40) + 1))
/* Angle (in radians) for how much to rotate the visualizer */ /* Angle (in radians) for how much to rotate the visualizer */
#define ROTATE (PI / 2) #define ROTATE (PI / 2)
/* Whether to switch left/right audio buffers */ /* Whether to swap left/right audio buffers, set to 1 to enable */
#define INVERT 0 #define INVERT 0
/* Aliasing factors. Higher values mean more defined and jagged lines. /* Aliasing factors. Higher values mean more defined and jagged lines.
Note: aliasing does not have a notable impact on performance, but requires Note: aliasing does not have a notable impact on performance, but requires

View File

@@ -64,7 +64,7 @@ void main() {
float dir = mod(abs(idx), TWOPI); /* absolute position, [0, 2pi) */ float dir = mod(abs(idx), TWOPI); /* absolute position, [0, 2pi) */
if (dir > PI) if (dir > PI)
idx = -sign(idx) * (TWOPI - dir); /* Re-correct position values to [-pi, pi) */ idx = -sign(idx) * (TWOPI - dir); /* Re-correct position values to [-pi, pi) */
if (INVERT > 0) #if INVERT == 0
idx = -idx; /* Invert if needed */ idx = -idx; /* Invert if needed */
float pos = int(abs(idx) / section) / float(NBARS / 2); /* bar position, [0, 1) */ float pos = int(abs(idx) / section) / float(NBARS / 2); /* bar position, [0, 1) */
#define smooth_f(tex) smooth_audio(tex, audio_sz, pos) /* smooth function format */ #define smooth_f(tex) smooth_audio(tex, audio_sz, pos) /* smooth function format */