Fixed crash when loading "small" images into atlas

Former-commit-id: e34c26159a663a5680658d6312993147a6d804ee
This commit is contained in:
Lynix
2015-01-17 21:42:23 +01:00
parent a89adfe551
commit 91912463fa

View File

@@ -76,12 +76,8 @@ unsigned int NzGuillotineImageAtlas::GetLayerCount() const
bool NzGuillotineImageAtlas::Insert(const NzImage& image, NzRectui* rect, bool* flipped, unsigned int* layerIndex)
{
if (m_layers.empty())
{
// On créé une première couche s'il n'y en a pas
m_layers.resize(1);
Layer& layer = m_layers.back();
layer.binPack.Reset(s_atlasStartSize, s_atlasStartSize);
}
// Cette fonction ne fait qu'insérer un rectangle de façon virtuelle, l'insertion des images se fait après
for (unsigned int i = 0; i < m_layers.size(); ++i)