1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-25 17:53:47 +00:00

only update VBO if texcoords actually change

This commit is contained in:
fgenesis 2023-10-25 01:52:03 +02:00
parent 4623702743
commit 03eeb7f4e9
2 changed files with 14 additions and 2 deletions

View file

@ -132,8 +132,11 @@ void RenderGrid::setDrawOrder(GridDrawOrder ord, bool force)
void RenderGrid::setTexCoords(const TexCoordBox& tc)
{
this->tc = tc;
needVBOUpdate = true;
if(this->tc != tc)
{
this->tc = tc;
needVBOUpdate = true;
}
}

View file

@ -31,6 +31,15 @@ struct TexCoordBox
bool isStandard() const;
void setStandard();
bool operator==(const TexCoordBox& o) const
{
return u1 == o.u1 && v1 == o.v1 && u2 == o.u2 && v2 == o.v2;
}
inline bool operator!=(const TexCoordBox& o) const
{
return !(*this == o);
}
};
enum TextureLoadResult