fix(timing): batch state on original detail callbacks
Replace the host-frame 10 ms publication loop with the original timer matrix: 50/40/30/20/10 ms callbacks execute exactly 5/4/3/2/1 internal physics substeps. Ball state, claw progression, and flipper geometry are now visible only at the selected callback boundary rather than leaking intermediate substeps. Separate flipper input flags from flipper position. Key changes are sampled by the timer, then produce one delta edge, WAVE 2021, collision response, and rendered position update after physics, matching the Win16 callback order. Clear both input and position state on turn reset and keep tilt decay on the same timer cadence. Test Plan: - `cargo test --all-targets` -- passed, 70 tests - `cargo clippy --all-targets -- -D warnings` -- passed - `rumdl check CHANGELOG.md README.md RECONSTRUCTION.md` -- passed - `git diff --cached --check` -- passed
This commit is contained in:
@@ -416,10 +416,19 @@ mod tests {
|
||||
#[test]
|
||||
fn flipper_scenario_records_both_movement_edges() {
|
||||
let mut simulation = Simulation::new(Scenario::Flippers, 1);
|
||||
simulation.advance_to(46);
|
||||
simulation.advance_to(50);
|
||||
|
||||
assert_eq!(simulation.trace[16].events, ["FlipperMove", "Sound(2021)"]);
|
||||
assert_eq!(simulation.trace[46].events, ["FlipperMove", "Sound(2021)"]);
|
||||
let edge_steps = simulation
|
||||
.trace
|
||||
.iter()
|
||||
.filter(|snapshot| snapshot.events.iter().any(|event| event == "FlipperMove"))
|
||||
.collect::<Vec<_>>();
|
||||
assert_eq!(edge_steps.len(), 2);
|
||||
assert!(
|
||||
edge_steps
|
||||
.iter()
|
||||
.all(|snapshot| snapshot.events == ["FlipperMove", "Sound(2021)"])
|
||||
);
|
||||
assert!(!simulation.game.flippers.left_raised);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user