Tweaks
This commit is contained in:
@@ -115,16 +115,6 @@ void MaterialInstance::OnBaseParamsChanged()
|
||||
ParamsChanged();
|
||||
}
|
||||
|
||||
void MaterialInstance::OnUnload()
|
||||
{
|
||||
if (_baseMaterial)
|
||||
{
|
||||
OnBaseUnset();
|
||||
_baseMaterial = nullptr;
|
||||
}
|
||||
Params.Dispose();
|
||||
}
|
||||
|
||||
bool MaterialInstance::IsMaterialInstance() const
|
||||
{
|
||||
return true;
|
||||
@@ -242,7 +232,12 @@ Asset::LoadResult MaterialInstance::load()
|
||||
|
||||
void MaterialInstance::unload(bool isReloading)
|
||||
{
|
||||
OnUnload();
|
||||
if (_baseMaterial)
|
||||
{
|
||||
OnBaseUnset();
|
||||
_baseMaterial = nullptr;
|
||||
}
|
||||
Params.Dispose();
|
||||
}
|
||||
|
||||
AssetChunksFlag MaterialInstance::getChunksToPreload() const
|
||||
|
||||
@@ -49,7 +49,6 @@ private:
|
||||
void OnBaseUnset();
|
||||
void OnBaseUnloaded(Asset* p);
|
||||
void OnBaseParamsChanged();
|
||||
void OnUnload();
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -466,6 +466,17 @@ public:
|
||||
_count++;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified item to the collection.
|
||||
/// </summary>
|
||||
/// <param name="item">The item to add.</param>
|
||||
void Add(T&& item)
|
||||
{
|
||||
EnsureCapacity(_count + 1);
|
||||
Memory::MoveItems(_allocation.Get() + _count, &item, 1);
|
||||
_count++;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified item to the collection.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user