More graphics, live reloading of textures

This commit is contained in:
crumblingstatue 2023-04-15 20:37:01 +02:00
parent f31add5218
commit cee7652e09
7 changed files with 10 additions and 1 deletions

View file

@ -118,7 +118,11 @@ impl TileDb {
pub(crate) fn update_rects(&mut self, rects: &RectMap) {
for def in &mut self.db {
if !def.graphic_name.is_empty() {
def.tex_rect = rects[&def.graphic_name];
if let Some(rect) = rects.get(&def.graphic_name) {
def.tex_rect = *rect;
} else {
log::error!("Missing texture for {}", def.graphic_name);
}
}
}
}