From 313fe1ca2c78723995e6a08e967357b2942210eb Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Wed, 24 Aug 2022 03:41:51 +0200 Subject: [PATCH] GS: Fix variable initializations. Codacy Warning: Variable 'variable' is assigned in constructor body. Consider performing initialization in initialization list. --- pcsx2/GS/Renderers/HW/GSTextureCache.cpp | 3 +-- pcsx2/GS/Renderers/SW/GSTextureCacheSW.cpp | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp index dd6995b4cb..e1061a0d21 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureCache.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureCache.cpp @@ -2423,13 +2423,12 @@ bool GSTextureCache::Source::ClutMatch(const PaletteKey& palette_key) GSTextureCache::Target::Target(const GIFRegTEX0& TEX0, const bool depth_supported, const int type) : m_type(type) , m_used(false) + , m_valid(GSVector4i::zero()) , m_depth_supported(depth_supported) { m_TEX0 = TEX0; m_32_bits_fmt |= (GSLocalMemory::m_psm[TEX0.PSM].trbpp != 16); m_dirty_alpha = GSLocalMemory::m_psm[TEX0.PSM].trbpp != 24; - - m_valid = GSVector4i::zero(); } void GSTextureCache::Target::Update() diff --git a/pcsx2/GS/Renderers/SW/GSTextureCacheSW.cpp b/pcsx2/GS/Renderers/SW/GSTextureCacheSW.cpp index 46c2cd16df..46b03d42e1 100644 --- a/pcsx2/GS/Renderers/SW/GSTextureCacheSW.cpp +++ b/pcsx2/GS/Renderers/SW/GSTextureCacheSW.cpp @@ -135,15 +135,14 @@ void GSTextureCacheSW::IncAge() // GSTextureCacheSW::Texture::Texture(u32 tw0, const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA) - : m_buff(NULL) + : m_TEX0(TEX0) + , m_TEXA(TEXA) + , m_buff(NULL) , m_tw(tw0) , m_age(0) , m_complete(false) , m_p2t(NULL) { - m_TEX0 = TEX0; - m_TEXA = TEXA; - if (m_tw == 0) { m_tw = std::max(m_TEX0.TW, GSLocalMemory::m_psm[m_TEX0.PSM].pal == 0 ? 3 : 5); // makes one row 32 bytes at least, matches the smallest block size that is allocated for m_buff