Skip to content

Commit 6bf25bf

Browse files
committed
Merge branch 'pr/477' into development
2 parents 675a8ff + a0311e9 commit 6bf25bf

File tree

10 files changed

+60
-44
lines changed

10 files changed

+60
-44
lines changed

scripts/control_draw/control_draw.gml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ function control_draw() {
8888
// Autosave
8989
if (autosave && filename_ext(filename) = ".nbs") {
9090
tonextsave -= 1 / room_speed / 60
91-
if (tonextsave <= 0 && playing == 0) save_song(filename, true)
91+
if (tonextsave <= 0 && playing == 0) {
92+
tonextsave = autosavemins
93+
save_song(filename, true)
94+
}
9295
}
9396

9497
// Auto-recovery

scripts/draw_window_macro_arpeggio/draw_window_macro_arpeggio.gml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
function draw_window_macro_arpeggio() {
22
// draw_window_macro_arpeggio()
33
var x1, y1, a, i, pattern, str, total_vals, val, arplen
4+
if (selected == 0) {
5+
window = 0
6+
return 0
7+
}
48
windowanim = 1
59
if (theme = 3) draw_set_alpha(windowalpha)
610
curs = cr_default
711
text_exists[0] = 0
8-
if (selected = 0) return 0
912
x1 = floor(rw / 2 - 80)
1013
y1 = floor(rh / 2 - 80) + windowoffset
1114
draw_window(x1, y1, x1 + 140, y1 + 130)

scripts/draw_window_macro_portamento/draw_window_macro_portamento.gml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
function draw_window_macro_portamento() {
22
// draw_window_portamento()
33
var x1, y1, a, b, str, total_vals, val, decr, inc;
4+
if (selected == 0) {
5+
window = 0
6+
return 0
7+
}
48
windowanim = 1
59
if (theme = 3) draw_set_alpha(windowalpha)
610
curs = cr_default
711
text_exists[0] = 0
8-
if (selected = 0) return 0
912
x1 = floor(rw / 2 - 80)
1013
y1 = floor(rh / 2 - 80) + windowoffset
1114
draw_window(x1, y1, x1 + 140, y1 + 130)

scripts/draw_window_macro_setpanning/draw_window_macro_setpanning.gml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
function draw_window_macro_setpanning() {
22
// draw_window_setpanning()
33
var x1, y1, a, b, str, total_vals, val, decr, inc;
4+
if (selected == 0) {
5+
window = 0
6+
return 0
7+
}
48
windowanim = 1
59
if (theme = 3) draw_set_alpha(windowalpha)
610
curs = cr_default
711
text_exists[0] = 0
8-
if (selected = 0) return 0
912
x1 = floor(rw / 2 - 80)
1013
y1 = floor(rh / 2 - 80) + windowoffset
1114
draw_window(x1, y1, x1 + 140, y1 + 130)

scripts/draw_window_macro_setpitch/draw_window_macro_setpitch.gml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
function draw_window_macro_setpitch() {
22
// draw_window_setpanning()
33
var x1, y1, a, b, str, total_vals, val, decr, inc;
4+
if (selected == 0) {
5+
window = 0
6+
return 0
7+
}
48
windowanim = 1
59
if (theme = 3) draw_set_alpha(windowalpha)
610
curs = cr_default
711
text_exists[0] = 0
8-
if (selected = 0) return 0
912
x1 = floor(rw / 2 - 80)
1013
y1 = floor(rh / 2 - 80) + windowoffset
1114
draw_window(x1, y1, x1 + 140, y1 + 130)

scripts/draw_window_macro_setvelocity/draw_window_macro_setvelocity.gml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
function draw_window_macro_setvelocity() {
22
// draw_window_setvelocity()
33
var x1, y1, a, b, str, total_vals, val, decr, inc;
4+
if (selected == 0) {
5+
window = 0
6+
return 0
7+
}
48
windowanim = 1
59
if (theme = 3) draw_set_alpha(windowalpha)
610
curs = cr_default
711
text_exists[0] = 0
8-
if (selected = 0) return 0
912
x1 = floor(rw / 2 - 80)
1013
y1 = floor(rh / 2 - 80) + windowoffset
1114
draw_window(x1, y1, x1 + 140, y1 + 130)

scripts/draw_window_macro_stagger/draw_window_macro_stagger.gml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
function draw_window_macro_stagger() {
22
// draw_window_macro_stagger()
33
var x1, y1, a, b, i, pattern, str, total_vals, val, arplen, maxlength, conf;
4+
if (selected == 0) {
5+
window = 0
6+
return 0
7+
}
48
windowanim = 1
59
if (theme = 3) draw_set_alpha(windowalpha)
610
curs = cr_default
711
text_exists[0] = 0
8-
if (selected = 0) return 0
912
x1 = floor(rw / 2 - 80)
1013
y1 = floor(rh / 2 - 70) + windowoffset
1114
draw_window(x1, y1, x1 + 150, y1 + 160)

scripts/draw_window_macro_stereo/draw_window_macro_stereo.gml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
function draw_window_macro_stereo() {
22
// draw_window_stereo_macro()
33
var x1, y1, a, b, str, total_vals, val;
4+
if (selected == 0) {
5+
window = 0
6+
return 0
7+
}
48
windowanim = 1
59
if (theme = 3) draw_set_alpha(windowalpha)
610
curs = cr_default
711
text_exists[0] = 0
8-
if (selected = 0) return 0
912
x1 = floor(rw / 2 - 80)
1013
y1 = floor(rh / 2 - 80) + windowoffset
1114
draw_window(x1, y1, x1 + 140, y1 + 130)

scripts/draw_window_macro_tremolo/draw_window_macro_tremolo.gml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
function draw_window_macro_tremolo() {
22
// draw_window_macro_tremolo()
33
var x1, y1;
4+
if (selected == 0) {
5+
window = 0
6+
return 0
7+
}
48
windowanim = 1
59
if (theme = 3) draw_set_alpha(windowalpha)
610
curs = cr_default
711
text_exists[0] = 0
8-
if (selected = 0) return 0
912
x1 = floor(rw / 2 - 72)
1013
y1 = floor(rh / 2 - 145) + windowoffset
1114
draw_window(x1, y1, x1 + 150, y1 + 240)

scripts/selection_compress/selection_compress.gml

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,47 @@
11
function selection_compress() {
22
// selection_compress()
3-
var str, nw, nh, na, nb, temp_colfirst, temp_collast, temp_exists, temp_ins, temp_key, temp_vel, temp_pan, temp_pit, temp_played;
3+
var a, b, str, nw, nh, na, nb, temp_colfirst, temp_collast, temp_exists, temp_ins, temp_key, temp_vel, temp_pan, temp_pit, temp_played;
44
str = selection_code
55
if (selected = 0 || selection_l = 1) return 0
66
nw = 0
7-
nh = selection_h - 1
8-
/*if (nw > selection_arraylength) { // New length
9-
for (a = selection_arraylength + 1 a <= nw a += 1) {
10-
selection_colfirst[a] = -1
11-
selection_collast[a] = -1
12-
for (b = 0 b <= selection_arrayheight b += 1) {
13-
selection_exists[a, b] = 0
14-
}
15-
}
16-
selection_arraylength = nw
17-
}*/
7+
nh = 0
188
for (a = 0; a < selection_l; a += 1) {
199
temp_colfirst[a] = -1
2010
temp_collast[a] = -1
2111
if (selection_colfirst[a] > -1) {
2212
for (b = selection_colfirst[a]; b <= selection_collast[a]; b += 1) {
2313
if (selection_exists[a, b]) {
24-
na = floor(a / 2)
14+
na = a
2515
nb = b
26-
if (a = 0) { // First column, don't change anything
27-
temp_exists[a, b] = 1
28-
temp_ins[a, b] = selection_ins[a, b]
29-
temp_key[a, b] = selection_key[a, b]
30-
temp_vel[a, b] = selection_vel[a, b]
31-
temp_pan[a, b] = selection_pan[a, b]
32-
temp_pit[a, b] = selection_pit[a, b]
33-
temp_played[a, b] = selection_played[a, b]
16+
if (a == 0) { // First column, don't change anything
3417
} else {
35-
while (1) { // Check if taken
36-
if (nb > temp_collast[na]) break
37-
if (temp_exists[na, nb] = 0) break
18+
na = floor(a / 2)
19+
while (nb <= temp_collast[na]) { // Check if taken
20+
if (temp_exists[na, nb] == 0) break
3821
nb += 1
3922
}
40-
temp_exists[na, nb] = 1
41-
temp_ins[na, nb] = selection_ins[a, b]
42-
temp_key[na, nb] = selection_key[a, b]
43-
temp_vel[na, nb] = selection_vel[a, b]
44-
temp_pan[na, nb] = selection_pan[a, b]
45-
temp_pit[na, nb] = selection_pit[a, b]
46-
temp_played[na, nb] = selection_played[a, b]
47-
}
48-
if (temp_colfirst[na] = -1) temp_colfirst[na] = nb
49-
temp_collast[na] = max(temp_collast[na], nb)
50-
selection_exists[a, b] = 0
23+
}
24+
temp_exists[na, nb] = 1
25+
temp_ins[na, nb] = selection_ins[a, b]
26+
temp_key[na, nb] = selection_key[a, b]
27+
temp_vel[na, nb] = selection_vel[a, b]
28+
temp_pan[na, nb] = selection_pan[a, b]
29+
temp_pit[na, nb] = selection_pit[a, b]
30+
temp_played[na, nb] = selection_played[a, b]
31+
selection_exists[a, b] = 0
5132
selection_ins[a, b] = 0
5233
selection_key[a, b] = 0
5334
selection_vel[a, b] = 0
5435
selection_pan[a, b] = 0
5536
selection_pit[a, b] = 0
5637
selection_played[a, b] = 0
38+
39+
if (temp_colfirst[na] == -1) {
40+
temp_colfirst[na] = nb
41+
} else { // A shifted note can be the first note in the new column
42+
temp_colfirst[na] = min(temp_colfirst[na], nb)
43+
}
44+
temp_collast[na] = max(temp_collast[na], nb)
5745
nw = max(nw, na)
5846
nh = max(nh, nb)
5947
} else {
@@ -64,6 +52,7 @@ function selection_compress() {
6452
selection_colfirst[a] = -1
6553
selection_collast[a] = -1
6654
}
55+
selection_extend_height(nh + 1) // Fix #44
6756
for (a = 0; a <= nw; a += 1) {
6857
if (temp_colfirst[a] > -1) {
6958
for (b = temp_colfirst[a]; b <= temp_collast[a]; b += 1) {

0 commit comments

Comments
 (0)