Icons now work way better and don't have the the 'Rayview cuts icons' bug. It actually was a bug in the lel-guecs Sprite class that was using the TextureRect from the source sprite. Now its initialized with the framesize from the .json. This also uses the new guecs::Icon, but I have to fix that as it doesn't scale correctly. Closes #2.

This commit is contained in:
Zed A. Shaw 2025-07-22 15:03:37 -04:00
parent b311713064
commit ff7111b006
22 changed files with 81 additions and 64 deletions

View file

@ -8,9 +8,14 @@
namespace sfml {
using namespace nlohmann;
guecs::SpriteTexture Backend::texture_get(const string& name) {
auto sp = textures::get(name);
return {sp.sprite, sp.texture};
guecs::SpriteTexture Backend::get_sprite(const string& name) {
auto sp = textures::get_sprite(name);
return {sp.sprite, sp.texture, sp.frame_size};
}
guecs::SpriteTexture Backend::get_icon(const string& name) {
auto sp = textures::get_icon(name);
return {sp.sprite, sp.texture, sp.frame_size};
}
Backend::Backend() {
@ -27,7 +32,7 @@ namespace sfml {
sound::stop(name);
}
std::shared_ptr<sf::Shader> Backend::shader_get(const std::string& name) {
std::shared_ptr<sf::Shader> Backend::get_shader(const std::string& name) {
return shaders::get(name);
}