mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-05-10 19:13:44 +00:00
simplify RenderObject::renderCall() a bit
This commit is contained in:
parent
4db7990ac2
commit
ac80b3461a
1 changed files with 73 additions and 95 deletions
|
@ -36,9 +36,6 @@ size_t RenderObject::lastTextureApplied = 0;
|
||||||
bool RenderObject::lastTextureRepeat = false;
|
bool RenderObject::lastTextureRepeat = false;
|
||||||
bool RenderObject::renderPaths = false;
|
bool RenderObject::renderPaths = false;
|
||||||
|
|
||||||
const bool RENDEROBJECT_SHAREATTRIBUTES = true;
|
|
||||||
const bool RENDEROBJECT_FASTTRANSFORM = false;
|
|
||||||
|
|
||||||
RenderObjectLayer *RenderObject::rlayer = 0;
|
RenderObjectLayer *RenderObject::rlayer = 0;
|
||||||
|
|
||||||
void RenderObject::toggleAlpha(float t)
|
void RenderObject::toggleAlpha(float t)
|
||||||
|
@ -574,17 +571,9 @@ void RenderObject::renderCall()
|
||||||
{
|
{
|
||||||
position += offset;
|
position += offset;
|
||||||
|
|
||||||
|
|
||||||
if (!RENDEROBJECT_FASTTRANSFORM)
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
if (!RENDEROBJECT_SHAREATTRIBUTES)
|
|
||||||
{
|
|
||||||
glPushAttrib(GL_ALL_ATTRIB_BITS);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!RENDEROBJECT_FASTTRANSFORM)
|
|
||||||
{
|
|
||||||
if (layer != LR_NONE)
|
if (layer != LR_NONE)
|
||||||
{
|
{
|
||||||
RenderObjectLayer *l = &core->renderObjectLayers[layer];
|
RenderObjectLayer *l = &core->renderObjectLayers[layer];
|
||||||
|
@ -666,9 +655,6 @@ void RenderObject::renderCall()
|
||||||
glTranslatef(internalOffset.x, internalOffset.y, internalOffset.z);
|
glTranslatef(internalOffset.x, internalOffset.y, internalOffset.z);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Children::iterator i = children.begin(); i != children.end(); i++)
|
for (Children::iterator i = children.begin(); i != children.end(); i++)
|
||||||
{
|
{
|
||||||
if (!(*i)->isDead() && (*i)->renderBeforeParent)
|
if (!(*i)->isDead() && (*i)->renderBeforeParent)
|
||||||
|
@ -676,12 +662,12 @@ void RenderObject::renderCall()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
Vector col = color;
|
||||||
if (rlayer)
|
if (rlayer)
|
||||||
glColor4f(color.x * rlayer->color.x, color.y * rlayer->color.y, color.z * rlayer->color.z, alpha.x*alphaMod);
|
col *= rlayer->color;
|
||||||
else
|
|
||||||
glColor4f(color.x, color.y, color.z, alpha.x*alphaMod);
|
glColor4f(col.x, col.y, col.z, alpha.x*alphaMod);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (texture)
|
if (texture)
|
||||||
|
@ -728,11 +714,6 @@ void RenderObject::renderCall()
|
||||||
onRender();
|
onRender();
|
||||||
|
|
||||||
|
|
||||||
if (!RENDEROBJECT_SHAREATTRIBUTES)
|
|
||||||
{
|
|
||||||
glPopAttrib();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Children::iterator i = children.begin(); i != children.end(); i++)
|
for (Children::iterator i = children.begin(); i != children.end(); i++)
|
||||||
{
|
{
|
||||||
if (!(*i)->isDead() && !(*i)->renderBeforeParent)
|
if (!(*i)->isDead() && !(*i)->renderBeforeParent)
|
||||||
|
@ -740,10 +721,7 @@ void RenderObject::renderCall()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!RENDEROBJECT_FASTTRANSFORM)
|
|
||||||
{
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
position -= offset;
|
position -= offset;
|
||||||
|
|
Loading…
Add table
Reference in a new issue