summaryrefslogtreecommitdiffhomepage
path: root/src/nosleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nosleep.c')
-rw-r--r--src/nosleep.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/nosleep.c b/src/nosleep.c
index 07a5500..e75c6e6 100644
--- a/src/nosleep.c
+++ b/src/nosleep.c
@@ -20,12 +20,13 @@
#include "feature.h"
#include "gamedata.h"
#include "hook.h"
+#include "mem.h"
#include "os.h"
#include "vcall.h"
FEATURE("inactive window sleep adjustment")
REQUIRE_GAMEDATA(vtidx_SleepUntilInput)
-REQUIRE_GLOBAL(factory_inputsystem)
+REQUIRE_GLOBAL(inputsystem)
DEF_CVAR_UNREG(engine_no_focus_sleep,
"Delay while tabbed out (SST reimplementation)", 50,
@@ -46,12 +47,7 @@ PREINIT {
}
INIT {
- void *insys = factory_inputsystem("InputSystemVersion001", 0);
- if (!insys) {
- errmsg_errorx("couldn't get input system interface");
- return false;
- }
- vtable = *(void ***)insys;
+ vtable = mem_loadptr(inputsystem);
if (!os_mprot(vtable + vtidx_SleepUntilInput, sizeof(void *),
PAGE_READWRITE)) {
errmsg_errorx("couldn't make virtual table writable");