From 9a09c605402e6ff74f93f7fe7afc50ccc785acc3 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sun, 25 Dec 2022 11:03:50 +0000 Subject: Add basic mouse input scaling --- src/nosleep.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/nosleep.c') 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"); -- cgit v1.2.3