Fixed Icon vs. Sprite and now Icon is just a subclass of Sprite. Closes #12.
This commit is contained in:
parent
a22342cd7e
commit
3752522597
3 changed files with 26 additions and 5 deletions
|
@ -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};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue