Optimization and tweaks

This commit is contained in:
Wojtek Figat
2021-04-29 23:20:37 +02:00
parent e2789214ae
commit 05f919c50f
36 changed files with 100 additions and 133 deletions

View File

@@ -13,10 +13,6 @@
/// </summary>
class LoadAssetTask : public ContentLoadTask
{
private:
WeakAssetReference<Asset> _asset;
public:
/// <summary>
@@ -25,27 +21,20 @@ public:
/// <param name="asset">The asset to load.</param>
LoadAssetTask(Asset* asset)
: ContentLoadTask(Type::LoadAsset)
, _asset(asset)
, Asset(asset)
{
}
public:
/// <summary>
/// Gets the asset.
/// </summary>
/// <returns>The asset.</returns>
FORCE_INLINE Asset* GetAsset() const
{
return _asset.Get();
}
WeakAssetReference<Asset> Asset;
public:
// [ContentLoadTask]
bool HasReference(Object* obj) const override
{
return obj == _asset;
return obj == Asset;
}
protected:
@@ -55,7 +44,8 @@ protected:
{
PROFILE_CPU();
AssetReference<Asset> ref = _asset.Get();
// Keep valid ref to the asset
AssetReference<::Asset> ref = Asset.Get();
if (ref == nullptr)
return Result::MissingReferences;
@@ -68,7 +58,7 @@ protected:
void OnEnd() override
{
_asset = nullptr;
Asset = nullptr;
// Base
ContentLoadTask::OnEnd();