Use new VAG tool

This commit is contained in:
Jaby 2024-11-03 21:30:04 +00:00
parent 0c96b7cf1b
commit 29a3e6a83b
5 changed files with 9 additions and 17 deletions

View File

@ -13,9 +13,8 @@ CLUT_4_COLOR_TRANS_FLAGS = simple-tim clut4 --color-trans
INPUT += $(OUTPUT_DIR)/Evacuation_cdda.xa
INPUT += $(OUTPUT_DIR)/fox.xa
INPUT += $(OUTPUT_DIR)/apple.vag
INPUT += $(OUTPUT_DIR)/blubb.vag
INPUT += $(OUTPUT_DIR)/blubb-mono.vag
INPUT += $(OUTPUT_DIR)/Friendship_samp.vag
INPUT += $(OUTPUT_DIR)/Friendship_samp.vag2
## Images
INPUT += $(OUTPUT_DIR)/TexturePage.img
@ -47,10 +46,6 @@ $(OUTPUT_DIR)/%.vag: audio/temp/%.wav
@mkdir -p $(OUTPUT_DIR)
psxfileconv --lz4 $< -o $@ vag
$(OUTPUT_DIR)/%.vag2: audio/temp/%.wav
@mkdir -p $(OUTPUT_DIR)
psxfileconv --lz4 $< -o $@ my-vag
$(OUTPUT_DIR)/%.xa: audio/%.wav
@mkdir -p $(OUTPUT_DIR)
psxfileconv $< -o $@ xa

View File

@ -50,8 +50,8 @@
</Directory>
<Directory name = "SFX" hidden = "true">
<File name = "APPLE.VAG" lz4 = "already">../assets/bin/apple.vag</File>
<File name = "BLUBB.VAG" lz4 = "already">../assets/bin/blubb.vag</File>
<File name = "FRIEND.VAG">../assets/tmp.vag</File><!--TODO: Find working vag tool-->
<File name = "BLUBB.VAG" lz4 = "already">../assets/bin/blubb-mono.vag</File>
<File name = "FRIEND.VAG" lz4 = "already">../assets/bin/Friendship_samp.vag</File>
</Directory>
</Filesystem>
<AudioTrack align = "true">../assets/audio/temp/breaking.wav</AudioTrack>

View File

@ -1,5 +1,5 @@
pub mod my_vag;
pub mod vag;
pub mod old_vag;
pub mod xa;
use std::{env, path::PathBuf, process::Command};

View File

@ -24,10 +24,9 @@ enum SubCommands {
// === Internal Commands ===
Nothing,
SimpleTIM(reduced_tim::Arguments),
MyVAG(my_vag::Arguments),
VAG(my_vag::Arguments),
// === External Commands ===
VAG(vag::Arguments),
XA(xa::Arguments),
}
@ -36,9 +35,8 @@ impl SubCommands {
match self {
SubCommands::Nothing => false,
SubCommands::SimpleTIM(_) => false,
SubCommands::MyVAG(_) => false,
SubCommands::VAG(_) => false,
SubCommands::VAG(_) => true,
SubCommands::XA(_) => true
}
}
@ -62,7 +60,7 @@ fn run_internal_conversion(cmd: CommandLine) -> Result<(), Error> {
match cmd.sub_command {
SubCommands::Nothing => nothing::copy(&mut input, dst_buffer),
SubCommands::SimpleTIM(args) => reduced_tim::convert(args, input, dst_buffer),
SubCommands::MyVAG(args) => audio::my_vag::convert(args, &cmd.output_file, input, dst_buffer),
SubCommands::VAG(args) => audio::my_vag::convert(args, &cmd.output_file, input, dst_buffer),
_ => Err(Error::from_str("External functions can not be called for internal conversion"))
}
};
@ -94,9 +92,8 @@ fn run_external_conversion(cmd: CommandLine) -> Result<(), Error> {
let is_xa = matches!(cmd.sub_command, SubCommands::XA(_));
match cmd.sub_command {
SubCommands::VAG(args) => vag::convert(args, input_file, output_file.clone()),
SubCommands::XA(args) => xa::convert(args, input_file, output_file.clone()),
_ => Err(Error::from_str("Internal functions can not be called for external conversion"))
SubCommands::XA(args) => xa::convert(args, input_file, output_file.clone()),
_ => Err(Error::from_str("Internal functions can not be called for external conversion"))
}?;
if cmd.compress_lz4 {