Skip to main content

rewind

Function rewind 

Source
pub fn rewind(
    pool: &DiffPool,
    rollback: &RollbackBuffer,
    start_tick: u64,
    end_tick: u64,
    apply_fn: impl FnMut((i32, i32, i32), u16, u16),
)
Expand description

Rewind state by applying diffs in reverse (new→old).

For each diff in the frame range (newest to oldest), swaps new_val back to old_val in the provided state.

apply_fn receives (coords, index, value_to_set) for each rewind step.