Various code fixes and tweaks

This commit is contained in:
Wojtek Figat
2023-07-02 15:46:29 +02:00
parent 0d7e7edf80
commit 04963fef18
13 changed files with 26 additions and 24 deletions

View File

@@ -105,12 +105,12 @@ public:
/// <param name="other">The other.</param>
AssetReference(const AssetReference& other)
{
OnSet(other.Get());
OnSet(other._asset);
}
AssetReference(AssetReference&& other)
{
OnSet(other.Get());
OnSet(other._asset);
other.OnSet(nullptr);
}
@@ -118,7 +118,7 @@ public:
{
if (&other != this)
{
OnSet(other.Get());
OnSet(other._asset);
other.OnSet(nullptr);
}
return *this;
@@ -134,19 +134,19 @@ public:
public:
FORCE_INLINE AssetReference& operator=(const AssetReference& other)
{
OnSet(other.Get());
OnSet(other._asset);
return *this;
}
FORCE_INLINE AssetReference& operator=(T* other)
{
OnSet(other);
OnSet((Asset*)other);
return *this;
}
FORCE_INLINE AssetReference& operator=(const Guid& id)
{
OnSet((T*)::LoadAsset(id, T::TypeInitializer));
OnSet(::LoadAsset(id, T::TypeInitializer));
return *this;
}

View File

@@ -3,6 +3,7 @@
#pragma once
#include "ModelBase.h"
#include "Engine/Core/Collections/Dictionary.h"
#include "Engine/Graphics/Models/Config.h"
#include "Engine/Graphics/Models/SkeletonData.h"
#include "Engine/Graphics/Models/SkinnedModelLOD.h"
@@ -298,7 +299,7 @@ public:
// Skeleton asset id to use for remapping.
API_FIELD() Guid SkeletonAsset;
// Skeleton nodes remapping table (maps this skeleton node name to other skeleton node).
API_FIELD() Dictionary<String, String, HeapAllocation> NodesMapping;
API_FIELD() Dictionary<String, String> NodesMapping;
};
// Gets or sets the skeleton retarget entries (accessed in Editor only).
API_PROPERTY() const Array<SkeletonRetarget>& GetSkeletonRetargets() const { return _skeletonRetargets; }

View File

@@ -143,7 +143,7 @@ public:
}
FORCE_INLINE SoftAssetReference& operator=(T* other)
{
OnSet(other);
OnSet((Asset*)other);
return *this;
}
FORCE_INLINE SoftAssetReference& operator=(const Guid& id)

View File

@@ -127,13 +127,13 @@ public:
FORCE_INLINE WeakAssetReference& operator=(T* other)
{
OnSet(other);
OnSet((Asset*)other);
return *this;
}
FORCE_INLINE WeakAssetReference& operator=(const Guid& id)
{
OnSet((T*)::LoadAsset(id, T::TypeInitializer));
OnSet((Asset*)::LoadAsset(id, T::TypeInitializer));
return *this;
}