Core: Added Listenable class (Made class Listener system generic)

Former-commit-id: 3baed32d6720c6455f50af51f262292ece9943fa
This commit is contained in:
Lynix
2015-05-06 18:17:18 +02:00
parent 3195a50114
commit 44ff678002
11 changed files with 121 additions and 206 deletions

View File

@@ -22,7 +22,7 @@ NzGuillotineImageAtlas::~NzGuillotineImageAtlas() = default;
void NzGuillotineImageAtlas::Clear()
{
m_layers.clear();
NotifyCleared();
Notify(Listener::OnAtlasCleared);
}
void NzGuillotineImageAtlas::Free(NzSparsePtr<const NzRectui> rects, NzSparsePtr<unsigned int> layers, unsigned int count)
@@ -187,7 +187,7 @@ bool NzGuillotineImageAtlas::ResizeLayer(Layer& layer, const NzVector2ui& size)
// On indique à ceux que ça intéresse qu'on a changé de pointeur
// (chose très importante pour ceux qui le stockent)
NotifyLayerChange(layer.image.get(), newImage.get());
Notify(Listener::OnAtlasLayerChange, layer.image.get(), newImage.get());
// Et on ne met à jour le pointeur qu'après (car cette ligne libère également l'ancienne image)
layer.image = std::move(newImage);