mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-11-25 09:44:02 +00:00
make RenderObject::scale not modified during rendering
This commit is contained in:
parent
7a5a5feb39
commit
f4147b99c4
5 changed files with 6 additions and 12 deletions
|
@ -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)
|
||||
|
|
|
@ -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++)
|
||||
|
|
|
@ -253,7 +253,7 @@ public:
|
|||
|
||||
|
||||
InterpolatedVector position;
|
||||
mutable InterpolatedVector scale;
|
||||
InterpolatedVector scale;
|
||||
InterpolatedVector color, alpha;
|
||||
mutable InterpolatedVector rotation;
|
||||
InterpolatedVector offset, rotationOffset, internalOffset, beforeScaleOffset;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ struct RenderState
|
|||
GPUState& gpu;
|
||||
|
||||
Vector color;
|
||||
Vector scale;
|
||||
float alpha;
|
||||
int pass;
|
||||
|
||||
|
|
Loading…
Reference in a new issue