diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-11-22 00:48:19 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-11-22 00:48:19 -0500 |
| commit | ebb06a7f45852f468a75c7488e1d07027600a5af (patch) | |
| tree | e510f2d0cdcbe0985483fdfb823ec75bf99e24c7 | |
| parent | audio: add temp changing (diff) | |
| download | DungeonCrawl-ebb06a7f45852f468a75c7488e1d07027600a5af.tar.gz DungeonCrawl-ebb06a7f45852f468a75c7488e1d07027600a5af.tar.bz2 DungeonCrawl-ebb06a7f45852f468a75c7488e1d07027600a5af.zip | |
audio: fix tempo (off by one, rahhhgit status!)
| -rw-r--r-- | graphics/src/audio/mod.rs | 3 | ||||
| -rw-r--r-- | graphics/src/audio/program.rs | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/graphics/src/audio/mod.rs b/graphics/src/audio/mod.rs index a8c24ad..f0de9d4 100644 --- a/graphics/src/audio/mod.rs +++ b/graphics/src/audio/mod.rs @@ -13,8 +13,7 @@ mod parse; mod program; const AUDIO_FPS: u32 = 60; - -pub const TIME_SLICE: Duration = Duration::from_millis(1000 / AUDIO_FPS as u64); +const TIME_SLICE: Duration = Duration::from_millis(1000 / AUDIO_FPS as u64); /// Holds each audio channel pub struct Channels { diff --git a/graphics/src/audio/program.rs b/graphics/src/audio/program.rs index 91f0608..270a214 100644 --- a/graphics/src/audio/program.rs +++ b/graphics/src/audio/program.rs @@ -99,7 +99,7 @@ impl Program { match ins { I::Pause => { // pause execution until next `exec` call - self.pause = (AUDIO_FPS * 4) / self.tempo.clamp(1, 240); + self.pause = (AUDIO_FPS * 8) / self.tempo.clamp(1, 240); } I::Jump(pc) => { self.pc = pc; @@ -144,7 +144,6 @@ impl Program { pub fn exec(&mut self, channels: &mut Channels) { if self.pause > 0 { self.pause -= 1; - return; } loop { if self.pause > 0 { |