Change key binds from array to linked list

Key bindings were stored as a fixed-size array, indexed by the input
character, pointing to the extended commands.  This changes that into
a linked list of an intermediary struct Cmd_bind, storing the input key
and the pointer to the command.

This is just code cleanup for future enhancements, and should have
no effect on gameplay.
This commit is contained in:
Pasi Kallinen
2026-03-20 17:28:27 +02:00
parent 044a229467
commit c595f241e6
8 changed files with 228 additions and 81 deletions

View File

@@ -370,6 +370,7 @@ extern void change_palette(void);
/* ### cmd.c ### */
extern void cmdbind_freeall(void);
extern void set_move_cmd(int, int);
extern int do_move_west(void);
extern int do_move_northwest(void);
@@ -447,7 +448,7 @@ extern int doextlist(void);
extern int extcmd_via_menu(void);
extern int enter_explore_mode(void);
extern boolean bind_mousebtn(int, const char *);
extern boolean bind_key(uchar, const char *);
extern boolean bind_key(uchar, const char *, boolean);
extern void dokeylist(void);
extern int xytodir(int, int);
extern void dirtocoord(coord *, int);