Same problem with background.

This commit is contained in:
Zed A. Shaw 2026-03-11 07:56:05 -04:00
parent e88179b788
commit 31adf011ef
2 changed files with 3 additions and 1 deletions

View file

@ -103,6 +103,7 @@ namespace guecs {
sf::Color color=THEME.BG_COLOR;
shared_ptr<sf::RectangleShape> shape = nullptr;
shared_ptr<sf::Sprite> sprite = nullptr;
shared_ptr<sf::Texture> texture = nullptr;
Background(lel::Parser& parser, sf::Color bg_color=THEME.BG_COLOR) :
x(parser.grid_x),

View file

@ -158,7 +158,8 @@ namespace guecs {
auto sprite_texture = BACKEND->get_sprite(name);
sf::IntRect rect{{0,0},sprite_texture.frame_size};
sprite = make_shared<sf::Sprite>(*sprite_texture.texture, rect);
texture = sprite_texture.texture;
sprite = make_shared<sf::Sprite>(*texture, rect);
sprite->setPosition({float(x), float(y)});