blob: 2c0646650dbc54cf31634d63ef3eeef6faf66fb3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
use crate::texture::atlas;
#[derive(Debug)]
pub enum Entry {
Contiguous(atlas::Allocation),
Fragmented {
size: (u32, u32),
fragments: Vec<Fragment>,
},
}
impl Entry {
pub fn size(&self) -> (u32, u32) {
match self {
Entry::Contiguous(allocation) => allocation.size(),
Entry::Fragmented { size, .. } => *size,
}
}
}
#[derive(Debug)]
pub struct Fragment {
pub position: (u32, u32),
pub allocation: atlas::Allocation,
}
|