Textures are now able to keep their scale even though the sprite is scaled.

This commit is contained in:
Tleety
2016-03-09 22:22:32 +01:00
parent f9935cad42
commit 087facc22e
6 changed files with 29 additions and 7 deletions
+9
View File
@@ -48,6 +48,13 @@ struct SpriteJob : RenderJob
FillColor = fillColor;
FillPercentage = fillPercentage;
if((bool)cSprite["KeepRatioX"] == true) {
ScaleX = Transform::AbsoluteScale(world, cSprite.EntityID).x;
}
if ((bool)cSprite["KeepRatioZ"] == true) {
ScaleY = Transform::AbsoluteScale(world, cSprite.EntityID).y;
}
};
unsigned int TextureID;
@@ -69,6 +76,8 @@ struct SpriteJob : RenderJob
bool Pickable;
bool IsIndicator = false;
bool BlurBackground = false;
float ScaleX = 1;
float ScaleY = 1;
glm::vec4 FillColor = glm::vec4(0);
float FillPercentage = 0.0;