Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
config_xml.cpp File Reference
#include <expat.h>
#include "xml_support.h"
#include "vegastrike.h"
#include <assert.h>
#include "config_xml.h"
#include "easydom.h"
#include "cmd/ai/flykeyboard.h"
#include "cmd/ai/firekeyboard.h"
#include "cmd/music.h"
#include "gfx/loc_select.h"
#include "audiolib.h"
#include "in_joystick.h"
#include "main_loop.h"
#include "gfx/cockpit.h"
#include "in_kb_data.h"
#include "python/python_compile.h"
#include "gfx/screenshot.h"

Go to the source code of this file.

Functions

void RunPythonPress (const KBData &, KBSTATE)
 
void RunPythonRelease (const KBData &, KBSTATE)
 
void RunPythonToggle (const KBData &, KBSTATE)
 
void RunPythonPhysicsFrame (const KBData &, KBSTATE)
 
void incmusicvol (const KBData &, KBSTATE a)
 
void decmusicvol (const KBData &, KBSTATE a)
 
void doReloadShader (const KBData &, KBSTATE a)
 
void doScreenshot (const KBData &, KBSTATE a)
 
void incvol (const KBData &, KBSTATE a)
 
void decvol (const KBData &, KBSTATE a)
 
void mute (const KBData &, KBSTATE a)
 
void incdop (const KBData &, KBSTATE a)
 
void decdop (const KBData &, KBSTATE a)
 
void inc_time_compression (const KBData &, KBSTATE a)
 
void JoyStickToggleKey (const KBData &, KBSTATE a)
 
void SuicideKey (const KBData &, KBSTATE a)
 
void dec_time_compression (const KBData &, KBSTATE a)
 
void reset_time_compression (const KBData &, KBSTATE a)
 
void MapKey (const KBData &, KBSTATE a)
 
void VolUp (const KBData &, KBSTATE a)
 
void VolDown (const KBData &, KBSTATE a)
 
CommandMap initGlobalCommandMap ()
 
static void ComposeFunctions (const KBData &composition, KBSTATE k)
 
static void ComposeFunctionsToggle (const KBData &composition, KBSTATE k)
 

Variables

const float volinc = 1
 
const float dopinc = .1
 
bool screenshotkey = false
 
static CommandMap commandMap = initGlobalCommandMap()
 

Function Documentation

static void ComposeFunctions ( const KBData composition,
KBSTATE  k 
)
static

Definition at line 213 of file config_xml.cpp.

References commandMap, KBData::data, and i.

Referenced by ComposeFunctionsToggle(), and initGlobalCommandMap().

214 {
215  std::string s = composition.data;
216  while ( s.length() ) {
217  std::string::size_type where = s.find( " " );
218  std::string t = s.substr( 0, where );
219  if (where != std::string::npos)
220  s = s.substr( where+1 );
221  else
222  s = "";
223  where = t.find( "(" );
224  std::string args;
225  if (where != string::npos) {
226  args = t.substr( where+1 );
227  std::string::size_type paren = args.find( ")" );
228  if (paren != string::npos)
229  args = args.substr( 0, paren );
230  t = t.substr( 0, where );
231  }
232  CommandMap::iterator i = commandMap.find( t );
233  if ( i != commandMap.end() )
234  (*i).second( args, k );
235  }
236 }
static void ComposeFunctionsToggle ( const KBData composition,
KBSTATE  k 
)
static

Definition at line 238 of file config_xml.cpp.

References ComposeFunctions(), PRESS, and RELEASE.

Referenced by initGlobalCommandMap().

239 {
240  if (k == PRESS || k == RELEASE)
241  ComposeFunctions( composition, k );
242 }
void dec_time_compression ( const KBData ,
KBSTATE  a 
)

Definition at line 71 of file lin_time.cpp.

References PRESS.

Referenced by initGlobalCommandMap().

72 {
73  if (a == PRESS) {
74  timecompression /= 1.5;
75  timecount--;
76  }
77 }
void decdop ( const KBData ,
KBSTATE  a 
)

Definition at line 120 of file config_xml.cpp.

References AUDChangeDoppler(), AUDGetDoppler(), dopinc, and DOWN.

Referenced by initGlobalCommandMap().

121 {
122 #ifdef HAVE_AL
123  if (a == DOWN)
125 #endif
126 }
void decmusicvol ( const KBData ,
KBSTATE  a 
)

Definition at line 857 of file music.cpp.

References Music::ChangeVolume(), and PRESS.

Referenced by initGlobalCommandMap().

858 {
859  if (a == PRESS) Music::ChangeVolume( -.0625 );
860 }
void decvol ( const KBData ,
KBSTATE  a 
)

Definition at line 99 of file config_xml.cpp.

References AUDChangeVolume(), AUDGetVolume(), DOWN, and volinc.

100 {
101 #ifdef HAVE_AL
102  if (a == DOWN)
104 #endif
105 }
void doReloadShader ( const KBData ,
KBSTATE  a 
)

Definition at line 79 of file config_xml.cpp.

References GFXReloadDefaultShader(), and PRESS.

Referenced by initGlobalCommandMap().

80 {
81  if (a == PRESS)
83 }
void doScreenshot ( const KBData ,
KBSTATE  a 
)

Definition at line 85 of file config_xml.cpp.

References PRESS, and screenshotkey.

Referenced by initGlobalCommandMap().

86 {
87  if (a == PRESS)
88  screenshotkey = true;
89 }
void inc_time_compression ( const KBData ,
KBSTATE  a 
)

Definition at line 63 of file lin_time.cpp.

References PRESS.

Referenced by initGlobalCommandMap().

64 {
65  if (a == PRESS) {
66  timecompression *= 1.5;
67  timecount++;
68  }
69 }
void incdop ( const KBData ,
KBSTATE  a 
)

Definition at line 113 of file config_xml.cpp.

References AUDChangeDoppler(), AUDGetDoppler(), dopinc, and DOWN.

Referenced by initGlobalCommandMap().

114 {
115 #ifdef HAVE_AL
116  if (a == DOWN)
118 #endif
119 }
void incmusicvol ( const KBData ,
KBSTATE  a 
)

Definition at line 853 of file music.cpp.

References Music::ChangeVolume(), and PRESS.

Referenced by initGlobalCommandMap().

854 {
855  if (a == PRESS) Music::ChangeVolume( .0625 );
856 }
void incvol ( const KBData ,
KBSTATE  a 
)

Definition at line 91 of file config_xml.cpp.

References AUDChangeVolume(), AUDGetVolume(), DOWN, and volinc.

92 {
93 #ifdef HAVE_AL
94  if (a == DOWN)
96 #endif
97 }
CommandMap initGlobalCommandMap ( )

Definition at line 494 of file config_xml.cpp.

References FlyByKeyboard::ABKey(), FlyByKeyboard::AccelKey(), FireKeyboard::AttackTarget(), FlyByKeyboard::AutoKey(), CockpitKeys::Behind(), FireKeyboard::BreakFormation(), ConsoleKeys::BringConsole(), FlyByKeyboard::ChangeCommStatus(), FireKeyboard::CloakKey(), commandMap, CockpitKeys::CommModeVDU(), ComposeFunctions(), ComposeFunctionsToggle(), CockpitKeys::DamageModeVDU(), dec_time_compression(), decdop(), FlyByKeyboard::DecelKey(), decmusicvol(), FireKeyboard::DefendTarget(), FireKeyboard::DockKey(), FireKeyboard::DockTarget(), FireKeyboard::DockWithMe(), doReloadShader(), doScreenshot(), FlyByKeyboard::DownFreq(), FlyByKeyboard::DownKey(), FireKeyboard::ECMKey(), FireKeyboard::EjectCargoKey(), FireKeyboard::EjectDockKey(), FireKeyboard::EjectKey(), FireKeyboard::EjectNonMissionCargoKey(), FlyByKeyboard::EngageSpecAuto(), FireKeyboard::EnslaveKey(), FireKeyboard::FireKey(), FireKeyboard::FormUp(), FireKeyboard::FreeSlaveKey(), CockpitKeys::GunModeVDU(), FireKeyboard::HelpMeOut(), FireKeyboard::HelpMeOutCrit(), FireKeyboard::HelpMeOutFaction(), FireKeyboard::HoldPosition(), inc_time_compression(), incdop(), incmusicvol(), FireKeyboard::IncomingMissileTargetKey(), FlyByKeyboard::InertialPulsorKey(), FlyByKeyboard::InertialToggleKey(), CockpitKeys::Inside(), CockpitKeys::InsideBack(), CockpitKeys::InsideLeft(), CockpitKeys::InsideRight(), FireKeyboard::JoinFg(), FlyByKeyboard::JoyBankPulsorKey(), FlyByKeyboard::JoyBankToggleKey(), FlyByKeyboard::JoyInertialXYPulsorKey(), FlyByKeyboard::JoyInertialXYToggleKey(), FlyByKeyboard::JoyRollPulsorKey(), FlyByKeyboard::JoyRollToggleKey(), JoyStickToggleKey(), FlyByKeyboard::JumpKey(), FlyByKeyboard::KSwitchFlightMode(), FlyByKeyboard::KThrustBack(), FlyByKeyboard::KThrustDown(), FlyByKeyboard::KThrustFront(), FlyByKeyboard::KThrustLeft(), FlyByKeyboard::KThrustRight(), FlyByKeyboard::KThrustUp(), FlyByKeyboard::LeftKey(), FireKeyboard::LockKey(), CockpitKeys::LookDown(), CockpitKeys::LookLeft(), CockpitKeys::LookRight(), CockpitKeys::LookUp(), CockpitKeys::ManifestModeVDU(), MapKey(), FlyByKeyboard::MatchSpeedKey(), FireKeyboard::MisSelKey(), FireKeyboard::MissileKey(), CockpitKeys::MissileModeVDU(), FireKeyboard::MissileTargetKey(), FireKeyboard::MissionTargetKey(), mute(), GameCockpit::NavScreen(), FireKeyboard::NearestBaseKey(), FireKeyboard::NearestDangerousHostileKey(), FireKeyboard::NearestFriendlyKey(), FireKeyboard::NearestHostileTargetKey(), FireKeyboard::NearestJumpKey(), FireKeyboard::NearestPlanetKey(), FireKeyboard::NearestTargetKey(), FireKeyboard::NearestTargetTurretKey(), CockpitKeys::ObjectiveModeVDU(), CockpitKeys::OutsideTarget(), CockpitKeys::Pan(), CockpitKeys::PanTarget(), FireKeyboard::PickTargetKey(), FireKeyboard::PickTargetTurretKey(), CockpitKeys::PitchDown(), CockpitKeys::PitchUp(), FireKeyboard::PressComm10Key(), FireKeyboard::PressComm1Key(), FireKeyboard::PressComm2Key(), FireKeyboard::PressComm3Key(), FireKeyboard::PressComm4Key(), FireKeyboard::PressComm5Key(), FireKeyboard::PressComm6Key(), FireKeyboard::PressComm7Key(), FireKeyboard::PressComm8Key(), FireKeyboard::PressComm9Key(), CockpitKeys::Quit(), FireKeyboard::RequestClearenceKey(), reset_time_compression(), GameCockpit::Respawn(), FireKeyboard::RestoreTarget10Key(), FireKeyboard::RestoreTarget1Key(), FireKeyboard::RestoreTarget2Key(), FireKeyboard::RestoreTarget3Key(), FireKeyboard::RestoreTarget4Key(), FireKeyboard::RestoreTarget5Key(), FireKeyboard::RestoreTarget6Key(), FireKeyboard::RestoreTarget7Key(), FireKeyboard::RestoreTarget8Key(), FireKeyboard::RestoreTarget9Key(), CockpitKeys::ReverseGunModeVDU(), FireKeyboard::ReverseIncomingMissileTargetKey(), FireKeyboard::ReverseMisSelKey(), CockpitKeys::ReverseMissileModeVDU(), FireKeyboard::ReverseMissileTargetKey(), FireKeyboard::ReverseMissionTargetKey(), FireKeyboard::ReverseNearestTargetKey(), FireKeyboard::ReversePickTargetKey(), FireKeyboard::ReverseSigTargetKey(), FireKeyboard::ReverseTargetKey(), FireKeyboard::ReverseThreatTargetKey(), FireKeyboard::ReverseUnitTargetKey(), FireKeyboard::ReverseWeapSelKey(), FlyByKeyboard::RightKey(), FlyByKeyboard::RollLeftKey(), FlyByKeyboard::RollRightKey(), RunPythonPhysicsFrame(), RunPythonPress(), RunPythonRelease(), RunPythonToggle(), FireKeyboard::SaveTarget10Key(), FireKeyboard::SaveTarget1Key(), FireKeyboard::SaveTarget2Key(), FireKeyboard::SaveTarget3Key(), FireKeyboard::SaveTarget4Key(), FireKeyboard::SaveTarget5Key(), FireKeyboard::SaveTarget6Key(), FireKeyboard::SaveTarget7Key(), FireKeyboard::SaveTarget8Key(), FireKeyboard::SaveTarget9Key(), CockpitKeys::ScanningModeVDU(), CockpitKeys::ScrollDown(), CockpitKeys::ScrollUp(), FlyByKeyboard::SetNullVelocityRefKey(), FireKeyboard::SetShieldsOff(), FireKeyboard::SetShieldsOneThird(), FireKeyboard::SetShieldsTwoThird(), FlyByKeyboard::SetVelocityRefKey(), FlyByKeyboard::SheltonKey(), FireKeyboard::SigTargetKey(), CockpitKeys::SkipMusicTrack(), FlyByKeyboard::StartKey(), FlyByKeyboard::StopKey(), FireKeyboard::SubUnitTargetKey(), SuicideKey(), FlyByKeyboard::SwitchCombatModeKey(), GameCockpit::SwitchControl(), CockpitKeys::SwitchLVDU(), CockpitKeys::SwitchMVDU(), CockpitKeys::SwitchRVDU(), FlyByKeyboard::SwitchSecured(), CockpitKeys::SwitchULVDU(), CockpitKeys::SwitchUMVDU(), CockpitKeys::SwitchURVDU(), FlyByKeyboard::SwitchWebcam(), FireKeyboard::TargetKey(), CockpitKeys::TargetModeVDU(), FireKeyboard::TargetTurretKey(), CockpitKeys::TextMessageKey(), FireKeyboard::ThreatTargetKey(), FireKeyboard::ThreatTargetTurretKey(), FireKeyboard::ToggleAnimation(), FireKeyboard::ToggleAutotracking(), FireKeyboard::ToggleGlow(), FireKeyboard::TogglePause(), FireKeyboard::ToggleWarpDrive(), FireKeyboard::TurretAIOff(), FireKeyboard::TurretAIOn(), GameCockpit::TurretControl(), FireKeyboard::TurretFireAtWill(), FireKeyboard::UnDockKey(), FireKeyboard::UnitTargetKey(), FlyByKeyboard::UpFreq(), FlyByKeyboard::UpKey(), CockpitKeys::ViewModeVDU(), CockpitKeys::ViewTarget(), VolDown(), VolUp(), FireKeyboard::WeapSelKey(), CockpitKeys::YawLeft(), CockpitKeys::YawRight(), CockpitKeys::ZoomIn(), CockpitKeys::ZoomOut(), and CockpitKeys::ZoomReset().

495 {
496  //I don't knwo why this gives linker errors!
498  commandMap["NoPositionalKey"] = mute;
499  commandMap["DopplerInc"] = incdop;
500  commandMap["Cockpit::NavScreen"] = GameCockpit::NavScreen;
501  commandMap["DopplerDec"] = decdop;
502  commandMap["VolumeInc"] = VolUp;
503  commandMap["VolumeDec"] = VolDown;
504  commandMap["MusicVolumeInc"] = incmusicvol;
505  commandMap["MusicVolumeDec"] = decmusicvol;
506  commandMap["SetShieldsOneThird"] = FireKeyboard::SetShieldsOneThird;
507  commandMap["SetShieldsOff"] = FireKeyboard::SetShieldsOff;
508  commandMap["SetShieldsTwoThird"] = FireKeyboard::SetShieldsTwoThird;
509  commandMap["SwitchControl"] = GameCockpit::SwitchControl;
510  commandMap["Respawn"] = GameCockpit::Respawn;
511  commandMap["TurretControl"] = GameCockpit::TurretControl;
512 
513  commandMap["TimeInc"] = inc_time_compression;
514  commandMap["TimeDec"] = dec_time_compression;
515  commandMap["TimeReset"] = reset_time_compression;
516  //mapping from command string to keyboard handler
517  //Networking bindings
518 
519  commandMap["SwitchWebcam"] = FlyByKeyboard::SwitchWebcam;
520  commandMap["SwitchSecured"] = FlyByKeyboard::SwitchSecured;
521  commandMap["ChangeCommStatus"] = FlyByKeyboard::ChangeCommStatus;
522  commandMap["UpFreq"] = FlyByKeyboard::UpFreq;
523  commandMap["DownFreq"] = FlyByKeyboard::DownFreq;
524 
525  commandMap["ThrustModeKey"] = FlyByKeyboard::KSwitchFlightMode;
526  commandMap["ThrustRight"] = FlyByKeyboard::KThrustRight;
527  commandMap["ThrustLeft"] = FlyByKeyboard::KThrustLeft;
528  commandMap["ThrustBack"] = FlyByKeyboard::KThrustBack;
529  commandMap["ThrustFront"] = FlyByKeyboard::KThrustFront;
530  commandMap["ThrustDown"] = FlyByKeyboard::KThrustDown;
531  commandMap["ThrustUp"] = FlyByKeyboard::KThrustUp;
532  commandMap["TextMessage"] = CockpitKeys::TextMessageKey;
533  commandMap["JoyStickToggleKey"] = JoyStickToggleKey;
534  commandMap["ToggleAutotracking"] = FireKeyboard::ToggleAutotracking;
535  commandMap["SheltonKey"] = FlyByKeyboard::SheltonKey;
536  commandMap["MatchSpeedKey"] = FlyByKeyboard::MatchSpeedKey;
537  commandMap["PauseKey"] = FireKeyboard::TogglePause;
538  commandMap["JumpKey"] = FlyByKeyboard::JumpKey;
539  commandMap["AutoKey"] = FlyByKeyboard::AutoKey;
540  commandMap["SwitchCombatMode"] = FlyByKeyboard::SwitchCombatModeKey;
541  commandMap["StartKey"] = FlyByKeyboard::StartKey;
542  commandMap["StopKey"] = FlyByKeyboard::StopKey;
543  commandMap["Screenshot"] = doScreenshot;
544  commandMap["UpKey"] = FlyByKeyboard::UpKey;
545  commandMap["DownKey"] = FlyByKeyboard::DownKey;
546  commandMap["LeftKey"] = FlyByKeyboard::LeftKey;
547  commandMap["RightKey"] = FlyByKeyboard::RightKey;
548  commandMap["ABKey"] = FlyByKeyboard::ABKey;
549  commandMap["AccelKey"] = FlyByKeyboard::AccelKey;
550  commandMap["DecelKey"] = FlyByKeyboard::DecelKey;
551  commandMap["RollLeftKey"] = FlyByKeyboard::RollLeftKey;
552  commandMap["RollRightKey"] = FlyByKeyboard::RollRightKey;
553  commandMap["SetVelocityRefKey"] = FlyByKeyboard::SetVelocityRefKey;
554  commandMap["SetVelocityNullKey"] = FlyByKeyboard::SetNullVelocityRefKey;
555  commandMap["ToggleGlow"] = FireKeyboard::ToggleGlow;
556  commandMap["ToggleWarpDrive"] = FireKeyboard::ToggleWarpDrive;
557  commandMap["ToggleAnimation"] = FireKeyboard::ToggleAnimation;
558  commandMap["CommAttackTarget"] = FireKeyboard::AttackTarget;
559  commandMap["ASAP"] = FlyByKeyboard::EngageSpecAuto;
560 
561  commandMap["CommHelpMeOutCrit"] = FireKeyboard::HelpMeOutCrit;
562  commandMap["CommHelpMeOutFaction"] = FireKeyboard::HelpMeOutFaction;
563  commandMap["JoinFlightgroup"] = FireKeyboard::JoinFg;
564  commandMap["CommAttackTarget"] = FireKeyboard::AttackTarget;
565  commandMap["CommHelpMeOut"] = FireKeyboard::HelpMeOut;
566  commandMap["CommFormUp"] = FireKeyboard::FormUp;
567  commandMap["CommDockWithMe"] = FireKeyboard::DockWithMe;
568  commandMap["CommDefendTarget"] = FireKeyboard::DefendTarget;
569  commandMap["CommDockAtTarget"] = FireKeyboard::DockTarget;
570  commandMap["CommHoldPosition"] = FireKeyboard::HoldPosition;
571  //Added for nearest unit targeting -ch
572  commandMap["NearestHostileTargetKey"] = FireKeyboard::NearestHostileTargetKey;
573  commandMap["NearestDangerousHostileKey"] = FireKeyboard::NearestDangerousHostileKey;
574  commandMap["NearestFriendlyKey"] = FireKeyboard::NearestFriendlyKey;
575  commandMap["NearestBaseKey"] = FireKeyboard::NearestBaseKey;
576  commandMap["NearestPlanetKey"] = FireKeyboard::NearestPlanetKey;
577  commandMap["NearestJumpKey"] = FireKeyboard::NearestJumpKey;
578 
579 #ifdef CAR_SIM
580  commandMap["BlinkLeftKey"] = FireKeyboard::BlinkLeftKey;
581  commandMap["BlinkRightKey"] = FireKeyboard::BlinkRightKey;
582  commandMap["HeadlightKey"] = FireKeyboard::HeadlightKey;
583  commandMap["SirenKey"] = FireKeyboard::SirenKey;
584 #endif
585  commandMap["CommBreakForm"] = FireKeyboard::BreakFormation;
586 
587  commandMap["Comm1Key"] = FireKeyboard::PressComm1Key;
588  commandMap["Comm2Key"] = FireKeyboard::PressComm2Key;
589  commandMap["Comm3Key"] = FireKeyboard::PressComm3Key;
590  commandMap["Comm4Key"] = FireKeyboard::PressComm4Key;
591  commandMap["Comm5Key"] = FireKeyboard::PressComm5Key;
592  commandMap["Comm6Key"] = FireKeyboard::PressComm6Key;
593  commandMap["Comm7Key"] = FireKeyboard::PressComm7Key;
594  commandMap["Comm8Key"] = FireKeyboard::PressComm8Key;
595  commandMap["Comm9Key"] = FireKeyboard::PressComm9Key;
596  commandMap["Comm10Key"] = FireKeyboard::PressComm10Key;
597 
598  commandMap["SaveTarget1"] = FireKeyboard::SaveTarget1Key;
599  commandMap["SaveTarget2"] = FireKeyboard::SaveTarget2Key;
600  commandMap["SaveTarget3"] = FireKeyboard::SaveTarget3Key;
601  commandMap["SaveTarget4"] = FireKeyboard::SaveTarget4Key;
602  commandMap["SaveTarget5"] = FireKeyboard::SaveTarget5Key;
603  commandMap["SaveTarget6"] = FireKeyboard::SaveTarget6Key;
604  commandMap["SaveTarget7"] = FireKeyboard::SaveTarget7Key;
605  commandMap["SaveTarget8"] = FireKeyboard::SaveTarget8Key;
606  commandMap["SaveTarget9"] = FireKeyboard::SaveTarget9Key;
607  commandMap["SaveTarget10"] = FireKeyboard::SaveTarget10Key;
608 
609  commandMap["RestoreTarget1"] = FireKeyboard::RestoreTarget1Key;
610  commandMap["RestoreTarget2"] = FireKeyboard::RestoreTarget2Key;
611  commandMap["RestoreTarget3"] = FireKeyboard::RestoreTarget3Key;
612  commandMap["RestoreTarget4"] = FireKeyboard::RestoreTarget4Key;
613  commandMap["RestoreTarget5"] = FireKeyboard::RestoreTarget5Key;
614  commandMap["RestoreTarget6"] = FireKeyboard::RestoreTarget6Key;
615  commandMap["RestoreTarget7"] = FireKeyboard::RestoreTarget7Key;
616  commandMap["RestoreTarget8"] = FireKeyboard::RestoreTarget8Key;
617  commandMap["RestoreTarget9"] = FireKeyboard::RestoreTarget9Key;
618  commandMap["RestoreTarget10"] = FireKeyboard::RestoreTarget10Key;
619 
620  commandMap["FreeSlaves"] = FireKeyboard::FreeSlaveKey;
621  commandMap["Enslave"] = FireKeyboard::EnslaveKey;
622  commandMap["EjectCargoKey"] = FireKeyboard::EjectCargoKey;
623  commandMap["EjectNonMissionCargoKey"] = FireKeyboard::EjectNonMissionCargoKey;
624  commandMap["EjectKey"] = FireKeyboard::EjectKey;
625  commandMap["EjectDockKey"] = FireKeyboard::EjectDockKey;
626  commandMap["SuicideKey"] = SuicideKey;
627  commandMap["TurretAIOn"] = FireKeyboard::TurretAIOn;
628  commandMap["TurretAIOff"] = FireKeyboard::TurretAIOff;
629  commandMap["TurretAIFireAtWill"] = FireKeyboard::TurretFireAtWill;
630 
631  commandMap["DockKey"] = FireKeyboard::DockKey;
632  commandMap["UnDockKey"] = FireKeyboard::UnDockKey;
633  commandMap["RequestClearenceKey"] = FireKeyboard::RequestClearenceKey;
634  commandMap["FireKey"] = FireKeyboard::FireKey;
635  commandMap["MissileKey"] = FireKeyboard::MissileKey;
636  commandMap["TargetKey"] = FireKeyboard::TargetKey;
637  commandMap["LockTargetKey"] = FireKeyboard::LockKey;
638  commandMap["ReverseTargetKey"] = FireKeyboard::ReverseTargetKey;
639  commandMap["PickTargetKey"] = FireKeyboard::PickTargetKey;
640  commandMap["SubUnitTargetKey"] = FireKeyboard::SubUnitTargetKey;
641  commandMap["NearestTargetKey"] = FireKeyboard::NearestTargetKey;
642  commandMap["MissileTargetKey"] = FireKeyboard::MissileTargetKey;
643  commandMap["IncomingMissileTargetKey"] = FireKeyboard::IncomingMissileTargetKey;
644  commandMap["ReverseMissileTargetKey"] = FireKeyboard::ReverseMissileTargetKey;
645  commandMap["ReverseIncomingMissileTargetKey"] = FireKeyboard::ReverseIncomingMissileTargetKey;
646  commandMap["ThreatTargetKey"] = FireKeyboard::ThreatTargetKey;
647  commandMap["SigTargetKey"] = FireKeyboard::SigTargetKey;
648  commandMap["UnitTargetKey"] = FireKeyboard::UnitTargetKey;
649  commandMap["ReversePickTargetKey"] = FireKeyboard::ReversePickTargetKey;
650  commandMap["ReverseNearestTargetKey"] = FireKeyboard::ReverseNearestTargetKey;
651  commandMap["ReverseThreatTargetKey"] = FireKeyboard::ReverseThreatTargetKey;
652  commandMap["ReverseSigTargetKey"] = FireKeyboard::ReverseSigTargetKey;
653  commandMap["ReverseUnitTargetKey"] = FireKeyboard::ReverseUnitTargetKey;
654  commandMap["MissionTargetKey"] = FireKeyboard::MissionTargetKey;
655  commandMap["ReverseMissionTargetKey"] = FireKeyboard::ReverseMissionTargetKey;
656  commandMap["TurretTargetKey"] = FireKeyboard::TargetTurretKey;
657  commandMap["TurretPickTargetKey"] = FireKeyboard::PickTargetTurretKey;
658  commandMap["TurretNearestTargetKey"] = FireKeyboard::NearestTargetTurretKey;
659  commandMap["TurretThreatTargetKey"] = FireKeyboard::ThreatTargetTurretKey;
660  commandMap["WeapSelKey"] = FireKeyboard::WeapSelKey;
661  commandMap["MisSelKey"] = FireKeyboard::MisSelKey;
662  commandMap["ReverseWeapSelKey"] = FireKeyboard::ReverseWeapSelKey;
663  commandMap["ReverseMisSelKey"] = FireKeyboard::ReverseMisSelKey;
664  commandMap["CloakKey"] = FireKeyboard::CloakKey;
665  commandMap["ECMKey"] = FireKeyboard::ECMKey;
666 
667  commandMap["RunPythonPress"] = RunPythonPress;
668  commandMap["RunPythonRelease"] = RunPythonRelease;
669  commandMap["RunPythonToggle"] = RunPythonToggle;
670  commandMap["RunPythonPhysicsFrame"] = RunPythonPhysicsFrame;
671  commandMap["ComposeFunctions"] = ComposeFunctions;
672  commandMap["ComposeFunctionsToggle"] = ComposeFunctionsToggle;
673  commandMap["Cockpit::ScrollDown"] = CockpitKeys::ScrollDown;
674  commandMap["Cockpit::ScrollUp"] = CockpitKeys::ScrollUp;
675 
676  commandMap["Cockpit::PitchDown"] = CockpitKeys::PitchDown;
677  commandMap["Cockpit::PitchUp"] = CockpitKeys::PitchUp;
678  commandMap["Cockpit::YawLeft"] = CockpitKeys::YawLeft;
679  commandMap["Cockpit::YawRight"] = CockpitKeys::YawRight;
680  commandMap["Cockpit::LookDown"] = CockpitKeys::LookDown;
681  commandMap["Cockpit::LookUp"] = CockpitKeys::LookUp;
682  commandMap["Cockpit::LookLeft"] = CockpitKeys::LookLeft;
683  commandMap["Cockpit::LookRight"] = CockpitKeys::LookRight;
684  commandMap["Cockpit::ViewTarget"] = CockpitKeys::ViewTarget;
685  commandMap["Cockpit::OutsideTarget"] = CockpitKeys::OutsideTarget;
686  commandMap["Cockpit::PanTarget"] = CockpitKeys::PanTarget;
687  commandMap["Cockpit::ZoomOut"] = CockpitKeys::ZoomOut;
688  commandMap["Cockpit::ZoomIn"] = CockpitKeys::ZoomIn;
689  commandMap["Cockpit::ZoomReset"] = CockpitKeys::ZoomReset;
690  commandMap["Cockpit::Inside"] = CockpitKeys::Inside;
691  commandMap["Cockpit::InsideLeft"] = CockpitKeys::InsideLeft;
692  commandMap["Cockpit::InsideRight"] = CockpitKeys::InsideRight;
693  commandMap["Cockpit::InsideBack"] = CockpitKeys::InsideBack;
694  commandMap["Cockpit::SwitchLVDU"] = CockpitKeys::SwitchLVDU;
695 
696  commandMap["Cockpit::CommMode"] = CockpitKeys::CommModeVDU;
697  commandMap["Cockpit::TargetMode"] = CockpitKeys::TargetModeVDU;
698  commandMap["Cockpit::ManifestMode"] = CockpitKeys::ManifestModeVDU;
699  commandMap["Cockpit::ViewMode"] = CockpitKeys::ViewModeVDU;
700  commandMap["Cockpit::DamageMode"] = CockpitKeys::DamageModeVDU;
701  commandMap["Cockpit::GunMode"] = CockpitKeys::GunModeVDU;
702  commandMap["Cockpit::ReverseGunMode"] = CockpitKeys::ReverseGunModeVDU;
703  commandMap["Cockpit::MissileMode"] = CockpitKeys::MissileModeVDU;
704  commandMap["Cockpit::ReverseMissileMode"] = CockpitKeys::ReverseMissileModeVDU;
705  commandMap["Cockpit::ObjectiveMode"] = CockpitKeys::ObjectiveModeVDU;
706  commandMap["Cockpit::ScanningMode"] = CockpitKeys::ScanningModeVDU;
707 
708  commandMap["Cockpit::MapKey"] = MapKey;
709  commandMap["Cockpit::SwitchRVDU"] = CockpitKeys::SwitchRVDU;
710  commandMap["Cockpit::SwitchMVDU"] = CockpitKeys::SwitchMVDU;
711  commandMap["Cockpit::SwitchURVDU"] = CockpitKeys::SwitchURVDU;
712  commandMap["Cockpit::SwitchULVDU"] = CockpitKeys::SwitchULVDU;
713  commandMap["Cockpit::SwitchUMVDU"] = CockpitKeys::SwitchUMVDU;
714  commandMap["Cockpit::Behind"] = CockpitKeys::Behind;
715  commandMap["Cockpit::Pan"] = CockpitKeys::Pan;
716  commandMap["Cockpit::SkipMusicTrack"] = CockpitKeys::SkipMusicTrack;
717 
718  commandMap["Cockpit::Quit"] = CockpitKeys::Quit;
719 
720  commandMap["Joystick::Mode::InertialXY"] = FlyByKeyboard::JoyInertialXYPulsorKey;
721  commandMap["Joystick::Mode::InertialXYToggle"] = FlyByKeyboard::JoyInertialXYToggleKey;
722  commandMap["Joystick::Mode::InertialXZ"] = FlyByKeyboard::JoyInertialXYPulsorKey;
723  commandMap["Joystick::Mode::InertialXZToggle"] = FlyByKeyboard::JoyInertialXYToggleKey;
724  commandMap["Joystick::Mode::Roll"] = FlyByKeyboard::JoyRollPulsorKey;
725  commandMap["Joystick::Mode::RollToggle"] = FlyByKeyboard::JoyRollToggleKey;
726  commandMap["Joystick::Mode::Bank"] = FlyByKeyboard::JoyBankPulsorKey;
727  commandMap["Joystick::Mode::BankToggle"] = FlyByKeyboard::JoyBankToggleKey;
728 
729  commandMap["Flight::Mode::InertialPulsor"] = FlyByKeyboard::InertialPulsorKey;
730  commandMap["Flight::Mode::InertialToggle"] = FlyByKeyboard::InertialToggleKey;
731 
732  commandMap["ConsoleKeys::BringConsole"] = ConsoleKeys::BringConsole;
733  commandMap["NewShader"] = doReloadShader;
734 
735  return commandMap;
736 }
void JoyStickToggleKey ( const KBData ,
KBSTATE  a 
)

Definition at line 84 of file in_joystick.cpp.

References JoyStickToggle, and PRESS.

Referenced by initGlobalCommandMap().

85 {
86  if (a == PRESS)
88 }
void MapKey ( const KBData ,
KBSTATE  a 
)

Definition at line 1882 of file cockpit.cpp.

References _Universe, Universe::CurrentCockpit(), and PRESS.

Referenced by initGlobalCommandMap().

1883 {
1884  if (k == PRESS) {
1885  static VSSprite ul( "upper-left-map.spr" );
1886  static VSSprite ur( "upper-right-map.spr" );
1887  static VSSprite ll( "lower-left-map.spr" );
1888  static VSSprite lr( "lower-right-map.spr" );
1889  while ( univmap.size() <= _Universe->CurrentCockpit() )
1890  univmap.push_back( UnivMap( NULL, NULL, NULL, NULL ) );
1891  if ( univmap[_Universe->CurrentCockpit()].isNull() )
1892  univmap[_Universe->CurrentCockpit()] = UnivMap( &ul, &ur, &ll, &lr );
1893  else
1894  univmap[_Universe->CurrentCockpit()] = UnivMap( NULL, NULL, NULL, NULL );
1895  }
1896 }
void mute ( const KBData ,
KBSTATE  a 
)

Definition at line 107 of file config_xml.cpp.

Referenced by initGlobalCommandMap().

108 {
109 #ifdef HAVE_AL
110 #endif
111 }
void reset_time_compression ( const KBData ,
KBSTATE  a 
)

Definition at line 79 of file lin_time.cpp.

Referenced by GameCockpit::Draw(), initGlobalCommandMap(), and pause_key().

80 {
81  if (a == PRESS) {
82  timecompression = 1;
83  timecount = 0;
84  }
85 }
void RunPythonPhysicsFrame ( const KBData ,
KBSTATE   
)

Definition at line 158 of file python_compile.cpp.

References CompileRunPython(), KBData::data, DOWN, pySetScratchVector(), UniverseUtil::setScratchVector(), UP, and Vector.

Referenced by initGlobalCommandMap().

159 {
160  if ( (k == DOWN || k == UP) && s.data.length() ) {
161  pySetScratchVector( k );
162  CompileRunPython( s.data );
164  }
165 }
void RunPythonPress ( const KBData ,
KBSTATE   
)

Definition at line 131 of file python_compile.cpp.

References CompileRunPython(), KBData::data, PRESS, pySetScratchVector(), UniverseUtil::setScratchVector(), and Vector.

Referenced by initGlobalCommandMap().

132 {
133  if ( k == PRESS && s.data.length() ) {
134  pySetScratchVector( k );
135  CompileRunPython( s.data );
137  }
138 }
void RunPythonRelease ( const KBData ,
KBSTATE   
)

Definition at line 140 of file python_compile.cpp.

References CompileRunPython(), KBData::data, pySetScratchVector(), RELEASE, UniverseUtil::setScratchVector(), and Vector.

Referenced by initGlobalCommandMap().

141 {
142  if ( k == RELEASE && s.data.length() ) {
143  pySetScratchVector( k );
144  CompileRunPython( s.data );
146  }
147 }
void RunPythonToggle ( const KBData ,
KBSTATE   
)

Definition at line 149 of file python_compile.cpp.

References CompileRunPython(), KBData::data, PRESS, pySetScratchVector(), RELEASE, UniverseUtil::setScratchVector(), and Vector.

Referenced by initGlobalCommandMap().

150 {
151  if ( (k == RELEASE || k == PRESS) && s.data.length() ) {
152  pySetScratchVector( k );
153  CompileRunPython( s.data );
155  }
156 }
void SuicideKey ( const KBData ,
KBSTATE  a 
)

Definition at line 1824 of file cockpit.cpp.

References _Universe, Universe::AccessCockpit(), Unit::ArmorData(), Unit::DealDamageToHull(), Unit::GetHull(), Cockpit::GetParent(), newtime, PRESS, and Vector.

Referenced by initGlobalCommandMap().

1825 {
1826  static int orig = 0;
1827  if (k == PRESS) {
1828  int newtime = time( NULL );
1829  if (newtime-orig > 8 || orig == 0) {
1830  orig = newtime;
1831  Unit *un = NULL;
1832  if ( ( un = _Universe->AccessCockpit()->GetParent() ) ) {
1833  float armor[8]; //short fix
1834  un->ArmorData( armor );
1835  un->DealDamageToHull( Vector( 0, 0,
1836  .1 ), un->GetHull()*256.+2+2
1837  *(armor[1]+armor[2]+armor[3]+armor[4]+armor[5]+armor[6]+armor[7]+armor[0]) );
1838  }
1839  }
1840  }
1841 }
void VolDown ( const KBData ,
KBSTATE  a 
)

Definition at line 111 of file main_loop.cpp.

References AUDGetListenerGain(), AUDListenerGain(), Music::ChangeVolume(), and PRESS.

Referenced by initGlobalCommandMap().

112 {
113  if (newState == PRESS) {
114  float gain = AUDGetListenerGain();
115  if (gain > 0) {
116  gain -= .03125;
117  if (gain < 0) gain = 0;
118  AUDListenerGain( gain );
119  Music::ChangeVolume( 0 );
120  }
121  }
122 }
void VolUp ( const KBData ,
KBSTATE  a 
)

Definition at line 97 of file main_loop.cpp.

References AUDGetListenerGain(), AUDListenerGain(), Music::ChangeVolume(), and PRESS.

Referenced by initGlobalCommandMap().

98 {
99  if (newState == PRESS) {
100  float gain = AUDGetListenerGain();
101  if (gain < 1) {
102  gain += .0625;
103  if (gain > 1) gain = 1;
104  AUDListenerGain( gain );
105  Music::ChangeVolume( 0 );
106  }
107  }
108 }

Variable Documentation

CommandMap commandMap = initGlobalCommandMap()
static

Definition at line 211 of file config_xml.cpp.

Referenced by ComposeFunctions(), and initGlobalCommandMap().

const float dopinc = .1

Definition at line 70 of file config_xml.cpp.

Referenced by decdop(), and incdop().

bool screenshotkey = false

Definition at line 77 of file config_xml.cpp.

Referenced by doScreenshot().

const float volinc = 1

Definition at line 69 of file config_xml.cpp.

Referenced by decvol(), and incvol().