🎉 Add test mode

This commit is contained in:
Simon Schneegans
2022-03-03 20:00:24 +01:00
parent 59c01999b2
commit 69aadfd643
7 changed files with 43 additions and 10 deletions
+5 -1
View File
@@ -150,6 +150,9 @@ if (utils.isInShellProcess()) {
epicenterY = localY / actor.height;
}
// If we are currently performing integration test, the animation uses a fixed seed.
const testMode = settings.get_boolean('test-mode');
this.set_shader_source(`
// Inject some common shader snippets.
@@ -157,7 +160,8 @@ if (utils.isInShellProcess()) {
uniform sampler2D uShardTexture;
const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
${testMode ? 0 : Math.random()});
const float SHARD_SCALE = ${settings.get_double('broken-glass-scale')};
const float SHARD_LAYERS = 5;
const float BLOW_FORCE = ${settings.get_double('broken-glass-blow-force')};
+5 -1
View File
@@ -117,6 +117,9 @@ if (utils.isInShellProcess()) {
const color = Clutter.Color.from_string(settings.get_string('energize-a-color'))[1];
// If we are currently performing integration test, the animation uses a fixed seed.
const testMode = settings.get_boolean('test-mode');
this.set_shader_source(`
// Inject some common shader snippets.
@@ -124,7 +127,8 @@ if (utils.isInShellProcess()) {
${shaderSnippets.noise()}
${shaderSnippets.edgeMask()}
const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
${testMode ? 0 : Math.random()});
const float FADE_IN_TIME = 0.3;
const float FADE_OUT_TIME = 0.6;
const float HEART_FADE_TIME = 0.3;
+5 -1
View File
@@ -117,6 +117,9 @@ if (utils.isInShellProcess()) {
const color = Clutter.Color.from_string(settings.get_string('energize-b-color'))[1];
// If we are currently performing integration test, the animation uses a fixed seed.
const testMode = settings.get_boolean('test-mode');
this.set_shader_source(`
// Inject some common shader snippets.
@@ -124,7 +127,8 @@ if (utils.isInShellProcess()) {
${shaderSnippets.noise()}
${shaderSnippets.edgeMask()}
const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
${testMode ? 0 : Math.random()});
const float SHOWER_TIME = 0.3;
const float SHOWER_WIDTH = 0.3;
const float STREAK_TIME = 0.6;
+5 -1
View File
@@ -132,6 +132,9 @@ if (utils.isInShellProcess()) {
const color =
Clutter.Color.from_string(settings.get_string('claw-scratch-color'))[1];
// If we are currently performing integration test, the animation uses a fixed seed.
const testMode = settings.get_boolean('test-mode');
this.set_shader_source(`
// Inject some common shader snippets.
@@ -141,7 +144,8 @@ if (utils.isInShellProcess()) {
// See assets/README.md for how this texture was created.
uniform sampler2D uClawTexture;
const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
${testMode ? 0 : Math.random()});
const float CLAW_SIZE = ${settings.get_double('claw-scratch-scale')};
const float NUM_CLAWS = ${settings.get_int('claw-scratch-count')};
const float WARP_INTENSITY = 1.0 + ${settings.get_double('claw-scratch-warp')};
+5 -1
View File
@@ -118,6 +118,9 @@ if (utils.isInShellProcess()) {
const color = Clutter.Color.from_string(settings.get_string('wisps-color'))[1];
// If we are currently performing integration test, the animation uses a fixed seed.
const testMode = settings.get_boolean('test-mode');
this.set_shader_source(`
// Inject some common shader snippets.
@@ -125,7 +128,8 @@ if (utils.isInShellProcess()) {
${shaderSnippets.noise()}
${shaderSnippets.edgeMask()}
const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
${testMode ? 0 : Math.random()});
const float WISPS_RADIUS = 20.0;
const float WISPS_SPEED = 10.0;
const float WISPS_SPACING = 40 + WISPS_RADIUS;