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

Function ProcessTestKeys

Descent3/GameLoop.cpp:1563–2374  ·  view source on GitHub ↗

Deal with keys that only work for testing & debugging (eg., slew)

Source from the content-addressed store, hash-verified

1561
1562// Deal with keys that only work for testing & debugging (eg., slew)
1563void ProcessTestKeys(int key) {
1564 static int ffret = -1;
1565 int i;
1566
1567 // Debug break
1568 if (key == KEY_SHIFTED + KEY_BACKSP)
1569 Int3();
1570
1571 // Handle slew keys
1572 if (Player_object->control_type == CT_SLEW) {
1573 switch (key) // Special for slew keys. Add all new debugging keys to the second switch statement.
1574 {
1575 case KEY_PAD5:
1576 SlewStop(Player_object);
1577 break;
1578 case KEY_PAD0:
1579 SlewResetOrient(Player_object);
1580 break;
1581 }
1582 }
1583
1584 if (key == (KEY_SHIFTED + KEY_LBRACKET)) {
1585 MultiSendRequestPlayTaunt(0);
1586 }
1587
1588 if (key == (KEY_SHIFTED + KEY_RBRACKET)) {
1589 MultiSendRequestPlayTaunt(1);
1590 }
1591
1592 // All other debug/test keys require the DEBUGGED modifier, so bail if it's not set
1593 if (!(key & KEY_DEBUGGED))
1594 return;
1595
1596 switch (key & ~KEY_DEBUGGED) // for simplicity, do swich on keycode without the flag
1597 {
1598
1599 /*
1600 **************************************************
1601 Keys A-Z
1602 **************************************************
1603 */
1604 case KEY_A:
1605
1606 DoAI = !DoAI;
1607 AddHUDMessage("AI turned %s.", DoAI ? "on" : "off");
1608 break;
1609
1610 case KEY_B:
1611 Game_show_sphere = (Game_show_sphere + 1) % 4;
1612
1613 if (Game_show_sphere == 0)
1614 AddHUDMessage("No visible spheres.");
1615 else if (Game_show_sphere == 1)
1616 AddHUDMessage("Wall collision spheres(only encompass first anim frame).");
1617 else if (Game_show_sphere == 2)
1618 AddHUDMessage("Spheres for FVI(encompass all anims).");
1619 else if (Game_show_sphere == 3)
1620 AddHUDMessage("Object size spheres.");

Callers 1

ProcessKeysFunction · 0.85

Calls 15

SlewStopFunction · 0.85
SlewResetOrientFunction · 0.85
AddHUDMessageFunction · 0.85
SendCheaterTextFunction · 0.85
MakeObjectVisibleFunction · 0.85
MakeObjectInvisibleFunction · 0.85
GetRankIndexFunction · 0.85
ChangeRankIndexFunction · 0.85
DestroyLightFunction · 0.85
SetGameStateFunction · 0.85

Tested by

no test coverage detected