From 1766530af188a1b3abd35c62afc317f126d0b04c Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 18 Jan 2025 23:21:13 +0100 Subject: [PATCH] Common: improve Mat_CrossHair_f() readability Remove unnecessary indentation level. --- src/common/callback.cpp | 63 ++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/src/common/callback.cpp b/src/common/callback.cpp index 213dc015..370061b2 100644 --- a/src/common/callback.cpp +++ b/src/common/callback.cpp @@ -306,41 +306,40 @@ void Mat_CrossHair_f(const CCommand& args) { const CMaterialGlue* const materialGlue = v_GetMaterialAtCrossHair(); - if (materialGlue) - { - const MaterialGlue_s* const material = materialGlue->Get(); - - Msg(eDLL_T::MS, "______________________________________________________________\n"); - Msg(eDLL_T::MS, "-+ Material --------------------------------------------------\n"); - Msg(eDLL_T::MS, " |-- Address: '%llX'\n", material); - Msg(eDLL_T::MS, " |-- Pak GUID: '%llX'\n", material->guid); - Msg(eDLL_T::MS, " |-- Samplers: '%08X'\n", *(uint32*)material->samplers); - Msg(eDLL_T::MS, " |-- Streaming handles: '%hu'\n", material->streamingTextureHandleCount); - Msg(eDLL_T::MS, " |-- Material width: '%hu'\n", material->width); - Msg(eDLL_T::MS, " |-- Material height: '%hu'\n", material->height); - - Msg(eDLL_T::MS, " |-- Material name: '%s'\n", material->name); - Msg(eDLL_T::MS, " |-- Material surface name 1: '%s'\n", material->surfaceProp); - Msg(eDLL_T::MS, " |-- Material surface name 2: '%s'\n", material->surfaceProp2); - Msg(eDLL_T::MS, " |-- Uber buffer: '%llX'\n", material->uberBuffer); - Msg(eDLL_T::MS, " |-- View buffer: '%llX'\n", material->viewBuffer); - - PrintChildMat(material->depthMaterials[DEPTH_SHADOW], " | |-+ Depth shadow: '%llX'\n"); - PrintChildMat(material->depthMaterials[DEPTH_PREPASS], " | |-+ Depth prepass: '%llX'\n"); - PrintChildMat(material->depthMaterials[DEPTH_VSM], " | |-+ Depth VSM: '%llX'\n"); - PrintChildMat(material->depthMaterials[DEPTH_SHADOW_TIGHT], " | |-+ Depth shadow tight: '%llX'\n"); - PrintChildMat(material->colpassMaterial, " | |-+ Color pass: '%llX'\n"); - - Msg(eDLL_T::MS, "-+ Texture GUID map ------------------------------------------\n"); - Msg(eDLL_T::MS, " |-- Texture handles: '%llX'\n", material->textureHandles); - Msg(eDLL_T::MS, " |-- Streaming texture handles: '%llX'\n", material->streamingTextureHandles); - - Msg(eDLL_T::MS, "--------------------------------------------------------------\n"); - } - else + if (!materialGlue) { Msg(eDLL_T::MS, "%s: No material found >:(\n", __FUNCTION__); + return; } + + const MaterialGlue_s* const material = materialGlue->Get(); + + Msg(eDLL_T::MS, "______________________________________________________________\n"); + Msg(eDLL_T::MS, "-+ Material --------------------------------------------------\n"); + Msg(eDLL_T::MS, " |-- Address: '%llX'\n", material); + Msg(eDLL_T::MS, " |-- Pak GUID: '%llX'\n", material->guid); + Msg(eDLL_T::MS, " |-- Samplers: '%08X'\n", *(uint32*)material->samplers); + Msg(eDLL_T::MS, " |-- Streaming handles: '%hu'\n", material->streamingTextureHandleCount); + Msg(eDLL_T::MS, " |-- Material width: '%hu'\n", material->width); + Msg(eDLL_T::MS, " |-- Material height: '%hu'\n", material->height); + + Msg(eDLL_T::MS, " |-- Material name: '%s'\n", material->name); + Msg(eDLL_T::MS, " |-- Material surface name 1: '%s'\n", material->surfaceProp); + Msg(eDLL_T::MS, " |-- Material surface name 2: '%s'\n", material->surfaceProp2); + Msg(eDLL_T::MS, " |-- Uber buffer: '%llX'\n", material->uberBuffer); + Msg(eDLL_T::MS, " |-- View buffer: '%llX'\n", material->viewBuffer); + + PrintChildMat(material->depthMaterials[DEPTH_SHADOW], " | |-+ Depth shadow: '%llX'\n"); + PrintChildMat(material->depthMaterials[DEPTH_PREPASS], " | |-+ Depth prepass: '%llX'\n"); + PrintChildMat(material->depthMaterials[DEPTH_VSM], " | |-+ Depth VSM: '%llX'\n"); + PrintChildMat(material->depthMaterials[DEPTH_SHADOW_TIGHT], " | |-+ Depth shadow tight: '%llX'\n"); + PrintChildMat(material->colpassMaterial, " | |-+ Color pass: '%llX'\n"); + + Msg(eDLL_T::MS, "-+ Texture GUID map ------------------------------------------\n"); + Msg(eDLL_T::MS, " |-- Texture handles: '%llX'\n", material->textureHandles); + Msg(eDLL_T::MS, " |-- Streaming texture handles: '%llX'\n", material->streamingTextureHandles); + + Msg(eDLL_T::MS, "--------------------------------------------------------------\n"); } /*