Deprecate 'nativeonly', fix passing garbage data for vec4 stdin

This commit is contained in:
Jarcode
2019-03-12 12:35:46 -07:00
parent b37ab5ba09
commit c485d80013
3 changed files with 10 additions and 5 deletions

View File

@@ -922,6 +922,7 @@ struct renderer* rd_new(const char** paths, const char* entry,
{
.name = "nativeonly", .fmt = "b",
.handler = RHANDLER(name, args, {
fprintf(stderr, "WARNING: `nativeonly` is deprecated, use `#if PREMULTIPLY_ALPHA == 1`!\n");
if (current)
current->nativeonly = *(bool*) args[0];
else {
@@ -1698,7 +1699,7 @@ bool rd_update(struct renderer* r, float* lb, float* rb, size_t bsz, bool modifi
case STDIN_TYPE_VEC4:
glUniform4f(current->stdin_uniform,
stdin_parsed.f[0], stdin_parsed.f[1],
stdin_parsed.f[2], stdin_parsed.f[4]);
stdin_parsed.f[2], stdin_parsed.f[3]);
break;
default: break;
}

View File

@@ -11,14 +11,16 @@
#define BAR_OUTLINE_WIDTH 0
/* Amplify magnitude of the results each bar displays */
#define AMPLIFY 300
/* Alpha channel for bars color */
#define ALPHA 0.7
/* Whether the current settings use the alpha channel;
enabling this is required for alpha to function
correctly on X11 with `"native"` transparency. */
#define USE_ALPHA 0
/* How strong the gradient changes */
#define GRADIENT_POWER 60
/* Bar color changes with height */
#define GRADIENT (d / GRADIENT_POWER + 1)
/* Bar color */
#define COLOR (#3366b2 * GRADIENT * ALPHA)
#define COLOR (#3366b2 * GRADIENT)
/* Direction that the bars are facing, 0 for inward, 1 for outward */
#define DIRECTION 0
/* Whether to switch left/right audio buffers */

View File

@@ -1,5 +1,7 @@
#request nativeonly true
#if PREMULTIPLY_ALPHA == 0
#error __distablestage
#endif
#request uniform "prev" tex
uniform sampler2D tex;