mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-10 14:07:59 -06:00
chore: delete TextureManager
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
use crate::constants::{WINDOW_HEIGHT, WINDOW_WIDTH};
|
use crate::constants::{WINDOW_HEIGHT, WINDOW_WIDTH};
|
||||||
use crate::game::Game;
|
use crate::game::Game;
|
||||||
use crate::textures::TextureManager;
|
|
||||||
use sdl2::event::{Event};
|
use sdl2::event::{Event};
|
||||||
use sdl2::keyboard::Keycode;
|
use sdl2::keyboard::Keycode;
|
||||||
use sdl2::pixels::Color;
|
use sdl2::pixels::Color;
|
||||||
@@ -14,7 +13,6 @@ mod constants;
|
|||||||
mod direction;
|
mod direction;
|
||||||
mod game;
|
mod game;
|
||||||
mod pacman;
|
mod pacman;
|
||||||
mod textures;
|
|
||||||
mod entity;
|
mod entity;
|
||||||
mod animation;
|
mod animation;
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
|
|
||||||
use sdl2::{
|
|
||||||
image::LoadTexture,
|
|
||||||
render::{Texture, TextureCreator},
|
|
||||||
video::WindowContext,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub struct TextureManager<'a> {
|
|
||||||
pub map: Texture<'a>,
|
|
||||||
pub pacman: Texture<'a>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> TextureManager<'a> {
|
|
||||||
pub fn new(texture_creator: &'a TextureCreator<WindowContext>) -> Self {
|
|
||||||
let map_texture = texture_creator
|
|
||||||
.load_texture("assets/map.png")
|
|
||||||
.expect("Could not load pacman texture");
|
|
||||||
|
|
||||||
let pacman_atlas = texture_creator
|
|
||||||
.load_texture("assets/pacman.png")
|
|
||||||
.expect("Could not load pacman texture");
|
|
||||||
|
|
||||||
|
|
||||||
TextureManager {
|
|
||||||
map: map_texture,
|
|
||||||
pacman: pacman_atlas,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user