diff options
author | Wolfgang Schupp <w.schupp@a1.net> | 2022-03-30 08:26:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-30 08:26:08 +0200 |
commit | 7e5881c26e4ad69dedec603d3ef6e951f7f3ce5a (patch) | |
tree | 63a3e0ec1275b905175c414a6e9e293be0a9065e | |
parent | 09a30d920af6ac2d8f624f243a1d6e6f23b28749 (diff) | |
parent | 3933dca83e4f8110bd8378a30852943263c1ba61 (diff) |
Merge pull request #21203 from wsnipex/fix_fmt_8.1
Fix fmt 8.1
-rw-r--r-- | xbmc/rendering/gl/RenderSystemGL.h | 46 | ||||
-rw-r--r-- | xbmc/rendering/gles/RenderSystemGLES.h | 62 | ||||
-rw-r--r-- | xbmc/storage/MediaManager.cpp | 2 |
3 files changed, 108 insertions, 2 deletions
diff --git a/xbmc/rendering/gl/RenderSystemGL.h b/xbmc/rendering/gl/RenderSystemGL.h index 52d073220b..2d1be7617b 100644 --- a/xbmc/rendering/gl/RenderSystemGL.h +++ b/xbmc/rendering/gl/RenderSystemGL.h @@ -15,6 +15,8 @@ #include <map> #include <memory> +#include <fmt/format.h> + #include "system_gl.h" enum class ShaderMethodGL @@ -28,6 +30,50 @@ enum class ShaderMethodGL SM_MULTI_BLENDCOLOR }; +template<> +struct fmt::formatter<ShaderMethodGL> : fmt::formatter<std::string_view> +{ + +public: + static constexpr auto toString(ShaderMethodGL method) + { + switch (method) + { + case ShaderMethodGL::SM_DEFAULT: + return "default"; + break; + case ShaderMethodGL::SM_TEXTURE: + return "texture"; + break; + case ShaderMethodGL::SM_TEXTURE_LIM: + return "texture limited"; + break; + case ShaderMethodGL::SM_MULTI: + return "multi"; + break; + case ShaderMethodGL::SM_FONTS: + return "fonts"; + break; + case ShaderMethodGL::SM_TEXTURE_NOBLEND: + return "texture no blending"; + break; + case ShaderMethodGL::SM_MULTI_BLENDCOLOR: + return "multi blend colour"; + break; + default: + return "unknown"; + break; + } + } + + template<typename FormatContext> + constexpr auto format(const ShaderMethodGL& shaderMethod, FormatContext& ctx) + { + auto shaderName = toString(shaderMethod); + return fmt::formatter<std::string_view>::format(shaderName, ctx); + } +}; + class CRenderSystemGL : public CRenderSystemBase { public: diff --git a/xbmc/rendering/gles/RenderSystemGLES.h b/xbmc/rendering/gles/RenderSystemGLES.h index ba39a388bb..7369a61724 100644 --- a/xbmc/rendering/gles/RenderSystemGLES.h +++ b/xbmc/rendering/gles/RenderSystemGLES.h @@ -14,6 +14,8 @@ #include <map> +#include <fmt/format.h> + #include "system_gl.h" enum class ShaderMethodGLES @@ -32,6 +34,65 @@ enum class ShaderMethodGLES SM_TEXTURE_NOALPHA }; +template<> +struct fmt::formatter<ShaderMethodGLES> : fmt::formatter<std::string_view> +{ + +public: + static constexpr auto toString(ShaderMethodGLES method) + { + switch (method) + { + case ShaderMethodGLES::SM_DEFAULT: + return "default"; + break; + case ShaderMethodGLES::SM_TEXTURE: + return "texture"; + break; + case ShaderMethodGLES::SM_MULTI: + return "multi"; + break; + case ShaderMethodGLES::SM_FONTS: + return "fonts"; + break; + case ShaderMethodGLES::SM_TEXTURE_NOBLEND: + return "texture no blending"; + break; + case ShaderMethodGLES::SM_MULTI_BLENDCOLOR: + return "multi blend colour"; + break; + case ShaderMethodGLES::SM_TEXTURE_RGBA: + return "texure rgba"; + break; + case ShaderMethodGLES::SM_TEXTURE_RGBA_OES: + return "texure rgba OES"; + break; + case ShaderMethodGLES::SM_TEXTURE_RGBA_BLENDCOLOR: + return "texture rgba blend colour"; + break; + case ShaderMethodGLES::SM_TEXTURE_RGBA_BOB: + return "texure rgba bob"; + break; + case ShaderMethodGLES::SM_TEXTURE_RGBA_BOB_OES: + return "texure rgba bob OES"; + break; + case ShaderMethodGLES::SM_TEXTURE_NOALPHA: + return "texture no alpha"; + break; + default: + return "unknown"; + break; + } + } + + template<typename FormatContext> + constexpr auto format(const ShaderMethodGLES& shaderMethod, FormatContext& ctx) + { + auto shaderName = toString(shaderMethod); + return fmt::formatter<std::string_view>::format(shaderName, ctx); + } +}; + class CRenderSystemGLES : public CRenderSystemBase { public: @@ -103,4 +164,3 @@ protected: GLint m_viewPort[4]; }; - diff --git a/xbmc/storage/MediaManager.cpp b/xbmc/storage/MediaManager.cpp index 05b7390983..07d66d5192 100644 --- a/xbmc/storage/MediaManager.cpp +++ b/xbmc/storage/MediaManager.cpp @@ -538,7 +538,7 @@ std::string CMediaManager::GetDiskUniqueId(const std::string& devicePath) } std::string strID = StringUtils::Format("removable://{}_{}", info.name, info.serial); - CLog::Log(LOGDEBUG, "GetDiskUniqueId: Got ID {} for {} with path {}", strID, info.type, + CLog::Log(LOGDEBUG, "GetDiskUniqueId: Got ID {} for disc with path {}", strID, CURL::GetRedacted(mediaPath)); return strID; |