Fixed Icon vs. Sprite and now Icon is just a subclass of Sprite. Closes #12.

This commit is contained in:
Zed A. Shaw 2025-07-22 17:11:02 -04:00
parent a22342cd7e
commit 3752522597
3 changed files with 26 additions and 5 deletions

View file

@ -43,8 +43,16 @@ namespace guecs {
}
}
inline SpriteTexture load_texture(const string& name, bool is_icon) {
if(is_icon) {
return BACKEND->get_icon(name);
} else {
return BACKEND->get_sprite(name);
}
}
void Sprite::init(lel::Cell &cell) {
auto sprite_texture = BACKEND->get_sprite(name);
auto sprite_texture = load_texture(name, is_icon);
auto bounds = sprite_texture.frame_size;
sf::IntRect rect{{0,0}, bounds};