Skip to content

Commit

Permalink
Put TGA decoder into its own crate
Browse files Browse the repository at this point in the history
  • Loading branch information
Speykious committed Feb 15, 2024
1 parent 317c50b commit d2fe01b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 360 deletions.
1 change: 1 addition & 0 deletions inox2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ image = { version = "0.24.7", default-features = false, features = [
indextree = "4.6.0"
json = "0.12.4"
owo-colors = { version = "4.0.0", optional = true }
simple-tga-reader = "0.1.0"
thiserror = "1.0.39"
tracing = "0.1.37"

Expand Down
8 changes: 3 additions & 5 deletions inox2d/src/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use tracing::error;

use crate::model::ModelTexture;

use self::tga::{read_tga, TgaDecodeError, TgaImage};

pub mod tga;
use simple_tga_reader::{read_tga, TgaDecodeError, TgaImage};

#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct TextureId(pub(crate) usize);
Expand Down Expand Up @@ -42,8 +40,8 @@ impl From<TgaImage> for ShallowTexture {
fn from(value: TgaImage) -> Self {
Self {
pixels: value.data,
width: value.header.width() as u32,
height: value.header.height() as u32,
width: value.header.width as u32,
height: value.header.height as u32,
}
}
}
Expand Down
355 changes: 0 additions & 355 deletions inox2d/src/texture/tga.rs

This file was deleted.

0 comments on commit d2fe01b

Please sign in to comment.