Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/brumm/src/tui/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -870,9 +870,9 @@ impl Model {
self.geo.next = cell(start + tw - 1, 1);
}
Hit::UpNext { n, tw, th } => {
for j in 0..n {
for (j, r) in self.geo.upnext.iter_mut().enumerate().take(n) {
let x0 = x + j as i64 * (tw + 2);
self.geo.upnext[j] = Rect::new(x0, y, x0 + tw, y + th);
*r = Rect::new(x0, y, x0 + tw, y + th);
}
}
Hit::UpSongs { w: wd, n } => self.geo.upsongs = Rect::new(x, y, x + wd, y + n),
Expand Down
4 changes: 1 addition & 3 deletions crates/brumm/src/tui/viz/fire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,7 @@ impl Visualizer {
while x < w {
let bw = 3 + (self.rnd() % 6) as usize;
let bh = (1 + self.rnd() % (h / 7).max(1) as u64) as i8;
for i in x..(x + bw).min(w) {
self.fw.city[i] = bh;
}
self.fw.city[x..(x + bw).min(w)].fill(bh);
x += bw;
}
}
Expand Down
12 changes: 6 additions & 6 deletions crates/brumm/src/tui/viz/warp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ impl Visualizer {
s.rip[0] = a.t;
}
let t = s.t as f32;
for x in 0..w {
s.sx[x] = vsin(x as f32 * 0.08 + t);
for (x, v) in s.sx.iter_mut().enumerate().take(w) {
*v = vsin(x as f32 * 0.08 + t);
}
for y in 0..h {
s.sy[y] = vsin(y as f32 * 0.19 - t * 1.3);
for (y, v) in s.sy.iter_mut().enumerate().take(h) {
*v = vsin(y as f32 * 0.19 - t * 1.3);
}
// Ripples: a ring 8 rows wide running out at 30 rows a second, fading.
let (mut rr, mut ra) = ([0f32; 4], [0f32; 4]);
Expand Down Expand Up @@ -166,7 +166,7 @@ impl Visualizer {
self.milk.tmp = vec![0.0; n_dots];
// Where each dot pulls its value from: calm / punch zoom, each
// twisting either way. Built once per size.
for k in 0..4 {
for (k, slot) in self.milk.map.iter_mut().enumerate() {
let zoom = if k & 1 != 0 { 0.87 } else { 0.95 };
let rot = if k & 2 != 0 { -0.025 } else { 0.025 };
let (cs, sn) = (f64::cos(rot) * zoom, f64::sin(rot) * zoom);
Expand All @@ -181,7 +181,7 @@ impl Visualizer {
}
}
}
self.milk.map[k] = m;
*slot = m;
}
}
let (kicks, beat, level, bass, live, t) = (
Expand Down
Loading