Cleanup of GUECS and the textures manager.

This commit is contained in:
Zed A. Shaw 2025-05-03 23:38:03 -04:00
parent 438bd8ab8a
commit 4e7f837240
4 changed files with 31 additions and 28 deletions

View file

@ -25,7 +25,7 @@ namespace textures {
int height = settings["frame_height"];
sprite->setTextureRect({{0,0}, {width, height}});
TMGR.sprite_textures.try_emplace(name, name, sprite, texture);
TMGR.sprite_textures.try_emplace(name, sprite, texture);
}
TMGR.floor = load_image(assets["sprites"]["floor"]["path"]);
@ -53,7 +53,7 @@ namespace textures {
}
}
SpriteTexture get(std::string name) {
SpriteTexture get(const std::string& name) {
dbc::check(initialized, "you forgot to call textures::init()");
dbc::check(TMGR.sprite_textures.contains(name),
fmt::format("!!!!! texture pack does not contain {} sprite", name));
@ -68,7 +68,7 @@ namespace textures {
return result;
}
sf::Image load_image(std::string filename) {
sf::Image load_image(const std::string& filename) {
sf::Image texture;
bool good = texture.loadFromFile(filename);
dbc::check(good, fmt::format("failed to load {}", filename));