-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
54 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "goldsrc-rs" | ||
version = "0.12.1" | ||
version = "0.13.1" | ||
authors = ["r4v3n6101 <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,43 @@ | ||
use std::array; | ||
|
||
use crate::CStr16; | ||
|
||
pub const MIP_LEVELS: usize = 4; | ||
|
||
pub type Rgb = [u8; 3]; | ||
pub type Palette = [Rgb]; | ||
|
||
pub struct ColourData<const N: usize> { | ||
#[derive(Debug, Clone)] | ||
pub struct ColorData<const N: usize> { | ||
pub indices: [Vec<u8>; N], | ||
pub palette: Box<Palette>, | ||
} | ||
|
||
impl<const N: usize> Default for ColourData<N> { | ||
fn default() -> Self { | ||
Self { | ||
indices: array::from_fn(|_| Vec::new()), | ||
palette: Box::default(), | ||
} | ||
} | ||
} | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct MipTexture { | ||
pub name: CStr16, | ||
pub width: u32, | ||
pub height: u32, | ||
pub data: Option<ColourData<4>>, | ||
pub data: Option<ColorData<MIP_LEVELS>>, | ||
} | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct Picture { | ||
pub width: u32, | ||
pub height: u32, | ||
pub data: ColourData<1>, | ||
pub data: ColorData<1>, | ||
} | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct CharInfo { | ||
pub offset: u16, | ||
pub width: u16, | ||
} | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct Font { | ||
pub width: u32, | ||
pub height: u32, | ||
pub row_count: u32, | ||
pub row_height: u32, | ||
pub chars_info: Box<[CharInfo]>, | ||
pub data: ColourData<1>, | ||
pub data: ColorData<1>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters