Minor improvements

This commit is contained in:
Wojtek Figat
2024-04-22 18:10:58 +02:00
parent e795a8b037
commit 32b15f90ab
9 changed files with 36 additions and 91 deletions

View File

@@ -15,28 +15,24 @@
class LoadAssetDataTask : public ContentLoadTask
{
private:
WeakAssetReference<BinaryAsset> _asset; // Don't keep ref to the asset (so it can be unloaded if none using it, task will fail then)
AssetChunksFlag _chunks;
FlaxStorage::LockData _dataLock;
public:
/// <summary>
/// Initializes a new instance of the <see cref="LoadAssetDataTask"/> class.
/// </summary>
/// <param name="asset">The asset to load.</param>
/// <param name="chunks">The chunks to load.</param>
LoadAssetDataTask(BinaryAsset* asset, AssetChunksFlag chunks)
: ContentLoadTask(Type::LoadAssetData)
, _asset(asset)
: _asset(asset)
, _chunks(chunks)
, _dataLock(asset->Storage->Lock())
{
}
public:
// [ContentLoadTask]
bool HasReference(Object* obj) const override
{
@@ -44,7 +40,6 @@ public:
}
protected:
// [ContentLoadTask]
Result run() override
{