diff --git a/Aquaria/Entity.cpp b/Aquaria/Entity.cpp index d8b81a8..33d7185 100644 --- a/Aquaria/Entity.cpp +++ b/Aquaria/Entity.cpp @@ -2363,15 +2363,9 @@ void Entity::render(const RenderState& rsold) const if(renderPass != RENDER_ALL && rsold.pass != renderPass) return; - InterpolatedVector bscale = scale; - - scale *= flipScale; - - - - RenderState rs(rsold); rs.color *= color; + rs.scale *= flipScale; if (multColor.isInterpolating()) rs.color *= multColor; rs.alpha *= alpha.x; @@ -2393,8 +2387,6 @@ void Entity::render(const RenderState& rsold) const rs.pass = RENDER_ALL; Quad::render(rs); - - scale = bscale; } void Entity::doGlint(const Vector &position, const Vector &scale, const std::string &tex, BlendType bt) diff --git a/BBGE/RenderObject.cpp b/BBGE/RenderObject.cpp index 8178867..c22b4df 100644 --- a/BBGE/RenderObject.cpp +++ b/BBGE/RenderObject.cpp @@ -567,7 +567,8 @@ void RenderObject::renderCall(const RenderState& rs, const Vector& renderAt) con } glTranslatef(beforeScaleOffset.x, beforeScaleOffset.y, beforeScaleOffset.z); - glScalef(scale.x, scale.y, 1); + const Vector renderScale = scale * rs.scale; + glScalef(renderScale.x, renderScale.y, 1); glTranslatef(internalOffset.x, internalOffset.y, internalOffset.z); for (Children::const_iterator i = children.begin(); i != children.end(); i++) diff --git a/BBGE/RenderObject.h b/BBGE/RenderObject.h index e353bbe..92087e8 100644 --- a/BBGE/RenderObject.h +++ b/BBGE/RenderObject.h @@ -253,7 +253,7 @@ public: InterpolatedVector position; - mutable InterpolatedVector scale; + InterpolatedVector scale; InterpolatedVector color, alpha; mutable InterpolatedVector rotation; InterpolatedVector offset, rotationOffset, internalOffset, beforeScaleOffset; diff --git a/BBGE/RenderState.cpp b/BBGE/RenderState.cpp index 8f49ab6..db50e78 100644 --- a/BBGE/RenderState.cpp +++ b/BBGE/RenderState.cpp @@ -4,7 +4,7 @@ RenderState::RenderState(GPUState &gpu) - : gpu(gpu), color(1,1,1), alpha(1), pass(0) + : gpu(gpu), color(1,1,1), scale(1,1), alpha(1), pass(0) , forceRenderBorder(false), forceRenderCenter(false), renderBorderAlpha(1) { } diff --git a/BBGE/RenderState.h b/BBGE/RenderState.h index fa60ac8..8c23e0b 100644 --- a/BBGE/RenderState.h +++ b/BBGE/RenderState.h @@ -26,6 +26,7 @@ struct RenderState GPUState& gpu; Vector color; + Vector scale; float alpha; int pass;