diff options
| author | Anthony <Helios747@users.noreply.github.com> | 2019-11-28 15:03:23 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-28 15:03:23 -0800 |
| commit | 4a0611df5472ea58af2f7960c8fc91db56c68d5f (patch) | |
| tree | 3fc7a9c466cbecdaca0721e6e5d56869fd13ba4b /Source/Core/VideoCommon/VertexLoaderBase.cpp | |
| parent | b5656df7e8c397474a00e7f64822e56bcdf826b6 (diff) | |
| parent | 6fbbc2683eeedf3767ea3d741c62555a30d3ff45 (diff) | |
Merge pull request #8487 from lioncash/video-fmt
VideoCommon: Make use of fmt outside of shader generators
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoaderBase.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderBase.cpp b/Source/Core/VideoCommon/VertexLoaderBase.cpp index 141078f676..883dad31f6 100644 --- a/Source/Core/VideoCommon/VertexLoaderBase.cpp +++ b/Source/Core/VideoCommon/VertexLoaderBase.cpp @@ -11,10 +11,11 @@ #include <string> #include <vector> +#include <fmt/format.h> + #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" -#include "Common/StringUtil.h" #include "VideoCommon/DataReader.h" #include "VideoCommon/VertexLoader.h" @@ -107,37 +108,39 @@ std::string VertexLoaderBase::ToString() const "Inv", }}; - dest += StringFromFormat("%ib skin: %i P: %i %s-%s ", m_VertexSize, (u32)m_VtxDesc.PosMatIdx, - m_VtxAttr.PosElements ? 3 : 2, pos_mode[m_VtxDesc.Position], - pos_formats[m_VtxAttr.PosFormat]); + dest += fmt::format("{}b skin: {} P: {} {}-{} ", m_VertexSize, m_VtxDesc.PosMatIdx, + m_VtxAttr.PosElements ? 3 : 2, pos_mode[m_VtxDesc.Position], + pos_formats[m_VtxAttr.PosFormat]); if (m_VtxDesc.Normal) { - dest += StringFromFormat("Nrm: %i %s-%s ", m_VtxAttr.NormalElements, pos_mode[m_VtxDesc.Normal], - pos_formats[m_VtxAttr.NormalFormat]); + dest += fmt::format("Nrm: {} {}-{} ", m_VtxAttr.NormalElements, pos_mode[m_VtxDesc.Normal], + pos_formats[m_VtxAttr.NormalFormat]); } const std::array<u64, 2> color_mode{{m_VtxDesc.Color0, m_VtxDesc.Color1}}; for (size_t i = 0; i < color_mode.size(); i++) { - if (color_mode[i]) - { - dest += StringFromFormat("C%zu: %i %s-%s ", i, m_VtxAttr.color[i].Elements, - pos_mode[color_mode[i]], color_format[m_VtxAttr.color[i].Comp]); - } + if (color_mode[i] == 0) + continue; + + const auto& color = m_VtxAttr.color[i]; + dest += fmt::format("C{}: {} {}-{} ", i, color.Elements, pos_mode[color_mode[i]], + color_format[color.Comp]); } const std::array<u64, 8> tex_mode{{m_VtxDesc.Tex0Coord, m_VtxDesc.Tex1Coord, m_VtxDesc.Tex2Coord, m_VtxDesc.Tex3Coord, m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, m_VtxDesc.Tex7Coord}}; for (size_t i = 0; i < tex_mode.size(); i++) { - if (tex_mode[i]) - { - dest += StringFromFormat("T%zu: %i %s-%s ", i, m_VtxAttr.texCoord[i].Elements, - pos_mode[tex_mode[i]], pos_formats[m_VtxAttr.texCoord[i].Format]); - } + if (tex_mode[i] == 0) + continue; + + const auto& tex_coord = m_VtxAttr.texCoord[i]; + dest += fmt::format("T{}: {} {}-{} ", i, tex_coord.Elements, pos_mode[tex_mode[i]], + pos_formats[tex_coord.Format]); } - dest += StringFromFormat(" - %i v", m_numLoadedVertices); + dest += fmt::format(" - {} v", m_numLoadedVertices); return dest; } |
