WIP: Implement texture files #191

Draft
lucas wants to merge 14 commits from feat/textures into master
2 changed files with 5 additions and 2 deletions
Showing only changes of commit ea2368c532 - Show all commits

View file

@ -535,6 +535,8 @@ impl Texture {
.to_binary(&mut out_data)
.wrap_err("Failed to write DX10 header")?;
// If there is stream data, we build the mipmap data from it.
// If not, we take whatever is left in the bundle file.
if let Some(stream) = &self.stream {
let data = Self::reorder_stream_mipmap(
stream,
@ -549,8 +551,9 @@ impl Texture {
.write_all(&data)
.wrap_err("Failed to write streamed mipmap data")?;
} else {
let (_, remaining) = data.split();
out_data
.write_all(data.remaining_slice())
.write_all(remaining)
.wrap_err("Failed to write texture data")?;
};

View file

@ -1,4 +1,4 @@
#![feature(cursor_remaining)]
#![feature(cursor_split)]
#![feature(test)]
mod binary;