mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-16 20:35:02 +01:00
Implement texture atlas building
This commit is contained in:
parent
5ec0ad0da4
commit
45801205dc
17 changed files with 558 additions and 60 deletions
10
src/res.rs
10
src/res.rs
|
|
@ -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(),
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue