summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2023-05-17 00:01:25 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2023-05-17 00:04:55 +0100
commit7933acbabceba8fd826f6505bfeb3ae8baff0a5c (patch)
tree89ccc1275d904db4b28a9bdc880c20f32d382ee0 /src
parentcba9387c361c3d33dcf1b21ff0e5beb4b0a81ade (diff)
Add a hack for features to distinguish VDF loading
Diffstat (limited to 'src')
-rw-r--r--src/sst.c3
-rw-r--r--src/sst.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/sst.c b/src/sst.c
index 392f540..fcf26c4 100644
--- a/src/sst.c
+++ b/src/sst.c
@@ -46,6 +46,8 @@ static int ifacever;
// exposing lib handles in general, probably.
void *clientlib = 0;
+bool sst_earlyloaded = false; // see deferinit() below
+
#ifdef _WIN32
extern long __ImageBase; // this is actually the PE header struct but don't care
#define ownhandle() ((void *)&__ImageBase)
@@ -244,6 +246,7 @@ static bool deferinit(void) {
// Portal 2 does away with the separate gameui library, so now we just call
// CEngineVGui::IsInitialized() which works everywhere.
if (VGuiIsInitialized(vgui)) return false;
+ sst_earlyloaded = true; // let other code know
if (!os_mprot(*(void ***)vgui + vtidx_VGuiConnect, sizeof(void *),
PAGE_READWRITE)) {
errmsg_warnsys("couldn't make CEngineVGui vtable writable for deferred "
diff --git a/src/sst.h b/src/sst.h
index a959e00..8c10798 100644
--- a/src/sst.h
+++ b/src/sst.h
@@ -26,6 +26,9 @@ DECL_EVENT(Tick, bool /*simulating*/)
extern void *clientlib;
+/* occasionally useful: quick query to determine how sst was loaded */
+extern bool sst_earlyloaded;
+
#endif
// vi: sw=4 ts=4 noet tw=80 cc=80