So I'm experimenting around with my assetLoader, parsing asset data (If we take a Texture for example), such as subRect and filepath. As this allows be to change path and such of my assets without messing around with the code.
And now I implemented an additional little feature, to reparse the file and reload the asset during runtime, mainly for faster testing of different things. However, when changing data for my Textures, the subRect data more specifically(show below):
myTexture.loadFromFile("myPath.png", subRect);
If I change the
Xand
Y values of the subRect, another sprite on my spritesheet is drawn on my screen. But if I change the
Width and
Height values of the subRect, and reloading, nothing happens to the texture. Altough if I change the subRect Width/Height to something lower, I get this(See below):
INFO: The below pictures are rendered on my SFML sf::RenderWindow, and I have then taken screenshots of what it looks like, just to clear things up.Texture taken from sprite sheet, sf::IntRect(0,0, 8,8)Texture taken from sprite sheet, sf::IntRect(0,0, 4,4)As you can see the picture with width and height of 4 pixels, is still 8 x 8 pixels. I have tried invoking the texture's default constructor right before reloading it to reset all values, but still the same result. I suspect this is a bug but I really have no idea what's going on :/
HOWEVER... When I have reloaded the texture as a 4x4 texture, atleast the 4x4 pixels around the top left corner are showing what they should, my guess is that the other pixels are somehow "left behind" and not getting cleared up or something :I