Skip to content

Commit

Permalink
core: Remove use of SourceInterface for CCvar (#804)
Browse files Browse the repository at this point in the history
`SourceInteface` class goes back to icepick and is not good. We have a replacement, let's use it.
  • Loading branch information
F1F7Y authored Sep 2, 2024
1 parent 96c34f6 commit 669fdae
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
5 changes: 2 additions & 3 deletions primedev/core/convar/convar.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "bits.h"
#include "cvar.h"
#include "convar.h"
#include "core/sourceinterface.h"
#include "core/tier1.h"

#include <float.h>

Expand Down Expand Up @@ -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<CCvar>("vstdlib.dll", "VEngineCvar007");
g_pCVar = *g_pCVarInterface;
g_pCVar = Sys_GetFactoryPtr("vstdlib.dll", "VEngineCvar007").RCast<CCvar*>();
}

//-----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion primedev/core/convar/cvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ std::unordered_map<std::string, ConCommandBase*> CCvar::DumpToMap()
return allConVars;
}

SourceInterface<CCvar>* g_pCVarInterface;
CCvar* g_pCVar;
1 change: 0 additions & 1 deletion primedev/core/convar/cvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ class CCvar
std::unordered_map<std::string, ConCommandBase*> DumpToMap();
};

extern SourceInterface<CCvar>* g_pCVarInterface;
extern CCvar* g_pCVar;

0 comments on commit 669fdae

Please sign in to comment.