From 3ebe43eb75806990a402aafd5858de615d5c1cca Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 2 Jun 2022 01:26:45 +0100 Subject: Solve the error logging situation --- src/nosleep.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/nosleep.c') diff --git a/src/nosleep.c b/src/nosleep.c index c1c5a9b..c849f04 100644 --- a/src/nosleep.c +++ b/src/nosleep.c @@ -18,6 +18,7 @@ #include "con_.h" #include "engineapi.h" +#include "errmsg.h" #include "gamedata.h" #include "hook.h" #include "os.h" @@ -41,22 +42,22 @@ bool nosleep_init(void) { con_reg(engine_no_focus_sleep); // TODO(featgen): auto-check these factories if (!factory_inputsystem) { - con_warn("nosleep: missing required factories\n"); + errmsg_warnx("missing required factories"); return false; } if (!has_vtidx_SleepUntilInput) { - con_warn("nosleep: missing gamedata entries for this engine\n"); + errmsg_warnx("missing gamedata entries for this engine"); return false; } void *insys = factory_inputsystem("InputSystemVersion001", 0); if (!insys) { - con_warn("nosleep: couldn't get input system interface\n"); + errmsg_errorx("couldn't get input system interface"); return false; } vtable = *(void ***)insys; if (!os_mprot(vtable + vtidx_SleepUntilInput, sizeof(void *), PAGE_READWRITE)) { - con_warn("nosleep: couldn't make memory writable\n"); + errmsg_errorx("couldn't make virtual table writable"); return false; } orig_SleepUntilInput = (SleepUntilInput_func)hook_vtable(vtable, -- cgit v1.2.3