chore: delete TextureManager

This commit is contained in:
2023-09-09 18:21:30 -05:00
parent de29dc6711
commit f7ff9f5290
2 changed files with 0 additions and 31 deletions

View File

@@ -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;

View File

@@ -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,
}
}
}