diff options
author | 2025-06-17 20:18:48 +0100 | |
---|---|---|
committer | 2025-06-21 14:50:00 +0100 | |
commit | ac7e7d0f21978afc70fe3ef76db69d575742b974 (patch) | |
tree | 6fd25c7ded6cfeba7c55b1c26abc82a28878a14e /src/bind.c | |
parent | 1f2d9ce197eafd16803de087cc5b6f8b8f4345a6 (diff) | |
download | sst-ac7e7d0f21978afc70fe3ef76db69d575742b974.tar.gz sst-ac7e7d0f21978afc70fe3ef76db69d575742b974.zip |
Separate our command callbacks from Source's
This improves the ergonomics of a few different things, and sets us up
somewhat for the fact OE had a different interface for commands too
(it was v1 only and had a separate API call for getting the args).
Diffstat (limited to 'src/bind.c')
-rw-r--r-- | src/bind.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -36,9 +36,8 @@ static struct keyinfo *keyinfo; // engine keybinds list (s_pKeyInfo[]) const char *bind_get(int keycode) { return keyinfo[keycode].binding; } -static bool find_keyinfo(con_cmdcb klbc_cb) { +static bool find_keyinfo(const uchar *insns) { #ifdef _WIN32 - const uchar *insns = (const uchar *)klbc_cb; for (const uchar *p = insns; p - insns < 64;) { // key_listboundkeys loops through each index, moving into a register: // mov <reg>, dword ptr [<reg> * 8 + s_pKeyInfo] @@ -57,8 +56,7 @@ static bool find_keyinfo(con_cmdcb klbc_cb) { INIT { struct con_cmd *cmd_key_listboundkeys = con_findcmd("key_listboundkeys"); - con_cmdcb cb = con_getcmdcb(cmd_key_listboundkeys); - if_cold (!find_keyinfo(cb)) { + if_cold (!find_keyinfo(cmd_key_listboundkeys->cb_insns)) { errmsg_warnx("couldn't find key binding list"); return FEAT_INCOMPAT; } |