mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
Use wrapping add and mul
This commit is contained in:
parent
8b296794fe
commit
de085fc1ff
|
@ -496,7 +496,10 @@ impl MixerBuffer {
|
||||||
unsafe { *channel.data.get_unchecked(channel.pos.floor() as usize) } as i8 as i32;
|
unsafe { *channel.data.get_unchecked(channel.pos.floor() as usize) } as i8 as i32;
|
||||||
|
|
||||||
// SAFETY: working buffer length = self.frequency.buffer_size()
|
// SAFETY: working buffer length = self.frequency.buffer_size()
|
||||||
unsafe { *working_buffer_i32.get_unchecked_mut(i) += value * mul_amount };
|
unsafe {
|
||||||
|
let value_ref = working_buffer_i32.get_unchecked_mut(i);
|
||||||
|
*value_ref = value_ref.wrapping_add(value.wrapping_mul(mul_amount));
|
||||||
|
};
|
||||||
channel.pos += playback_speed;
|
channel.pos += playback_speed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue