diff options
| author | Lioncash <mathew1800@gmail.com> | 2020-12-02 13:17:27 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2020-12-02 13:38:33 -0500 |
| commit | 139d4fc76e4ddf45179ca5ec5e42c52ef513ea4d (patch) | |
| tree | a639ad5dfd8a1b85eb32d408e2068dce9f41ce00 /Source/Core/VideoBackends/OGL/OGLTexture.cpp | |
| parent | 5abae61a8c7e0e4ac03bb8d3031793037e87fdd3 (diff) | |
General: Convert PanicAlerts over to fmt equivalent
Converts lingering panic alert calls over to the fmt-capable ones.
Diffstat (limited to 'Source/Core/VideoBackends/OGL/OGLTexture.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/OGL/OGLTexture.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
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); |
