finally vorbis works :)
Some checks failed
Rust / rustfmt (pull_request) Successful in 26s
Rust / clippy (pull_request) Failing after 1m15s
Rust / build (pull_request) Failing after 5m16s

This commit is contained in:
Dominic 2024-07-07 15:28:58 +02:00
parent 80dee24360
commit ae0dac72c9
Signed by: msrd0
GPG key ID: AAF7C8430CA3345D
13 changed files with 5 additions and 5 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/sounds/bzz.ogg Normal file

Binary file not shown.

View file

@ -69,7 +69,7 @@ impl AssetsWriter {
const_name
}
fn add_mp3<P: AsRef<Path> + Copy>(&mut self, canonical_path: P) -> String {
fn add_ogg<P: AsRef<Path> + Copy>(&mut self, canonical_path: P) -> String {
let const_name = Self::asset_name(canonical_path);
writeln!(self.file, "// {}", canonical_path.as_ref().display()).unwrap();
writeln!(
@ -206,8 +206,8 @@ fn process_dir<P: AsRef<Path> + Copy>(
groups.pop();
} else if path.extension().map(|ext| ext == "svg").unwrap_or(false) {
process_svg(&path, dir, writer, groups);
} else if path.extension().map(|ext| ext == "mp3").unwrap_or(false) {
process_mp3(&path, dir, writer, groups);
} else if path.extension().map(|ext| ext == "ogg").unwrap_or(false) {
process_ogg(&path, dir, writer, groups);
}
}
}
@ -258,13 +258,13 @@ fn process_svg<P: AsRef<Path> + Copy, Q: AsRef<Path>>(
);
}
fn process_mp3<P: AsRef<Path> + Copy, Q: AsRef<Path>>(
fn process_ogg<P: AsRef<Path> + Copy, Q: AsRef<Path>>(
file: P,
dir: Q,
writer: &mut AssetsWriter,
groups: &[String]
) {
let const_name = writer.add_mp3(
let const_name = writer.add_ogg(
&file
.as_ref()
.canonicalize()