Skip to content

Commit

Permalink
transition: avoid opacity change for fly-out/slide-out presets
Browse files Browse the repository at this point in the history
Set opacity to window-raw-opacity-before instead of to 1.

Signed-off-by: Yuxuan Shui <[email protected]>
  • Loading branch information
yshui committed Oct 10, 2024
1 parent b631485 commit 8e75ac6
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 64 deletions.
19 changes: 12 additions & 7 deletions data/animation_presets.conf
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ slide-out = {
crop-y = "window-y";
crop-width = "window-width";
crop-height = "window-height";
opacity = 1;
opacity = {
start = "window-raw-opacity-before";
end = "window-raw-opacity-before";
duration = "placeholder0";
};
blur-opacity = "opacity";
shadow-opacity = "opacity";
*knobs = {
Expand Down Expand Up @@ -124,9 +128,13 @@ fly-out = {
offset-y = "v-timing * (1 - placeholder3)";
shadow-offset-x = "offset-x";
shadow-offset-y = "offset-y";
opacity = 1;
shadow-opacity = 1;
blur-opacity = 1;
opacity = {
start = "window-raw-opacity-before";
end = "window-raw-opacity-before";
duration = "placeholder0";
};
shadow-opacity = "opacity";
blur-opacity = "opacity";
*knobs = {
duration = 0.2;
direction = (0, ["up", "down", "left", "right"]);
Expand All @@ -151,9 +159,6 @@ fly-in = {
offset-y = "v-timing * (1 - placeholder3)";
shadow-offset-x = "offset-x";
shadow-offset-y = "offset-y";
opacity = 1;
shadow-opacity = 1;
blur-opacity = 1;
*knobs = {
duration = 0.2;
direction = (0, ["up", "down", "left", "right"]);
Expand Down
152 changes: 95 additions & 57 deletions src/transition/generated/script_templates.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ static bool win_script_preset__appear(struct win_script *output, config_setting_
}
static struct script *script_template__slide_out(int *output_slots) {
static const struct instruction instrs[] = {
{.type = INST_BRANCH_ONCE, .rel = 42},
{.type = INST_BRANCH_ONCE, .rel = 55},
{.type = INST_LOAD, .slot = 15},
{.type = INST_LOAD, .slot = 14},
{.type = INST_OP, .op = OP_SUB},
Expand Down Expand Up @@ -490,11 +490,27 @@ static struct script *script_template__slide_out(int *output_slots) {
{.type = INST_STORE, .slot = 7},
{.type = INST_LOAD_CTX, .ctx = 24},
{.type = INST_STORE, .slot = 8},
{.type = INST_LOAD, .slot = 18},
{.type = INST_LOAD, .slot = 17},
{.type = INST_OP, .op = OP_SUB},
{.type = INST_LOAD, .slot = 12},
{.type = INST_IMM, .imm = 0x0p+0},
{.type = INST_OP, .op = OP_SUB},
{.type = INST_LOAD, .slot = 19},
{.type = INST_OP, .op = OP_DIV},
{
.type = INST_CURVE,
.curve = {.type = CURVE_LINEAR},
},
{.type = INST_OP, .op = OP_MUL},
{.type = INST_LOAD, .slot = 17},
{.type = INST_OP, .op = OP_ADD},
{.type = INST_STORE, .slot = 9},
{.type = INST_LOAD, .slot = 9},
{.type = INST_STORE, .slot = 10},
{.type = INST_LOAD, .slot = 9},
{.type = INST_STORE, .slot = 11},
{.type = INST_BRANCH_ONCE, .rel = 17},
{.type = INST_BRANCH_ONCE, .rel = 21},
{.type = INST_HALT},
{.type = INST_IMM, .imm = 0x0p+0},
{.type = INST_STORE_OVER_NAN, .slot = 14},
Expand All @@ -508,9 +524,13 @@ static struct script *script_template__slide_out(int *output_slots) {
{.type = INST_OP, .op = OP_MUL},
{.type = INST_OP, .op = OP_ADD},
{.type = INST_STORE, .slot = 15},
{.type = INST_IMM, .imm = 0x1p+0},
{.type = INST_STORE, .slot = 9},
{.type = INST_BRANCH, .rel = -55},
{.type = INST_LOAD_CTX, .ctx = 64},
{.type = INST_STORE_OVER_NAN, .slot = 17},
{.type = INST_LOAD_CTX, .ctx = 1073741824},
{.type = INST_STORE, .slot = 19},
{.type = INST_LOAD_CTX, .ctx = 64},
{.type = INST_STORE, .slot = 18},
{.type = INST_BRANCH, .rel = -72},
{.type = INST_IMM, .imm = 0x0p+0},
{.type = INST_STORE, .slot = 13},
{.type = INST_LOAD, .slot = 16},
Expand All @@ -519,12 +539,18 @@ static struct script *script_template__slide_out(int *output_slots) {
{.type = INST_LOAD, .slot = 13},
{.type = INST_OP, .op = OP_MAX},
{.type = INST_STORE, .slot = 13},
{.type = INST_LOAD, .slot = 19},
{.type = INST_IMM, .imm = 0x0p+0},
{.type = INST_OP, .op = OP_ADD},
{.type = INST_LOAD, .slot = 13},
{.type = INST_OP, .op = OP_MAX},
{.type = INST_STORE, .slot = 13},
{.type = INST_HALT},
};
struct script *ret = malloc(offsetof(struct script, instrs) + sizeof(instrs));
ret->len = ARR_SIZE(instrs);
ret->elapsed_slot = 12;
ret->n_slots = 17;
ret->n_slots = 20;
ret->stack_size = 3;
ret->vars = NULL;
ret->overrides = NULL;
Expand Down Expand Up @@ -606,6 +632,11 @@ static struct script *script_template__slide_out(int *output_slots) {
*override = (struct overridable_slot){.name = strdup("v-timing"), .slot = 14};
HASH_ADD_STR(ret->overrides, name, override);
}
{
struct overridable_slot *override = malloc(sizeof(*override));
*override = (struct overridable_slot){.name = strdup("opacity"), .slot = 17};
HASH_ADD_STR(ret->overrides, name, override);
}
output_slots[0] = 1;
output_slots[1] = 2;
output_slots[2] = 3;
Expand Down Expand Up @@ -872,7 +903,7 @@ static bool win_script_preset__slide_in(struct win_script *output, config_settin
}
static struct script *script_template__fly_out(int *output_slots) {
static const struct instruction instrs[] = {
{.type = INST_BRANCH_ONCE, .rel = 30},
{.type = INST_BRANCH_ONCE, .rel = 47},
{.type = INST_LOAD, .slot = 11},
{.type = INST_LOAD, .slot = 10},
{.type = INST_OP, .op = OP_SUB},
Expand Down Expand Up @@ -909,6 +940,26 @@ static struct script *script_template__fly_out(int *output_slots) {
{.type = INST_STORE, .slot = 3},
{.type = INST_LOAD, .slot = 2},
{.type = INST_STORE, .slot = 4},
{.type = INST_LOAD, .slot = 14},
{.type = INST_LOAD, .slot = 13},
{.type = INST_OP, .op = OP_SUB},
{.type = INST_LOAD, .slot = 8},
{.type = INST_IMM, .imm = 0x0p+0},
{.type = INST_OP, .op = OP_SUB},
{.type = INST_LOAD, .slot = 15},
{.type = INST_OP, .op = OP_DIV},
{
.type = INST_CURVE,
.curve = {.type = CURVE_LINEAR},
},
{.type = INST_OP, .op = OP_MUL},
{.type = INST_LOAD, .slot = 13},
{.type = INST_OP, .op = OP_ADD},
{.type = INST_STORE, .slot = 5},
{.type = INST_LOAD, .slot = 5},
{.type = INST_STORE, .slot = 6},
{.type = INST_LOAD, .slot = 5},
{.type = INST_STORE, .slot = 7},
{.type = INST_BRANCH_ONCE, .rel = 29},
{.type = INST_HALT},
{.type = INST_IMM, .imm = 0x0p+0},
Expand All @@ -931,13 +982,13 @@ static struct script *script_template__fly_out(int *output_slots) {
{.type = INST_OP, .op = OP_MUL},
{.type = INST_OP, .op = OP_ADD},
{.type = INST_STORE, .slot = 11},
{.type = INST_IMM, .imm = 0x1p+0},
{.type = INST_STORE, .slot = 5},
{.type = INST_IMM, .imm = 0x1p+0},
{.type = INST_STORE, .slot = 6},
{.type = INST_IMM, .imm = 0x1p+0},
{.type = INST_STORE, .slot = 7},
{.type = INST_BRANCH, .rel = -55},
{.type = INST_LOAD_CTX, .ctx = 64},
{.type = INST_STORE_OVER_NAN, .slot = 13},
{.type = INST_LOAD_CTX, .ctx = 1073741824},
{.type = INST_STORE, .slot = 15},
{.type = INST_LOAD_CTX, .ctx = 64},
{.type = INST_STORE, .slot = 14},
{.type = INST_BRANCH, .rel = -72},
{.type = INST_IMM, .imm = 0x0p+0},
{.type = INST_STORE, .slot = 9},
{.type = INST_LOAD, .slot = 12},
Expand All @@ -946,12 +997,18 @@ static struct script *script_template__fly_out(int *output_slots) {
{.type = INST_LOAD, .slot = 9},
{.type = INST_OP, .op = OP_MAX},
{.type = INST_STORE, .slot = 9},
{.type = INST_LOAD, .slot = 15},
{.type = INST_IMM, .imm = 0x0p+0},
{.type = INST_OP, .op = OP_ADD},
{.type = INST_LOAD, .slot = 9},
{.type = INST_OP, .op = OP_MAX},
{.type = INST_STORE, .slot = 9},
{.type = INST_HALT},
};
struct script *ret = malloc(offsetof(struct script, instrs) + sizeof(instrs));
ret->len = ARR_SIZE(instrs);
ret->elapsed_slot = 8;
ret->n_slots = 13;
ret->n_slots = 16;
ret->stack_size = 3;
ret->vars = NULL;
ret->overrides = NULL;
Expand Down Expand Up @@ -1009,6 +1066,11 @@ static struct script *script_template__fly_out(int *output_slots) {
*override = (struct overridable_slot){.name = strdup("v-timing"), .slot = 10};
HASH_ADD_STR(ret->overrides, name, override);
}
{
struct overridable_slot *override = malloc(sizeof(*override));
*override = (struct overridable_slot){.name = strdup("opacity"), .slot = 13};
HASH_ADD_STR(ret->overrides, name, override);
}
output_slots[0] = 1;
output_slots[1] = 2;
output_slots[2] = 3;
Expand Down Expand Up @@ -1088,12 +1150,12 @@ static struct script *script_template__fly_in(int *output_slots) {
static const struct instruction instrs[] = {
{.type = INST_BRANCH_ONCE, .rel = 30},
{.type = INST_IMM, .imm = 0x0p+0},
{.type = INST_LOAD, .slot = 10},
{.type = INST_LOAD, .slot = 7},
{.type = INST_OP, .op = OP_SUB},
{.type = INST_LOAD, .slot = 8},
{.type = INST_LOAD, .slot = 5},
{.type = INST_IMM, .imm = 0x0p+0},
{.type = INST_OP, .op = OP_SUB},
{.type = INST_LOAD, .slot = 11},
{.type = INST_LOAD, .slot = 8},
{.type = INST_OP, .op = OP_DIV},
{
.type = INST_CURVE,
Expand All @@ -1106,7 +1168,7 @@ static struct script *script_template__fly_in(int *output_slots) {
.cy = 0x1.0147ae147ae16p+1}},
},
{.type = INST_OP, .op = OP_MUL},
{.type = INST_LOAD, .slot = 10},
{.type = INST_LOAD, .slot = 7},
{.type = INST_OP, .op = OP_ADD},
{.type = INST_STORE, .slot = 0},
{.type = INST_LOAD, .slot = 0},
Expand All @@ -1123,7 +1185,7 @@ static struct script *script_template__fly_in(int *output_slots) {
{.type = INST_STORE, .slot = 3},
{.type = INST_LOAD, .slot = 2},
{.type = INST_STORE, .slot = 4},
{.type = INST_BRANCH_ONCE, .rel = 27},
{.type = INST_BRANCH_ONCE, .rel = 21},
{.type = INST_HALT},
{.type = INST_LOAD_CTX, .ctx = 24},
{.type = INST_LOAD_CTX, .ctx = 1073741832},
Expand All @@ -1140,30 +1202,24 @@ static struct script *script_template__fly_in(int *output_slots) {
{.type = INST_LOAD_CTX, .ctx = 1073741840},
{.type = INST_OP, .op = OP_MUL},
{.type = INST_OP, .op = OP_ADD},
{.type = INST_STORE_OVER_NAN, .slot = 10},
{.type = INST_STORE_OVER_NAN, .slot = 7},
{.type = INST_LOAD_CTX, .ctx = 1073741824},
{.type = INST_STORE, .slot = 11},
{.type = INST_IMM, .imm = 0x1p+0},
{.type = INST_STORE, .slot = 5},
{.type = INST_IMM, .imm = 0x1p+0},
{.type = INST_STORE, .slot = 6},
{.type = INST_IMM, .imm = 0x1p+0},
{.type = INST_STORE, .slot = 7},
{.type = INST_BRANCH, .rel = -53},
{.type = INST_STORE, .slot = 8},
{.type = INST_BRANCH, .rel = -47},
{.type = INST_IMM, .imm = 0x0p+0},
{.type = INST_STORE, .slot = 9},
{.type = INST_LOAD, .slot = 11},
{.type = INST_STORE, .slot = 6},
{.type = INST_LOAD, .slot = 8},
{.type = INST_IMM, .imm = 0x0p+0},
{.type = INST_OP, .op = OP_ADD},
{.type = INST_LOAD, .slot = 9},
{.type = INST_LOAD, .slot = 6},
{.type = INST_OP, .op = OP_MAX},
{.type = INST_STORE, .slot = 9},
{.type = INST_STORE, .slot = 6},
{.type = INST_HALT},
};
struct script *ret = malloc(offsetof(struct script, instrs) + sizeof(instrs));
ret->len = ARR_SIZE(instrs);
ret->elapsed_slot = 8;
ret->n_slots = 12;
ret->elapsed_slot = 5;
ret->n_slots = 9;
ret->stack_size = 3;
ret->vars = NULL;
ret->overrides = NULL;
Expand Down Expand Up @@ -1198,36 +1254,18 @@ static struct script *script_template__fly_in(int *output_slots) {
.name = strdup("shadow-offset-y"), .slot = 4, .index = 4};
HASH_ADD_STR(ret->vars, name, var);
}
{
struct variable_allocation *var = malloc(sizeof(*var));
*var = (struct variable_allocation){
.name = strdup("opacity"), .slot = 5, .index = 5};
HASH_ADD_STR(ret->vars, name, var);
}
{
struct variable_allocation *var = malloc(sizeof(*var));
*var = (struct variable_allocation){
.name = strdup("shadow-opacity"), .slot = 6, .index = 6};
HASH_ADD_STR(ret->vars, name, var);
}
{
struct variable_allocation *var = malloc(sizeof(*var));
*var = (struct variable_allocation){
.name = strdup("blur-opacity"), .slot = 7, .index = 7};
HASH_ADD_STR(ret->vars, name, var);
}
{
struct overridable_slot *override = malloc(sizeof(*override));
*override = (struct overridable_slot){.name = strdup("v-timing"), .slot = 10};
*override = (struct overridable_slot){.name = strdup("v-timing"), .slot = 7};
HASH_ADD_STR(ret->overrides, name, override);
}
output_slots[0] = 1;
output_slots[1] = 2;
output_slots[2] = 3;
output_slots[3] = 4;
output_slots[4] = 5;
output_slots[5] = 7;
output_slots[6] = 6;
output_slots[4] = -1;
output_slots[5] = -1;
output_slots[6] = -1;
output_slots[7] = -1;
output_slots[8] = -1;
output_slots[9] = -1;
Expand Down

0 comments on commit 8e75ac6

Please sign in to comment.