Changed: Helper functions (clear, empty) for CTextureId

--HG--
branch : html-improvements
hg/feature/html-improvements
Nimetu 5 years ago
parent 2dee4e41ea
commit 13bdecc3aa

@ -101,6 +101,12 @@ namespace NLGUI
return _TextureId;
}
// Return true if TextureId is not set
bool empty() const { return _TextureId < 0; };
// delete TextureId if set
void clear();
void serial(NLMISC::IStream &f);
private:

@ -1932,6 +1932,16 @@ namespace NLGUI
return _TextureId >= 0;
}
// ***************************************************************************
void CViewRenderer::CTextureId::clear()
{
if (_TextureId >= 0)
{
CViewRenderer::getInstance()->deleteTexture(_TextureId);
_TextureId = -1;
}
}
// ***************************************************************************
void CViewRenderer::CTextureId::serial(NLMISC::IStream &f)
{

Loading…
Cancel
Save