From 139d4fc76e4ddf45179ca5ec5e42c52ef513ea4d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 2 Dec 2020 13:17:27 -0500 Subject: General: Convert PanicAlerts over to fmt equivalent Converts lingering panic alert calls over to the fmt-capable ones. --- Source/Core/VideoBackends/OGL/OGLTexture.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'Source/Core/VideoBackends/OGL/OGLTexture.cpp') diff --git a/Source/Core/VideoBackends/OGL/OGLTexture.cpp b/Source/Core/VideoBackends/OGL/OGLTexture.cpp index 3cdbaca301..6a378f6b86 100644 --- a/Source/Core/VideoBackends/OGL/OGLTexture.cpp +++ b/Source/Core/VideoBackends/OGL/OGLTexture.cpp @@ -42,7 +42,7 @@ GLenum GetGLInternalFormatForTextureFormat(AbstractTextureFormat format, bool st case AbstractTextureFormat::D32F_S8: return GL_DEPTH32F_STENCIL8; default: - PanicAlert("Unhandled texture format."); + PanicAlertFmt("Unhandled texture format."); return storage ? GL_RGBA8 : GL_RGBA; } } @@ -216,12 +216,15 @@ void OGLTexture::Load(u32 level, u32 width, u32 height, u32 row_length, const u8 size_t buffer_size) { if (level >= m_config.levels) - PanicAlert("Texture only has %d levels, can't update level %d", m_config.levels, level); - if (width != std::max(1u, m_config.width >> level) || - height != std::max(1u, m_config.height >> level)) - PanicAlert("size of level %d must be %dx%d, but %dx%d requested", level, - std::max(1u, m_config.width >> level), std::max(1u, m_config.height >> level), width, - height); + PanicAlertFmt("Texture only has {} levels, can't update level {}", m_config.levels, level); + + const auto expected_width = std::max(1U, m_config.width >> level); + const auto expected_height = std::max(1U, m_config.height >> level); + if (width != expected_width || height != expected_height) + { + PanicAlertFmt("Size of level {} must be {}x{}, but {}x{} requested", level, expected_width, + expected_height, width, height); + } const GLenum target = GetGLTarget(); glActiveTexture(GL_MUTABLE_TEXTURE_INDEX); -- cgit v1.2.3