diff --git a/BBGE/RenderGrid.cpp b/BBGE/RenderGrid.cpp index 5730192..8b62c6c 100644 --- a/BBGE/RenderGrid.cpp +++ b/BBGE/RenderGrid.cpp @@ -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; + } } diff --git a/BBGE/Texture.h b/BBGE/Texture.h index 6469af0..d478db7 100644 --- a/BBGE/Texture.h +++ b/BBGE/Texture.h @@ -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