mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-14 19:55:02 +01:00
20 lines
596 B
Rust
20 lines
596 B
Rust
use sfml::{audio::Music, graphics::Texture, SfBox};
|
|
|
|
#[derive(Debug)]
|
|
pub struct Res {
|
|
pub tile_atlas: SfBox<Texture>,
|
|
pub light_texture: SfBox<Texture>,
|
|
pub surf_music: Music<'static>,
|
|
pub und_music: Music<'static>,
|
|
}
|
|
|
|
impl Res {
|
|
pub fn load() -> anyhow::Result<Self> {
|
|
Ok(Self {
|
|
tile_atlas: Texture::from_file("res/tiles.png")?,
|
|
light_texture: Texture::from_file("res/lightcircle.png")?,
|
|
surf_music: Music::from_file("res/music.ogg").unwrap(),
|
|
und_music: Music::from_file("res/cave2.ogg").unwrap(),
|
|
})
|
|
}
|
|
}
|