xact3::xwb: Number sounds when no names are found

This is a workaround as in the long run names should be read from the
corresponding sound bank.
This commit is contained in:
Simon Bruder 2020-06-23 14:32:00 +02:00
parent dbc42a4083
commit a1ba24bc87
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F

View file

@ -196,8 +196,12 @@ impl WaveBank<'_> {
debug!("Parsing entries (length {})", segments[1].len()); debug!("Parsing entries (length {})", segments[1].len());
let entries = exec_nom_parser(count(Entry::parse, info.entry_count as usize), segments[1])?; let entries = exec_nom_parser(count(Entry::parse, info.entry_count as usize), segments[1])?;
debug!("Parsing entry names (length {})", segments[3].len()); debug!("Parsing entry names (length {})", segments[3].len());
let entry_names = let entry_names = if segments[3].len() == info.entry_count as usize * 64 {
exec_nom_parser(count(take_str64, info.entry_count as usize), segments[3])?; exec_nom_parser(count(take_str64, info.entry_count as usize), segments[3])?
} else {
warn!("File does not have name entries");
(0..info.entry_count).map(|x| x.to_string()).collect()
};
let mut wave_bank = WaveBank { let mut wave_bank = WaveBank {
name: info.name, name: info.name,