Fixes and tweaks
This commit is contained in:
@@ -125,7 +125,7 @@ void AudioClip::StreamingTask::OnEnd()
|
||||
{
|
||||
ASSERT(_asset->_streamingTask == this);
|
||||
_asset->_streamingTask = nullptr;
|
||||
_asset.Unlink();
|
||||
_asset = nullptr;
|
||||
}
|
||||
_dataLock.Release();
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ protected:
|
||||
{
|
||||
ASSERT(_asset->_streamingTask == this);
|
||||
_asset->_streamingTask = nullptr;
|
||||
_asset.Unlink();
|
||||
_asset = nullptr;
|
||||
}
|
||||
_dataLock.Release();
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ protected:
|
||||
{
|
||||
ASSERT(_asset->_streamingTask == this);
|
||||
_asset->_streamingTask = nullptr;
|
||||
_asset.Unlink();
|
||||
_asset = nullptr;
|
||||
}
|
||||
_dataLock.Release();
|
||||
|
||||
|
||||
@@ -491,7 +491,7 @@ protected:
|
||||
void OnEnd() override
|
||||
{
|
||||
_dataLock.Release();
|
||||
_asset.Unlink();
|
||||
_asset = nullptr;
|
||||
|
||||
// Base
|
||||
ContentLoadTask::OnEnd();
|
||||
|
||||
@@ -82,7 +82,7 @@ protected:
|
||||
void OnEnd() override
|
||||
{
|
||||
_dataLock.Release();
|
||||
_asset.Unlink();
|
||||
_asset = nullptr;
|
||||
|
||||
// Base
|
||||
ContentLoadTask::OnEnd();
|
||||
|
||||
@@ -68,7 +68,7 @@ protected:
|
||||
|
||||
void OnEnd() override
|
||||
{
|
||||
_asset.Unlink();
|
||||
_asset = nullptr;
|
||||
|
||||
// Base
|
||||
ContentLoadTask::OnEnd();
|
||||
|
||||
@@ -66,14 +66,6 @@ public:
|
||||
return _asset ? _asset->GetOrCreateManagedInstance() : nullptr;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clears the asset reference.
|
||||
/// </summary>
|
||||
FORCE_INLINE void Unlink()
|
||||
{
|
||||
OnSet(nullptr);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the asset property value as string.
|
||||
/// </summary>
|
||||
@@ -103,7 +95,8 @@ protected:
|
||||
{
|
||||
ASSERT(_asset == asset);
|
||||
Unload();
|
||||
Unlink();
|
||||
asset->OnUnloaded.Unbind<WeakAssetReferenceBase, &WeakAssetReferenceBase::OnAssetUnloaded>(this);
|
||||
asset = nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -259,13 +259,13 @@ void GameBaseImpl::OnSplashScreenEnd()
|
||||
{
|
||||
// Hide splash screen
|
||||
SplashScreenTime = 0;
|
||||
SplashScreen.Unlink();
|
||||
SplashScreen = nullptr;
|
||||
MainRenderTask::Instance->PostRender.Unbind(&OnPostRender);
|
||||
|
||||
// Load the first scene
|
||||
LOG(Info, "Loading the first scene");
|
||||
const auto sceneId = FirstScene ? FirstScene.GetID() : Guid::Empty;
|
||||
FirstScene.Unlink();
|
||||
FirstScene = nullptr;
|
||||
if (Level::LoadSceneAsync(sceneId))
|
||||
{
|
||||
LOG(Fatal, "Cannot load the first scene.");
|
||||
|
||||
@@ -75,12 +75,8 @@ public:
|
||||
|
||||
GPUResourceProperty& operator=(const GPUResourceProperty& other)
|
||||
{
|
||||
// Protect against invalid self-assignment
|
||||
if (this != &other)
|
||||
{
|
||||
Set(other.Get());
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -158,7 +154,6 @@ public:
|
||||
/// <param name="value">Value to assign</param>
|
||||
void Set(T* value)
|
||||
{
|
||||
// Check if value will change
|
||||
if (_resource != value)
|
||||
{
|
||||
// Remove reference from the old one
|
||||
@@ -179,7 +174,6 @@ public:
|
||||
/// </summary>
|
||||
void Unlink()
|
||||
{
|
||||
// Check if value will change
|
||||
if (_resource)
|
||||
{
|
||||
// Remove reference from the old one
|
||||
@@ -194,10 +188,7 @@ private:
|
||||
{
|
||||
if (_resource)
|
||||
{
|
||||
// Unlink
|
||||
_resource = nullptr;
|
||||
|
||||
// Fire event
|
||||
OnUnload(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#define ENSURE_CAN_COOK \
|
||||
if (Physics::GetCooking() == nullptr) \
|
||||
{ \
|
||||
LOG(Warning, "Physics collisions cooking is disabled at runtime. Enable Physics Settings option SupportCookingAtRuntime to use terrain generation at runtime."); \
|
||||
LOG(Warning, "Physics collisions cooking is disabled at runtime. Enable Physics Settings option SupportCookingAtRuntime to use collision generation at runtime."); \
|
||||
return true; \
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user