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

Function DoControllerMisc

Descent3/Controls.cpp:1246–1347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1244}
1245
1246void DoControllerMisc(game_controls *controls) {
1247 static int energy_to_shields_id = -1;
1248 int i;
1249
1250 ct_packet prev_inv, next_inv;
1251 ct_packet prev_cntm, next_cntm;
1252 ct_packet use_inv, use_cntm;
1253 ct_packet toggle_headlight;
1254 ct_packet toggle_rearview, toggle_rearview_switch;
1255 ct_packet ctl_bank, ctl_slide, use_taunt[4];
1256
1257 // read controls
1258 Controller->get_packet(ctfPREV_INVBTN, &prev_inv);
1259 Controller->get_packet(ctfNEXT_INVBTN, &next_inv);
1260 Controller->get_packet(ctfPREV_CNTMSBTN, &prev_cntm);
1261 Controller->get_packet(ctfNEXT_CNTMSBTN, &next_cntm);
1262 Controller->get_packet(ctfINV_USEBTN, &use_inv);
1263 Controller->get_packet(ctfCNTMS_USEBTN, &use_cntm);
1264 Controller->get_packet(ctfHEADLIGHT_BUTTON, &toggle_headlight);
1265 Controller->get_packet(ctfREARVIEW_BTN, &toggle_rearview);
1266 Controller->get_packet(ctfREARVIEW_BTN, &toggle_rearview_switch, ctDigital);
1267 Controller->get_packet(ctfAUDIOTAUNT1_BTN, &use_taunt[0]);
1268 Controller->get_packet(ctfAUDIOTAUNT2_BTN, &use_taunt[1]);
1269 Controller->get_packet(ctfAUDIOTAUNT3_BTN, &use_taunt[2]);
1270 Controller->get_packet(ctfAUDIOTAUNT4_BTN, &use_taunt[3]);
1271
1272 Controller->get_packet(ctfTOGGLE_SLIDEBUTTON, &ctl_slide);
1273 Controller->get_packet(ctfTOGGLE_BANKBUTTON, &ctl_bank);
1274
1275 // check modifiers like toggles
1276 if (ctl_slide.value) {
1277 controls->toggle_slide = true;
1278 }
1279 if (ctl_bank.value) {
1280 controls->toggle_bank = true;
1281 }
1282
1283 // downcount, only once for audiotaunts
1284 if (use_taunt[0].value != 0.0f) {
1285 MultiSendRequestPlayTaunt(0);
1286 }
1287 if (use_taunt[1].value != 0.0f) {
1288 MultiSendRequestPlayTaunt(1);
1289 }
1290 if (use_taunt[2].value != 0.0f) {
1291 MultiSendRequestPlayTaunt(2);
1292 }
1293 if (use_taunt[3].value != 0.0f) {
1294 MultiSendRequestPlayTaunt(3);
1295 }
1296
1297 // these are all down count values (so do operation X times)
1298 for (i = 0; i < (int)prev_cntm.value; i++)
1299 CounterMeasuresSwitch(false);
1300
1301 for (i = 0; i < (int)next_cntm.value; i++)
1302 CounterMeasuresSwitch(true);
1303

Callers 1

DoMiscFunction · 0.85

Calls 13

CounterMeasuresSwitchFunction · 0.85
UseCountermeasureFunction · 0.85
AddHUDMessageFunction · 0.85
InventorySwitchFunction · 0.85
FindObjectIDNameFunction · 0.85
DoEnergyToShieldsFunction · 0.85
UseInventoryItemFunction · 0.85
SizeMethod · 0.80
GetPosNameMethod · 0.80
GetPosTypeIDMethod · 0.80

Tested by

no test coverage detected