1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-07-03 06:24:32 +00:00

set GL textures to always repeat to avoid unnecessary calls to glTexParameteri()

Shouldn't have any visual changes because edge clamp is never actually used
This commit is contained in:
fgenesis 2023-08-25 00:38:36 +02:00
parent 17452f175e
commit d31d320719
5 changed files with 7 additions and 26 deletions

View file

@ -59,7 +59,6 @@ void TileRender::onRender(const RenderState& rs) const
const Vector M1 = Vector(1,1) - M;
const Vector T = C * (1 - F);
unsigned lastTexRepeat = false;
unsigned lastTexId = 0;
const bool renderExtras = renderBorders || RenderObject::renderCollisionShape;
@ -92,12 +91,10 @@ void TileRender::onRender(const RenderState& rs) const
if(const Texture * const tex = et->tex.content())
{
unsigned texid = tex->gltexid;
unsigned rep = tile.flags & TILEFLAG_REPEAT;
if(texid != lastTexId || rep != lastTexRepeat)
if(texid != lastTexId)
{
lastTexId = texid;
lastTexRepeat = rep;
tex->apply(!!rep);
tex->apply();
}
}
else
@ -210,7 +207,6 @@ void TileRender::onRender(const RenderState& rs) const
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
RenderObject::lastTextureApplied = lastTexId;
RenderObject::lastTextureRepeat = !!lastTexRepeat;
}
void TileRender::onUpdate(float dt)