From 669fdaed4c00728e798ee911c4426a6339f93951 Mon Sep 17 00:00:00 2001 From: F1F7Y <64418963+F1F7Y@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:10:57 +0200 Subject: core: Remove use of `SourceInterface` for `CCvar` (#804) `SourceInteface` class goes back to icepick and is not good. We have a replacement, let's use it. --- primedev/core/convar/convar.cpp | 5 ++--- primedev/core/convar/cvar.cpp | 1 - primedev/core/convar/cvar.h | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/primedev/core/convar/convar.cpp b/primedev/core/convar/convar.cpp index 87a1e159..802c088d 100644 --- a/primedev/core/convar/convar.cpp +++ b/primedev/core/convar/convar.cpp @@ -1,7 +1,7 @@ #include "bits.h" #include "cvar.h" #include "convar.h" -#include "core/sourceinterface.h" +#include "core/tier1.h" #include @@ -35,8 +35,7 @@ ON_DLL_LOAD("engine.dll", ConVar, (CModule module)) g_pConVar_Vtable = module.Offset(0x67FD28); g_pIConVar_Vtable = module.Offset(0x67FDC8); - g_pCVarInterface = new SourceInterface("vstdlib.dll", "VEngineCvar007"); - g_pCVar = *g_pCVarInterface; + g_pCVar = Sys_GetFactoryPtr("vstdlib.dll", "VEngineCvar007").RCast(); } //----------------------------------------------------------------------------- diff --git a/primedev/core/convar/cvar.cpp b/primedev/core/convar/cvar.cpp index aa5f0365..78da1ad2 100644 --- a/primedev/core/convar/cvar.cpp +++ b/primedev/core/convar/cvar.cpp @@ -22,5 +22,4 @@ std::unordered_map CCvar::DumpToMap() return allConVars; } -SourceInterface* g_pCVarInterface; CCvar* g_pCVar; diff --git a/primedev/core/convar/cvar.h b/primedev/core/convar/cvar.h index beaa84f4..024f2b87 100644 --- a/primedev/core/convar/cvar.h +++ b/primedev/core/convar/cvar.h @@ -34,5 +34,4 @@ public: std::unordered_map DumpToMap(); }; -extern SourceInterface* g_pCVarInterface; extern CCvar* g_pCVar; -- cgit v1.2.3