Integration: #5864 #5993 the DDS level cut-out test sets the level's row pitch

This commit is contained in:
aiongg committed 2026-10-22 15:39:21 +00:00
1 parent 3f9d2aaf2b
commit 8e206e60b0
1 file changed
+3
+3
View File
@@ -97,6 +97,9 @@ fn level(file: &[u8], i: u32) -> Image {
b[12..16].copy_from_slice(&(lh as u32).to_le_bytes());
b[16..20].copy_from_slice(&(lw as u32).to_le_bytes());
b[28..32].copy_from_slice(&1u32.to_le_bytes());
// The pitch field is a row stride for uncompressed textures and the level size for BC.
let pitch = if le32(file, 80) & DDPF_FOURCC != 0 { level_bytes(file, lw, lh) } else { lw * le32(file, 88) as usize / 8 };
b[20..24].copy_from_slice(&(pitch as u32).to_le_bytes());
b.extend(&file[start..start + level_bytes(file, lw, lh)]);
decode(&b).unwrap()
}