1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-10-31 19:44:20 +00:00

Replace Organya wavetable with one based on actual Cave Story samples

This commit is contained in:
Alula 2020-12-21 12:57:31 +01:00
parent a0b396326f
commit 8603086694
No known key found for this signature in database
GPG key ID: 3E00485503A1D8BA
5 changed files with 6 additions and 5 deletions

Binary file not shown.

View file

@ -110,7 +110,7 @@ impl BuiltinFS {
FSNode::File("builtin_font.fnt", include_bytes!("builtin/builtin_font.fnt")),
FSNode::File("builtin_font_0.png", include_bytes!("builtin/builtin_font_0.png")),
FSNode::File("builtin_font_1.png", include_bytes!("builtin/builtin_font_1.png")),
FSNode::File("pixtone.pcm", include_bytes!("builtin/pixtone.pcm")),
FSNode::File("organya-wavetable-doukutsu.bin", include_bytes!("builtin/organya-wavetable-doukutsu.bin")),
FSNode::File("touch.png", include_bytes!("builtin/touch.png")),
FSNode::Directory("shaders", vec![
FSNode::File("basic_150.vert.glsl", include_bytes!("builtin/shaders/basic_150.vert.glsl")),

View file

@ -83,7 +83,7 @@ impl SoundManager {
let device = host.default_output_device().ok_or_else(|| AudioError(str!("Error initializing audio device.")))?;
let config = device.default_output_config()?;
let bnk = wave_bank::SoundBank::load_from(filesystem::open(ctx, "/builtin/pixtone.pcm")?)?;
let bnk = wave_bank::SoundBank::load_from(filesystem::open(ctx, "/builtin/organya-wavetable-doukutsu.bin")?)?;
std::thread::spawn(move || {
if let Err(err) = match config.sample_format() {
@ -197,7 +197,7 @@ fn run<T>(rx: Receiver<PlaybackMessage>, bank: SoundBank,
org_engine.set_sample_rate(sample_rate as usize);
org_engine.loops = usize::MAX;
let buf_size = sample_rate as usize * 30 / 1000;
let buf_size = sample_rate as usize * 15 / 1000;
let mut bgm_buf = vec![0x8080; buf_size];
let mut pxt_buf = vec![0x8000; buf_size];
let mut bgm_index = 0;

View file

@ -73,12 +73,13 @@ impl PlaybackEngine {
}
}
for (inst, buf) in song.tracks[8..].iter().zip(buffers[128..].iter_mut()) {
for (idx, (track, buf)) in song.tracks[8..].iter().zip(buffers[128..].iter_mut()).enumerate() {
*buf =
MaybeUninit::new(
RenderBuffer::new(
// FIXME: *frustrated screaming*
samples.samples[inst.inst.inst as usize].clone()
//samples.samples[track.inst.inst as usize].clone()
samples.samples[idx].clone()
)
);
}