diff --git a/include/guecs/sfml/components.hpp b/include/guecs/sfml/components.hpp index 34022f3..1b87999 100644 --- a/include/guecs/sfml/components.hpp +++ b/include/guecs/sfml/components.hpp @@ -30,6 +30,7 @@ namespace guecs { bool stretch = true; bool is_icon = false; std::shared_ptr sprite = nullptr; + std::shared_ptr texture = nullptr; void init(lel::Cell &cell); void update(const string& new_name); diff --git a/meson.build b/meson.build index e05ce36..d41a2ab 100644 --- a/meson.build +++ b/meson.build @@ -10,7 +10,9 @@ project('lel-guecs', 'cpp', ]) # use this for common options only for our executables -cpp_args=[] +cpp_args=[ + '-Wno-deprecated-declarations' + ] link_args=[] # these are passed as override_defaults exe_defaults = [ 'warning_level=2' ] diff --git a/src/guecs/sfml/components.cpp b/src/guecs/sfml/components.cpp index 6e04f14..7bb6f9c 100644 --- a/src/guecs/sfml/components.cpp +++ b/src/guecs/sfml/components.cpp @@ -59,7 +59,8 @@ namespace guecs { if(new_name != name) { name = new_name; auto sprite_texture = BACKEND->get_sprite(name); - sprite->setTexture(*sprite_texture.texture); + texture = sprite_texture.texture; + sprite->setTexture(*texture); sprite->setTextureRect({{0,0},sprite_texture.frame_size}); } } @@ -71,7 +72,8 @@ namespace guecs { auto bounds = sprite_texture.frame_size; sf::IntRect rect{{0,0}, bounds}; - sprite = make_shared(*sprite_texture.texture, rect); + texture = sprite_texture.texture; + sprite = make_shared(*texture, rect); if(stretch) { sprite->setScale({