Skip to content

Commit

Permalink
fix(taiko): remove hitted notes from display
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobLinCool committed Apr 28, 2024
1 parent a219ff9 commit aff3bfa
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions taiko-core/src/taiko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ pub struct DefaultTaikoEngine {
current_time: f64,

total_notes: usize,

passed_display: Vec<CalculatedNote>,
}

impl TaikoEngine<Hit> for DefaultTaikoEngine {
Expand Down Expand Up @@ -225,6 +227,7 @@ impl TaikoEngine<Hit> for DefaultTaikoEngine {
gauge: 0.0,
current_time: 0.0,
total_notes,
passed_display: vec![],
}
}

Expand Down Expand Up @@ -317,13 +320,19 @@ impl TaikoEngine<Hit> for DefaultTaikoEngine {

self.gauge = self.gauge.max(0.0).min(1.0);

let display = self
self.passed_display.extend(passed);
self.passed_display.retain(|note| note.visible(input.time));

let available_display = self
.rhythm
.notes
.availables()
.iter()
.filter(|note| note.visible(input.time))
.cloned()
.collect();
.collect::<Vec<_>>();

let mut display = self.passed_display.clone();
display.extend(available_display);

OutputState {
finished: self.rhythm.finished(),
Expand Down

0 comments on commit aff3bfa

Please sign in to comment.