diff --git a/Source/Editor/Cooker/Steps/CookAssetsStep.cpp b/Source/Editor/Cooker/Steps/CookAssetsStep.cpp index 85f4a4126..16df276f7 100644 --- a/Source/Editor/Cooker/Steps/CookAssetsStep.cpp +++ b/Source/Editor/Cooker/Steps/CookAssetsStep.cpp @@ -35,6 +35,7 @@ #include "Engine/Engine/Base/GameBase.h" #include "Engine/Engine/Globals.h" #include "Engine/Tools/TextureTool/TextureTool.h" +#include "Engine/Scripting/Enums.h" #if PLATFORM_TOOLS_WINDOWS #include "Engine/Platform/Windows/WindowsPlatformSettings.h" #endif @@ -647,7 +648,7 @@ bool ProcessTextureBase(CookAssetsStep::AssetCookData& data) // Convert texture data to the target format if (TextureTool::Convert(textureDataTmp1, *textureData, targetFormat)) { - LOG(Error, "Failed to convert texture {0} from format {1} to {2}", asset->ToString(), (int32)format, (int32)targetFormat); + LOG(Error, "Failed to convert texture {0} from format {1} to {2}", asset->ToString(), ScriptingEnum::ToString(format), ScriptingEnum::ToString(targetFormat)); return true; } textureData = &textureDataTmp1; diff --git a/Source/Engine/Graphics/GPUBuffer.cpp b/Source/Engine/Graphics/GPUBuffer.cpp index 6aaa939b3..6e400bbdd 100644 --- a/Source/Engine/Graphics/GPUBuffer.cpp +++ b/Source/Engine/Graphics/GPUBuffer.cpp @@ -12,6 +12,7 @@ #include "Engine/Debug/Exceptions/InvalidOperationException.h" #include "Engine/Debug/Exceptions/ArgumentNullException.h" #include "Engine/Debug/Exceptions/ArgumentOutOfRangeException.h" +#include "Engine/Scripting/Enums.h" #include "Engine/Threading/ThreadPoolTask.h" #include "Engine/Threading/Threading.h" @@ -107,7 +108,7 @@ String GPUBufferDescription::ToString() const Size, Stride, flags, - (int32)Format, + ScriptingEnum::ToString(Format), (int32)Usage); } diff --git a/Source/Engine/Graphics/Materials/MaterialParams.cpp b/Source/Engine/Graphics/Materials/MaterialParams.cpp index 0788a59ab..c9adfa730 100644 --- a/Source/Engine/Graphics/Materials/MaterialParams.cpp +++ b/Source/Engine/Graphics/Materials/MaterialParams.cpp @@ -273,7 +273,7 @@ void MaterialParameter::SetValue(const Variant& value) } if (invalidType) { - LOG(Error, "Invalid material parameter value type {0} to set (param type: {1})", value.Type, ScriptingEnum::ToString(_type)); + LOG(Error, "Invalid material parameter value type {0} to set (param type: {1})", value.Type, ScriptingEnum::ToString(_type)); } } @@ -530,7 +530,7 @@ bool MaterialParameter::operator==(const MaterialParameter& other) const String MaterialParameter::ToString() const { - return String::Format(TEXT("\'{0}\' ({1}:{2}:{3})"), _name, ScriptingEnum::ToString(_type), _paramId, _isPublic); + return String::Format(TEXT("\'{0}\' ({1}:{2}:{3})"), _name, ScriptingEnum::ToString(_type), _paramId, _isPublic); } MaterialParameter* MaterialParams::Get(const Guid& id) diff --git a/Source/Engine/Graphics/Textures/GPUTexture.cpp b/Source/Engine/Graphics/Textures/GPUTexture.cpp index 921941304..ccdf4be95 100644 --- a/Source/Engine/Graphics/Textures/GPUTexture.cpp +++ b/Source/Engine/Graphics/Textures/GPUTexture.cpp @@ -15,6 +15,7 @@ #include "Engine/Graphics/GPULimits.h" #include "Engine/Threading/ThreadPoolTask.h" #include "Engine/Graphics/GPUDevice.h" +#include "Engine/Scripting/Enums.h" namespace { @@ -187,7 +188,7 @@ String GPUTextureDescription::ToString() const ArraySize, ::ToString(Dimensions), MipLevels, - (int32)Format, + ScriptingEnum::ToString(Format), ::ToString(MultiSampleLevel), flags, (int32)Usage); diff --git a/Source/Engine/Graphics/Textures/StreamingTexture.cpp b/Source/Engine/Graphics/Textures/StreamingTexture.cpp index 8e19b9f39..4793d340e 100644 --- a/Source/Engine/Graphics/Textures/StreamingTexture.cpp +++ b/Source/Engine/Graphics/Textures/StreamingTexture.cpp @@ -9,6 +9,7 @@ #include "Engine/Graphics/GPUDevice.h" #include "Engine/Graphics/RenderTools.h" #include "Engine/Graphics/Async/Tasks/GPUUploadTextureMipTask.h" +#include "Engine/Scripting/Enums.h" TextureHeader_Deprecated::TextureHeader_Deprecated() { @@ -354,7 +355,7 @@ protected: // Ensure that texture has been allocated before this task and has proper format if (!texture->IsAllocated() || texture->Format() != _streamingTexture->GetHeader()->Format) { - LOG(Error, "Cannot stream texture {0} (streaming format: {1})", texture->ToString(), (int32)_streamingTexture->GetHeader()->Format); + LOG(Error, "Cannot stream texture {0} (streaming format: {1})", texture->ToString(), ScriptingEnum::ToString(_streamingTexture->GetHeader()->Format)); return Result::Failed; } diff --git a/Source/Engine/Graphics/Textures/TextureBase.cpp b/Source/Engine/Graphics/Textures/TextureBase.cpp index ab249ec76..408eb8dfb 100644 --- a/Source/Engine/Graphics/Textures/TextureBase.cpp +++ b/Source/Engine/Graphics/Textures/TextureBase.cpp @@ -11,6 +11,7 @@ #include "Engine/Debug/Exceptions/InvalidOperationException.h" #include "Engine/Profiler/ProfilerCPU.h" #include "Engine/Content/Factories/BinaryAssetFactory.h" +#include "Engine/Scripting/Enums.h" #include "Engine/Tools/TextureTool/TextureTool.h" #include "Engine/Threading/Threading.h" @@ -112,7 +113,7 @@ bool TextureMipData::GetPixels(Array& pixels, int32 width, int32 height } return false; } - LOG(Error, "Unsupported texture data format {0}.", (int32)format); + LOG(Error, "Unsupported texture data format {0}.", ScriptingEnum::ToString(format)); return true; } } @@ -161,7 +162,7 @@ bool TextureMipData::GetPixels(Array& pixels, int32 width, int32 height, } return false; } - LOG(Error, "Unsupported texture data format {0}.", (int32)format); + LOG(Error, "Unsupported texture data format {0}.", ScriptingEnum::ToString(format)); return true; } } @@ -453,7 +454,7 @@ bool TextureBase::SetPixels(const Span& pixels, int32 mipIndex, int32 a } if (error) { - LOG(Error, "Unsupported texture data format {0}.", (int32)format); + LOG(Error, "Unsupported texture data format {0}.", ScriptingEnum::ToString(format)); return true; } @@ -531,7 +532,7 @@ bool TextureBase::SetPixels(const Span& pixels, int32 mipIndex, int32 arr } if (error) { - LOG(Error, "Unsupported texture data format {0}.", (int32)format); + LOG(Error, "Unsupported texture data format {0}.", ScriptingEnum::ToString(format)); return true; } @@ -844,7 +845,7 @@ bool TextureBase::InitData::GenerateMip(int32 mipIndex, bool linear) break; } default: - LOG(Error, "Unsupported texture data format {0}.", (int32)Format); + LOG(Error, "Unsupported texture data format {0}.", ScriptingEnum::ToString(Format)); return true; } } diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp index aa7cd53ee..d78155fc8 100644 --- a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp +++ b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp @@ -34,6 +34,7 @@ #include "Engine/Utilities/StringConverter.h" #include "Engine/Profiler/ProfilerCPU.h" #include "Engine/Threading/Threading.h" +#include "Engine/Scripting/Enums.h" #if !USE_EDITOR && (PLATFORM_WINDOWS || PLATFORM_LINUX) #include "Engine/Core/Config/PlatformSettings.h" @@ -1380,7 +1381,7 @@ PixelFormat GPUDeviceVulkan::GetClosestSupportedPixelFormat(PixelFormat format, #if !BUILD_RELEASE if (format != remap) { - LOG(Warning, "Unsupported Vulkan format {0}. Remapping to {1}", (int32)format, (int32)remap); + LOG(Warning, "Unsupported Vulkan format {0}. Remapping to {1}", ScriptingEnum::ToString(format), ScriptingEnum::ToString(remap)); format = GetClosestSupportedPixelFormat(remap, flags, optimalTiling); } #endif diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.cpp index 977ba4863..f3d4cfd4d 100644 --- a/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.cpp +++ b/Source/Engine/GraphicsDevice/Vulkan/GPUSwapChainVulkan.cpp @@ -10,6 +10,7 @@ #include "CmdBufferVulkan.h" #include "Engine/Core/Log.h" #include "Engine/Graphics/GPULimits.h" +#include "Engine/Scripting/Enums.h" void BackBufferVulkan::Setup(GPUSwapChainVulkan* window, VkImage backbuffer, PixelFormat format, VkExtent3D extent) { @@ -231,13 +232,13 @@ bool GPUSwapChainVulkan::CreateSwapChain(int32 width, int32 height) if (!found) { - LOG(Warning, "Requested pixel format {0} not supported by this swapchain. Falling back to supported swapchain formats...", (uint32)resultFormat); + LOG(Warning, "Requested pixel format {0} not supported by this swapchain. Falling back to supported swapchain formats...", ScriptingEnum::ToString(resultFormat)); resultFormat = PixelFormat::Unknown; } } else { - LOG(Warning, "Requested pixel format {0} is not supported by this Vulkan implementation", (uint32)resultFormat); + LOG(Warning, "Requested pixel format {0} is not supported by this Vulkan implementation", ScriptingEnum::ToString(resultFormat)); resultFormat = PixelFormat::Unknown; } } diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUTextureVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUTextureVulkan.cpp index 1e28cc32f..67a1a22c2 100644 --- a/Source/Engine/GraphicsDevice/Vulkan/GPUTextureVulkan.cpp +++ b/Source/Engine/GraphicsDevice/Vulkan/GPUTextureVulkan.cpp @@ -9,6 +9,7 @@ #include "Engine/Core/Log.h" #include "Engine/Graphics/PixelFormatExtensions.h" #include "Engine/Graphics/Textures/TextureData.h" +#include "Engine/Scripting/Enums.h" void GPUTextureViewVulkan::Init(GPUDeviceVulkan* device, ResourceOwnerVulkan* owner, VkImage image, int32 totalMipLevels, PixelFormat format, MSAALevel msaa, VkExtent3D extent, VkImageViewType viewType, int32 mipLevels, int32 firstMipIndex, int32 arraySize, int32 firstArraySlice, bool readOnlyDepth) { @@ -241,7 +242,7 @@ bool GPUTextureVulkan::OnInit() _desc.Format = _device->GetClosestSupportedPixelFormat(format, _desc.Flags, optimalTiling); if (_desc.Format == PixelFormat::Unknown) { - LOG(Error, "Unsupported texture format {0}.", (int32)format); + LOG(Error, "Unsupported texture format {0}.", ScriptingEnum::ToString(format)); return true; }