From dc16b12d7976f03d20b81f9a2491ee7dddbb9b8e Mon Sep 17 00:00:00 2001 From: s1lentq Date: Sun, 25 Aug 2024 05:45:09 +0700 Subject: [PATCH] [skip ci] VisualStudio: Add auto visualizer for some structures/classes --- regamedll/dlls/client.cpp | 3 + regamedll/msvc/ReGameDLL.vcxproj | 3 + regamedll/msvc/ReGameDLL.vcxproj.filters | 5 ++ regamedll/regamedll/types.natvis | 107 +++++++++++++++++++++++ 4 files changed, 118 insertions(+) create mode 100644 regamedll/regamedll/types.natvis diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index e1b4d322..3fe161c6 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -133,6 +133,7 @@ static entity_field_alias_t custom_entity_field_alias[] = { "animtime", 0 }, }; +edict_t *g_pEdicts = nullptr; bool g_bServerActive = false; bool g_bItemCreatedByBuying = false; PLAYERPVSSTATUS g_PVSStatus[MAX_CLIENTS]; @@ -3747,6 +3748,8 @@ void EXT_FUNC ServerDeactivate() void EXT_FUNC ServerActivate(edict_t *pEdictList, int edictCount, int clientMax) { + g_pEdicts = pEdictList; + #ifdef REGAMEDLL_ADD // // Tells clients which version of player movement (pmove) the server is using diff --git a/regamedll/msvc/ReGameDLL.vcxproj b/regamedll/msvc/ReGameDLL.vcxproj index 57e09e91..f33cfa3d 100644 --- a/regamedll/msvc/ReGameDLL.vcxproj +++ b/regamedll/msvc/ReGameDLL.vcxproj @@ -809,6 +809,9 @@ + + + {70A2B904-B7DB-4C48-8DE0-AF567360D572} ReGameDLL diff --git a/regamedll/msvc/ReGameDLL.vcxproj.filters b/regamedll/msvc/ReGameDLL.vcxproj.filters index ef2017ae..bfc6d625 100644 --- a/regamedll/msvc/ReGameDLL.vcxproj.filters +++ b/regamedll/msvc/ReGameDLL.vcxproj.filters @@ -1070,4 +1070,9 @@ public\tier0 + + + regamedll + + \ No newline at end of file diff --git a/regamedll/regamedll/types.natvis b/regamedll/regamedll/types.natvis new file mode 100644 index 00000000..4dc313c6 --- /dev/null +++ b/regamedll/regamedll/types.natvis @@ -0,0 +1,107 @@ + + + + + + {{ { pev->pContainingEntity - g_pEdicts }, { pev->classname }, { pev->health }, { m_iTeam }, { m_iModelName } }} + + + + + + { *m_pContainingEntity } + + + + + {{ { pev->pContainingEntity - g_pEdicts }, { pev->classname } }} + + + m_pNext + m_pNext + (*this) + + + + + + + {{ { pev->pContainingEntity - g_pEdicts }, { pev->classname }, { pev->model } }} + + + + + {{ {this - g_pEdicts}, { v.classname }, { v.model } }} + + + + + {{ { pContainingEntity - g_pEdicts }, { classname }, { model } }} + + + + + { &gpGlobals->pStringBase[m_string],s } + + + + + allocator + + ($T1 *)m_pMemory + m_nAllocationCount + m_nGrowSize + + + + + + {{ size = { m_Size } }} + + + m_Size + (ElemType_t *)m_Memory.m_pMemory + + + + + + + {{ size = { m_Tree.m_NumElements } }} + + m_Tree.m_NumElements + m_Tree.m_Elements + + + + ((CTree::Node_t *)m_Tree.m_Elements.m_pMemory)[iMap].m_Data.elem + iMap++ + + + + + + + + {{ size = { $T2 } }} + + + $T2 + ($T1 *)&m_Memory[0] + + + + + + + + m_NumElements + m_Elements + + m_NumElements + ((Node_t *)m_Elements.m_pMemory)[$i].m_Data + + + + +