This commit is contained in:
Wojtek Figat
2021-08-30 11:52:00 +02:00
parent 2b8259eb8a
commit c69e620e04
3 changed files with 16 additions and 3 deletions

View File

@@ -25,7 +25,7 @@ public:
/// <summary>
/// Describes work result value
/// </summary>
DECLARE_ENUM_4(Result, Ok, AssetLoadError, MissingReferences, LoadDataError);
DECLARE_ENUM_5(Result, Ok, AssetLoadError, MissingReferences, LoadDataError, TaskFailed);
private:

View File

@@ -6,6 +6,7 @@
#include "Engine/Content/Asset.h"
#include "Engine/Content/AssetReference.h"
#include "Engine/Content/WeakAssetReference.h"
#include "Engine/Core/Log.h"
#include "Engine/Profiler/ProfilerCPU.h"
/// <summary>
@@ -25,6 +26,19 @@ public:
{
}
~LoadAssetTask()
{
if (Asset)
{
Asset->Locker.Lock();
Asset->_loadFailed = true;
Asset->_isLoaded = false;
LOG(Error, "Loading asset \'{0}\' result: {1}.", ToString(), ToString(Result::TaskFailed));
Asset->_loadingTask = nullptr;
Asset->Locker.Unlock();
}
}
public:
WeakAssetReference<Asset> Asset;
@@ -55,7 +69,6 @@ protected:
return Result::Ok;
}
void OnEnd() override
{
Asset = nullptr;

View File

@@ -236,7 +236,7 @@ bool GDKGamepad::UpdateState()
return false;
}
#else
#elif PLATFORM_GDK
void GDKInput::Init()
{