Skip to content

Commit

Permalink
audio: Fix DLLs not being copied
Browse files Browse the repository at this point in the history
  • Loading branch information
cohaereo committed Aug 4, 2024
1 parent 2d71619 commit 887244b
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ binrw = "0.13.3"
destiny-pkg = { version = "0.12.2", features = ["bincode"] }
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.108"
vgmstream = { git = "https://github.com/cohaereo/vgmstream-rs/", version = "0.1.4" }
vgmstream = { git = "https://github.com/cohaereo/vgmstream-rs/", version = "0.1.5" }
wav = "1.0.0"
zstd = { version = "0.13.0", features = ["zstdmt"] }
either = "1.10.0"
Expand Down
68 changes: 61 additions & 7 deletions src/gui/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub struct TextureHeaderRoiPs4 {
}

#[derive(Debug, BinRead)]
pub struct TextureHeaderRoiXbox {
pub struct TextureHeaderDevAlphaX360 {
pub format: DxgiFormat,

#[br(seek_before = SeekFrom::Start(0x2c), assert(beefcafe == 0xbeefcafe))]
Expand All @@ -96,6 +96,21 @@ pub struct TextureHeaderRoiXbox {
// pub flags3: u32,
}

#[derive(Debug, BinRead)]
pub struct TextureHeaderRoiXbox {
pub format: DxgiFormat,

#[br(seek_before = SeekFrom::Start(0x36))]
pub width: u16,
pub height: u16,
pub depth: u16,
// pub flags1: u32,
// pub flags2: u32,
// pub flags3: u32,
#[br(seek_before = SeekFrom::Start(0x48), assert(beefcafe == 0xbeefcafe))]
pub beefcafe: u32,
}

pub struct Texture {
pub view: wgpu::TextureView,
pub handle: wgpu::Texture,
Expand Down Expand Up @@ -294,14 +309,29 @@ impl Texture {
if package_manager().version.is_d1()
&& !matches!(
package_manager().platform,
PackagePlatform::PS4 | PackagePlatform::XboxOne
PackagePlatform::PS4 | PackagePlatform::XboxOne | PackagePlatform::X360
)
{
anyhow::bail!("Textures are not supported for D1");
}

match package_manager().version {
GameVersion::DestinyInternalAlpha | GameVersion::DestinyTheTakenKing => todo!(),
GameVersion::DestinyInternalAlpha | GameVersion::DestinyTheTakenKing => {
match package_manager().platform {
PackagePlatform::X360 => {
let texture: TextureHeaderDevAlphaX360 =
package_manager().read_tag_binrw(hash)?;
Ok(TextureDesc {
format: texture.format.to_wgpu()?,
width: texture.width as u32,
height: texture.height as u32,
depth: texture.depth as u32,
premultiply_alpha: false,
})
}
_ => unreachable!("Unsupported platform for legacy D1 textures"),
}
}
GameVersion::DestinyRiseOfIron => match package_manager().platform {
PackagePlatform::PS4 => {
let texture: TextureHeaderRoiPs4 = package_manager().read_tag_binrw(hash)?;
Expand Down Expand Up @@ -364,14 +394,38 @@ impl Texture {
if package_manager().version.is_d1()
&& !matches!(
package_manager().platform,
PackagePlatform::PS4 | PackagePlatform::XboxOne
PackagePlatform::PS4 | PackagePlatform::XboxOne | PackagePlatform::X360
)
{
anyhow::bail!("Textures are not supported for D1");
anyhow::bail!(
"Textures are not supported for D1 on platform {}",
package_manager().platform
);
}

match package_manager().version {
GameVersion::DestinyInternalAlpha | GameVersion::DestinyTheTakenKing => todo!(),
GameVersion::DestinyInternalAlpha | GameVersion::DestinyTheTakenKing => {
match package_manager().platform {
// PackagePlatform::X360 => {
// let (texture, texture_data, comment) =
// Self::load_data_roi_x360(hash, true)?;
// Self::create_texture(
// rs,
// hash,
// TextureDesc {
// format: texture.format.to_wgpu()?,
// width: texture.width as u32,
// height: texture.height as u32,
// depth: texture.depth as u32,
// premultiply_alpha,
// },
// texture_data,
// Some(comment),
// )
// }
_ => anyhow::bail!("Unsupported platform for legacy D1 textures"),
}
}
GameVersion::DestinyRiseOfIron => match package_manager().platform {
PackagePlatform::PS4 => {
let (texture, texture_data, comment) = Self::load_data_roi_ps4(hash, true)?;
Expand All @@ -390,7 +444,7 @@ impl Texture {
)
}
PackagePlatform::XboxOne => {
anyhow::bail!("Xbox One textures are not supported yet");
// anyhow::bail!("Xbox One textures are not supported yet");
let (texture, texture_data, comment) = Self::load_data_roi_xone(hash, true)?;
Self::create_texture(
rs,
Expand Down
1 change: 0 additions & 1 deletion src/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ lazy_static::lazy_static! {
static ref SCANNER_PROGRESS: RwLock<ScanStatus> = RwLock::new(ScanStatus::None);
}

/// Returns Some((current_package, total_packages)) if there's a scan in progress
pub fn scanner_progress() -> ScanStatus {
*SCANNER_PROGRESS.read()
}
Expand Down
2 changes: 1 addition & 1 deletion src/tagtypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl TagType {
(128, 0) => TagType::TagGlobal,
(0, 15) => TagType::WwiseBank,
(2, 16) => TagType::WwiseStream,
(32 | 0, _) => {
(32 | 64 | 1, _) => {
let is_header = t == 32;
match st {
1 => TagType::Texture2D { is_header },
Expand Down

0 comments on commit 887244b

Please sign in to comment.