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

View File

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