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