X-Git-Url: https://plomlompom.com/repos/feed.xml?a=blobdiff_plain;f=src%2Fcontrol.h;h=492b80b1688f8ad176dd57adc7397cac11d86661;hb=c3d87a1dee96775443fdf73c53e1350af7ca5fc2;hp=470b026cb74c154b2ea22b3120f932346429602e;hpb=550d22ec0c3f530f5d317746f3f7e75251a1de4b;p=plomrogue diff --git a/src/control.h b/src/control.h index 470b026..492b80b 100644 --- a/src/control.h +++ b/src/control.h @@ -6,39 +6,27 @@ #ifndef CONTROL_H #define CONTROL_H - - #include /* for uint8_t */ -struct World; /* Return keycode to action of "name" if available in current window config. */ -extern uint16_t get_available_keycode_to_action(struct World * world, - char * name); - +extern uint16_t get_available_keycode_to_action(char * name); - -/* Control the player character, either via recorded "action" or pressed "key". +/* Control the player character, either via action id "action" or pressed "key". + * Return 1 on success, 0 if no appropriate action to trigger was found. */ -extern void record_control(int action, struct World * world); -extern uint8_t player_control(int key, struct World * world); - - - -/* Control via "key" active window's geometry / keybindings in respective config - * view. - */ -extern uint8_t wingeom_control(int key, struct World * world); -extern uint8_t winkeyb_control(int key, struct World * world); - +extern uint8_t player_control_by_key(int key); +extern uint8_t player_control_by_id(int action); +/* Control via "key" active window's config view's geometry / keybindings. */ +extern uint8_t wingeom_control(int key); +extern uint8_t winkeyb_control(int key); -/* Call by "key" further game / window management actions that don't influence - * the player character. If the "quit" action is called, return 1 (instead of - * exiting directly). +/* Call via "key" further game/window management actions not influencing the + * player character. If "quit" is called, return 1, else 0. */ -extern uint8_t meta_control(int key, struct World * world); +extern uint8_t meta_control(int key);