Implement texture atlas building

This commit is contained in:
crumblingstatue 2023-04-15 19:26:36 +02:00
parent 5ec0ad0da4
commit 45801205dc
17 changed files with 558 additions and 60 deletions

View file

@ -1,9 +1,10 @@
use sfml::{audio::Music, graphics::Texture, SfBox};
use sfml::audio::Music;
use crate::texture_atlas::AtlasBundle;
#[derive(Debug)]
pub struct Res {
pub tile_atlas: SfBox<Texture>,
pub light_texture: SfBox<Texture>,
pub atlas: AtlasBundle,
pub surf_music: Music<'static>,
pub und_music: Music<'static>,
}
@ -11,8 +12,7 @@ pub struct Res {
impl Res {
pub fn load() -> anyhow::Result<Self> {
Ok(Self {
tile_atlas: Texture::from_file("res/graphics/tiles.png")?,
light_texture: Texture::from_file("res/graphics/light2.png")?,
atlas: AtlasBundle::new()?,
surf_music: Music::from_file("res/music/music.ogg").unwrap(),
und_music: Music::from_file("res/music/cave2.ogg").unwrap(),
})