Avoid skipping of vertex buffer update if called more than once per frame

This commit is contained in:
Benau 2018-04-06 20:38:30 +08:00
parent 22f8095cb0
commit c3354923db

View File

@ -137,7 +137,14 @@ public:
return m_texture_trans;
}
// ------------------------------------------------------------------------
void setUpdateOffset(int offset) { m_update_offset = offset; }
void setUpdateOffset(int offset)
{
// Avoid skipping of vertex buffer update if this function is called
// more than once per frame
if (m_update_offset != -1 && offset > m_update_offset)
return;
m_update_offset = offset;
}
// ------------------------------------------------------------------------
bool isVisible() const { return m_visible; }
// ------------------------------------------------------------------------