From 9f8f2f673000568362a242d0668e62c26b6eb33f Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Fri, 15 Jul 2022 02:40:22 +0200 Subject: [PATCH] GS-tc: Fix condition is always true warning. Codacy. --- pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index f05f244d17..0bc57599f4 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -965,12 +965,12 @@ void GSTextureCache::InvalidateVideoMem(const GSOffset& off, const GSVector4i& r // (128 pixels) target if (bw > 2 && t->m_TEX0.TBW == bw && t->Inside(bp, bw, psm, rect) && GSUtil::HasCompatibleBits(psm, t->m_TEX0.PSM)) { - u32 rowsize = bw * 8192u; - u32 offset = (u32)((bp - t->m_TEX0.TBP0) * 256); + const u32 rowsize = bw * 8192u; + const u32 offset = (u32)((bp - t->m_TEX0.TBP0) * 256); - if (rowsize > 0 && offset % rowsize == 0) + if (offset % rowsize == 0) { - int y = GSLocalMemory::m_psm[psm].pgs.y * offset / rowsize; + const int y = GSLocalMemory::m_psm[psm].pgs.y * offset / rowsize; GL_CACHE("TC: Dirty in the middle of Target(%s) %d (0x%x->0x%x) pos(%d,%d => %d,%d) bw:%u", to_string(type), t->m_texture ? t->m_texture->GetID() : 0,