From 1f6d83711719fcf8c8d99d93f7581d1737801815 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 5 Sep 2025 08:40:13 +0200 Subject: [PATCH] Fix regression from 6d05bf16b15c5021a3b1177561b90f846c58849d --- Source/Engine/Content/Asset.cpp | 2 +- Source/Engine/Content/JsonAsset.cpp | 2 +- Source/Engine/Graphics/Models/MeshBase.cpp | 2 +- Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Engine/Content/Asset.cpp b/Source/Engine/Content/Asset.cpp index 1ba0039bb..cb711013b 100644 --- a/Source/Engine/Content/Asset.cpp +++ b/Source/Engine/Content/Asset.cpp @@ -279,7 +279,7 @@ void Asset::OnDeleteObject() const bool wasMarkedToDelete = _deleteFileOnUnload != 0; #if USE_EDITOR - const String path = wasMarkedToDelete ? GetPath() : StringView::Empty; + const String path = wasMarkedToDelete ? String(GetPath()) : String::Empty; #endif const Guid id = GetID(); diff --git a/Source/Engine/Content/JsonAsset.cpp b/Source/Engine/Content/JsonAsset.cpp index 4b5ee7b63..1474933b6 100644 --- a/Source/Engine/Content/JsonAsset.cpp +++ b/Source/Engine/Content/JsonAsset.cpp @@ -180,7 +180,7 @@ bool JsonAssetBase::Save(const StringView& path) _isResaving = false; // Save json to file - if (File::WriteAllBytes(path.HasChars() ? path : StringView(GetPath()), (byte*)buffer.GetString(), (int32)buffer.GetSize())) + if (File::WriteAllBytes(path.HasChars() ? path : GetPath(), (byte*)buffer.GetString(), (int32)buffer.GetSize())) { LOG(Error, "Cannot save \'{0}\'", ToString()); return true; diff --git a/Source/Engine/Graphics/Models/MeshBase.cpp b/Source/Engine/Graphics/Models/MeshBase.cpp index c62820748..3434cd91a 100644 --- a/Source/Engine/Graphics/Models/MeshBase.cpp +++ b/Source/Engine/Graphics/Models/MeshBase.cpp @@ -444,7 +444,7 @@ bool MeshBase::Init(uint32 vertices, uint32 triangles, const ArrayGetPath(); + const String modelPath = _model->GetPath(); #define MESH_BUFFER_NAME(postfix) modelPath + TEXT(postfix) #else #define MESH_BUFFER_NAME(postfix) String::Empty diff --git a/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.cpp b/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.cpp index 813ec9a0c..eae1f9882 100644 --- a/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.cpp +++ b/Source/Engine/Graphics/Shaders/Cache/ShaderAssetBase.cpp @@ -217,7 +217,7 @@ bool ShaderAssetBase::LoadShaderCache(ShaderCacheResult& result) && parent->HasChunk(SHADER_FILE_CHUNK_SOURCE)) { result.Data.Release(); - const String parentPath = parent->GetPath(); + const StringView parentPath = parent->GetPath(); const Guid parentID = parent->GetID(); LOG(Info, "Compiling shader '{0}':{1}...", parentPath, parentID);