From 3d9b2aa0055ded7ee74f6e4a73ff54acecf313a9 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 13 Nov 2020 22:33:26 -0500 Subject: VideoCommon: Migrate over to fmt Migrates off the printf-based formatting where applicable. --- Source/Core/VideoCommon/BPFunctions.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'Source/Core/VideoCommon/BPFunctions.cpp') diff --git a/Source/Core/VideoCommon/BPFunctions.cpp b/Source/Core/VideoCommon/BPFunctions.cpp index 6c14528671..52cd8375fd 100644 --- a/Source/Core/VideoCommon/BPFunctions.cpp +++ b/Source/Core/VideoCommon/BPFunctions.cpp @@ -5,6 +5,7 @@ #include "VideoCommon/BPFunctions.h" #include +#include #include "Common/CommonTypes.h" #include "Common/Logging/Log.h" @@ -223,12 +224,12 @@ void OnPixelFormatChange() if (!g_ActiveConfig.bEFBEmulateFormatChanges) return; - auto old_format = g_renderer->GetPrevPixelFormat(); - auto new_format = bpmem.zcontrol.pixel_format; + const auto old_format = g_renderer->GetPrevPixelFormat(); + const auto new_format = bpmem.zcontrol.pixel_format; g_renderer->StorePixelFormat(new_format); - DEBUG_LOG(VIDEO, "pixelfmt: pixel=%d, zc=%d", static_cast(new_format), - static_cast(bpmem.zcontrol.zformat)); + DEBUG_LOG_FMT(VIDEO, "pixelfmt: pixel={}, zc={}", static_cast(new_format), + static_cast(bpmem.zcontrol.zformat)); // no need to reinterpret pixel data in these cases if (new_format == old_format || old_format == PEControl::INVALID_FMT) @@ -291,8 +292,8 @@ void OnPixelFormatChange() break; } - ERROR_LOG(VIDEO, "Unhandled EFB format change: %d to %d", static_cast(old_format), - static_cast(new_format)); + ERROR_LOG_FMT(VIDEO, "Unhandled EFB format change: {} to {}", static_cast(old_format), + static_cast(new_format)); } void SetInterlacingMode(const BPCmd& bp) @@ -304,21 +305,21 @@ void SetInterlacingMode(const BPCmd& bp) { // SDK always sets bpmem.lineptwidth.lineaspect via BPMEM_LINEPTWIDTH // just before this cmd - const char* action[] = {"don't adjust", "adjust"}; - DEBUG_LOG(VIDEO, "BPMEM_FIELDMODE texLOD:%s lineaspect:%s", action[bpmem.fieldmode.texLOD], - action[bpmem.lineptwidth.lineaspect]); + static constexpr std::string_view action[] = {"don't adjust", "adjust"}; + DEBUG_LOG_FMT(VIDEO, "BPMEM_FIELDMODE texLOD:{} lineaspect:{}", action[bpmem.fieldmode.texLOD], + action[bpmem.lineptwidth.lineaspect]); } break; case BPMEM_FIELDMASK: { // Determines if fields will be written to EFB (always computed) - const char* action[] = {"skip", "write"}; - DEBUG_LOG(VIDEO, "BPMEM_FIELDMASK even:%s odd:%s", action[bpmem.fieldmask.even], - action[bpmem.fieldmask.odd]); + static constexpr std::string_view action[] = {"skip", "write"}; + DEBUG_LOG_FMT(VIDEO, "BPMEM_FIELDMASK even:{} odd:{}", action[bpmem.fieldmask.even], + action[bpmem.fieldmask.odd]); } break; default: - ERROR_LOG(VIDEO, "SetInterlacingMode default"); + ERROR_LOG_FMT(VIDEO, "SetInterlacingMode default"); break; } } -- cgit v1.2.3