mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-11-29 03:33:48 +00:00
only update VBO if texcoords actually change
This commit is contained in:
parent
4623702743
commit
03eeb7f4e9
2 changed files with 14 additions and 2 deletions
|
@ -131,10 +131,13 @@ void RenderGrid::setDrawOrder(GridDrawOrder ord, bool force)
|
|||
}
|
||||
|
||||
void RenderGrid::setTexCoords(const TexCoordBox& tc)
|
||||
{
|
||||
if(this->tc != tc)
|
||||
{
|
||||
this->tc = tc;
|
||||
needVBOUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RenderGrid::render(const RenderState& rs) const
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue