MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / GetControllerBindingText

Function GetControllerBindingText

Descent3/hud.cpp:1340–1360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1338}
1339
1340char *GetControllerBindingText(int fidcont) {
1341 static char *cont_bind_txt;
1342 ct_type ctype[CTLBINDS_PER_FUNC];
1343 uint8_t cfgflags[CTLBINDS_PER_FUNC];
1344 ct_config_data cfgdata;
1345 tCfgDataParts cfgparts;
1346 if (-1 == fidcont)
1347 return NULL;
1348 cont_bind_txt = NULL;
1349 fidcont = CtlFindBinding(fidcont, false);
1350 if (fidcont == -1) // DAJ -1FIX
1351 return NULL;
1352
1353 Controller->get_controller_function(Cfg_joy_elements[fidcont].fn_id, ctype, &cfgdata, cfgflags);
1354 parse_config_data(&cfgparts, ctype[0], ctype[1], cfgdata);
1355 uint8_t one_binding = cfgparts.bind_0;
1356 uint8_t one_ctrlbind = cfgparts.ctrl_0;
1357
1358 cont_bind_txt = (char *)cfg_binding_text(ctype[0], one_ctrlbind, one_binding);
1359 return cont_bind_txt;
1360}
1361
1362char *GetKeyBindingText(int fidkey) {
1363 static char *key_bind_txt;

Callers 1

RenderHUDItemsFunction · 0.85

Calls 4

CtlFindBindingFunction · 0.85
parse_config_dataFunction · 0.85
cfg_binding_textFunction · 0.85

Tested by

no test coverage detected